Comandos

Imagen de mama21mama

Lugar donde iré agregando los comandos que uso frecuentemente.
Una buena técnica es si la tarea es usar varios comandos para una funcionalidad es ponerle
algún nombre. Así con esto lograremos recordarlos a todos.

Ejemplo de este es Xrec

sudo netstat -apn|grep 80 | grep lighttpd

quien esta conectado al puerto 80 con el servidor web lighttpd

sudo netstat -apn|grep 8080 | grep python

quien esta conectado al puerto 8080

sudo netstat -apn|grep 8000 | grep gnu

quien esta conectado al murmur en el puerto 8000

sudo netstat -apn|grep 59049 | grep squid

IPs detrás del squid

sudo tail -f /var/log/squid/access.log

que se baja que del squid

sudo du /media/Disco160/cache/squid --max-depth=1 -h

tamaño de la cache del squid

  1. 20 * * * 1 rm /var/log/kern.log.1
  2. 20 * * * 1 rm /var/log/ufw.log.1
  3. 20 * * * 1 rm /var/log/kern.log
  4. 20 * * * 1 rm /var/log/ufw.log

via crontab

  1. #!/bin/bash
  2. screen -U irssi
  3. exit 0

inicio de irssi con screen

ps aux | grep irssi

buscando el pid de irssi

screen -rS pid

reviviendo irssi con screen

convert -compress jpeg *.jpg mydoc.pdf

jpg a pdf

nmap mamalibre.no-ip.org -p 80 -sV

que version de programa en el puerto 80

tracepath mamalibre.no-ip.org

haciendo un tracer para averiguar por donde van los paquetes.

sudo hdparm -tT /dev/sda

Testea performance del Harddisk, tiempos de lecturas

-t Perform timings of device reads for benchmark and comparison purposes. For meaningful results, this opera‐
tion should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least
a couple of megabytes of free memory. This displays the speed of reading through the buffer cache to the
disk without any prior caching of data. This measurement is an indication of how fast the drive can sustain
sequential data reads under Linux, without any filesystem overhead. To ensure accurate measurements, the
buffer cache is flushed during the processing of -t using the BLKFLSBUF ioctl.

-T Perform timings of cache reads for benchmark and comparison purposes. For meaningful results, this opera‐
tion should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least
a couple of megabytes of free memory. This displays the speed of reading directly from the Linux buffer
cache without disk access. This measurement is essentially an indication of the throughput of the proces‐
sor, cache, and memory of the system under test.

grep -irn "/page/" tdf.php | grep -v Logg

Buscar el codigo /page/ en en tdf.php, se podria buscar en todos los archivos cambiando a .

cat << EOF > a.txt

creando archivos con "Here document", luego de esa linea se presiona enter y para terminar EOF+ enter

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr

quien esta conectado

wc -l file

muestra el número de salto de línea

ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'

Para saber la fecha de la instalación de GNU/Linux
Si tiene interes de que falta algun comando util puedes agregarlo en el comentario. metal

legadolibre