Hola a todos aca les dejo una parte de mis comando utiles para linux.
Saludos
--
find "ruta" -type f | xargs grep "cadena a buscar"
Donde "ruta" se refiere a la ubicación del archivo y "cadena a buscar" es justamente eso,
la cadena de texto que deseamos buscar
---------------
STRACE -F -O /TMP/STRACE.OUT /PATH/TO/PROGRAMME will capture the system calls made by the programme including any exec()s of child processes.
So if you GREP EXEC /TMP/STRACE.OUT it may help give an idea of what programmes it calls.
--------------
netstat –-tcp –-numeric List of TCP connection to and from the machine
--------
netstat --tcp --listening –-programs Display TCP port that the server is
listening on along with the program that is listening on that particular port
------
NETSTAT –RNC Display the routing cache
netstat -ntl |grep 22 -->muestra si el puerto 22 esta abierto.
netstat -ant | grep 22 -->muestra que ip esta conectada por puerto 22
------
watch 'netstat -avi'
para ver en tiempo real la info de una placa
-------------------
para ver las interrupciones por segundo segun la arquitectura (es para ver el timer)
--> cat /proc/interrupts | grep timer
----
top -i --->muestra solamente los procesos que estan corriendo.
----
para ver la version de ubunut
lsb_release -a
--------
xrandr -s 800×600 -->para cambiar la resolucion
---------------
tcpdump: Monitor ALL eth1 Traffic Except My Own SSH Session
tcpdump -i eth1 -s 1500 port not 22
tcpdump -v -w tcp.out -->captura y guarda todo en .out
tcpdump -D --->muestra los eth.
tcpdump -v -c 50 -->hace solo la captura de 50 paquetes y si hay perdida de paquetes.
tcpdump -n -->disable layer 3 resolution name.
tcpdump -w ssh.out src host 192.168.1.101 and dst port 22-->captura y gurada en .out y filatra los paquetes del src host 192.168.1.101 y dst puerto 22
tcpdump -f tcp -->filtra solo para paquetes tcp.
-
You can skip additional ports too:
tcpdump -i eth1 -s 1500 port not 22 and port not 53
-
You can also use ip or hostname:
tcpdump -i eth1 port not 22 and host 1.2.3.4
-----------------------------------------
View Script That Run When You Install RPM Files
rpm -qp --scripts xx.rpm
-
To view scripts for installed packages, enter
rpm -q --scripts packageName
---------------------------------
Determine Which Services Are Enabled At Boot
chkconfig --list | grep '3:on'
--------------
---------------------------------------
lsof -n -i :69 --->find out which process what listening on port 69
lsof -n -u USER ---> You can also look for files opened by a given user or command
lsof -n -c COMMAND ---> You can also look for files opened by a given user or command
-----------------------------
BOOT PROCESS
/etc/rc.d/rc3.d --> aca esta esta los procesos de startup (puede ser rc5 segun el caso de boot)
order the processes are killed begin with a 'k'
order they start begin with an 's'
------------------
rpm -i --test something.rpm -->aca muestra si hay algun conflicto antes de instalar un rpm.
Saludos
--
find "ruta" -type f | xargs grep "cadena a buscar"
Donde "ruta" se refiere a la ubicación del archivo y "cadena a buscar" es justamente eso,
la cadena de texto que deseamos buscar
---------------
STRACE -F -O /TMP/STRACE.OUT /PATH/TO/PROGRAMME will capture the system calls made by the programme including any exec()s of child processes.
So if you GREP EXEC /TMP/STRACE.OUT it may help give an idea of what programmes it calls.
--------------
netstat –-tcp –-numeric List of TCP connection to and from the machine
--------
netstat --tcp --listening –-programs Display TCP port that the server is
listening on along with the program that is listening on that particular port
------
NETSTAT –RNC Display the routing cache
netstat -ntl |grep 22 -->muestra si el puerto 22 esta abierto.
netstat -ant | grep 22 -->muestra que ip esta conectada por puerto 22
------
watch 'netstat -avi'
para ver en tiempo real la info de una placa
-------------------
para ver las interrupciones por segundo segun la arquitectura (es para ver el timer)
--> cat /proc/interrupts | grep timer
----
top -i --->muestra solamente los procesos que estan corriendo.
----
para ver la version de ubunut
lsb_release -a
--------
xrandr -s 800×600 -->para cambiar la resolucion
---------------
tcpdump: Monitor ALL eth1 Traffic Except My Own SSH Session
tcpdump -i eth1 -s 1500 port not 22
tcpdump -v -w tcp.out -->captura y guarda todo en .out
tcpdump -D --->muestra los eth.
tcpdump -v -c 50 -->hace solo la captura de 50 paquetes y si hay perdida de paquetes.
tcpdump -n -->disable layer 3 resolution name.
tcpdump -w ssh.out src host 192.168.1.101 and dst port 22-->captura y gurada en .out y filatra los paquetes del src host 192.168.1.101 y dst puerto 22
tcpdump -f tcp -->filtra solo para paquetes tcp.
-
You can skip additional ports too:
tcpdump -i eth1 -s 1500 port not 22 and port not 53
-
You can also use ip or hostname:
tcpdump -i eth1 port not 22 and host 1.2.3.4
-----------------------------------------
View Script That Run When You Install RPM Files
rpm -qp --scripts xx.rpm
-
To view scripts for installed packages, enter
rpm -q --scripts packageName
---------------------------------
Determine Which Services Are Enabled At Boot
chkconfig --list | grep '3:on'
--------------
---------------------------------------
lsof -n -i :69 --->find out which process what listening on port 69
lsof -n -u USER ---> You can also look for files opened by a given user or command
lsof -n -c COMMAND ---> You can also look for files opened by a given user or command
-----------------------------
BOOT PROCESS
/etc/rc.d/rc3.d --> aca esta esta los procesos de startup (puede ser rc5 segun el caso de boot)
order the processes are killed begin with a 'k'
order they start begin with an 's'
------------------
rpm -i --test something.rpm -->aca muestra si hay algun conflicto antes de instalar un rpm.