Difference between revisions of "Linux commands"
Rafahsolis (talk | contribs) m (Protected "Linux commands" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
Rafahsolis (talk | contribs) |
||
| Line 3: | Line 3: | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
| − | ! | + | ! Command !! Description |
|- | |- | ||
| tty || Shows the terminal where you are connected | | tty || Shows the terminal where you are connected | ||
| Line 75: | Line 75: | ||
== Processes == | == Processes == | ||
| + | {| class="wikitable sortable" | ||
| + | |- | ||
| + | ! Commands !! Description | ||
| + | |- | ||
| + | | || | ||
| + | |} | ||
| + | == Users == | ||
| + | {| class="wikitable sortable" | ||
| + | |- | ||
| + | ! Command !! Description | ||
| + | |- | ||
| + | | w || Show connected users | ||
| + | |- | ||
| + | | chown <NewOwner>:<NewGroup> <File>|| Change file owner | ||
| + | |- | ||
| + | | chgrp <NewGroup> <File> || Change group of file | ||
| + | |} | ||
| + | == Processes == | ||
| + | PROCESOS | ||
| + | Listar procesos: jobs | ||
| + | Para ejecutar en segundo plano poner $ | ||
| + | Interrumpir proceso CTRL + C | ||
| + | Pausar proceso CTRL + Z | ||
| + | Recuperar proceso pausado: %PID | ||
| + | Reanudar proceso detenido en segundo plano: bg %PID | ||
| + | Información de procesos: ps, pstree, top, htop (ps -ef) | ||
| + | Parar proceso: kill %PID | ||
| + | Establecer prioridades: nice -n -5 COMANDO, renice 7 PID | ||
| + | Ejecutar procesos evitando que se paren si se cierra la terminal: nohup COMANDO | ||
| + | top, atop, htop: utilidades procesos completilla | ||
| + | pgrep: devuelve el pid del proceso que coincide con la busqueda | ||
| + | locate programa: encuentra la ubicación de un programa | ||
| + | |||
| + | scp archivoorigen usuarioremoto@máquinaremota:destino | ||
| + | vnc:escritorio remoto | ||
| − | Firewall | + | == Firewall == |
| − | iptables -l | + | iptables -l List firewall rules |
| − | service iptables [start, stop] | + | service iptables [start, stop] Activate/deactivate firewall |
route -n Muestra la tabla de enrutamiento | route -n Muestra la tabla de enrutamiento | ||
| Line 140: | Line 175: | ||
Archivo de configuración: /.config/terminator/config +++man terminator_config | Archivo de configuración: /.config/terminator/config +++man terminator_config | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
JOHN | JOHN | ||
Revision as of 17:17, 8 April 2015
Linux commands
| Command | Description |
|---|---|
| tty | Shows the terminal where you are connected |
| free | Shows free memory |
| date | Shows date |
| cal | Shows calendar |
| clear | Clear screen |
| who | Connected persons |
| whoami | Who am i |
| uname | Shows system info |
| du | Disk ussage |
| df | Shows the disk ussage. Example: df -h |
| man <command> | Sowhs a command manual page |
| apropos <subject> | Sows commnads related to a subject |
| info <command> | Sows command info |
| history | Shows the commnad history (contained in ~.bash_history) |
| pwd | Shows working directory |
| touch <file_name> | Creates an empty file |
| alias | Creates a commnad |
| cat <filename> | Shows file content |
| more <filename> | Shows file content, screen by screen |
| head | Shows file start (-n, -f,...) |
| tail | Shows file end (-n, -f, ...) |
| sort | Sorts the content of a file line by line |
| <cmd1> | <cmd2> | Pipe: takes the output of command1 as input of command2. example: cat /etc/passwd | sort | more |
| rsync -a ruta1 ruta2 [--exclude=/{dir1, dir2..]/] | Copies files from ruta1 to ruta2 excluding dir1, dir2,... |
| grep <text> | finds text |
| wc -l | Counts lines |
| find | Find files |
| apt-get | Package installation and system update |
| dpkg | .deb package installation: sudo dpkg -i packagename.deb |
| su | Log as root at the terminal (sudo su) |
| mount | File sistem mounting |
| vim | Text file editor |
| mc | Midnight commander. File system navigation |
| alien | Migrate packages from .rpm to .deb and vice versa |
Processes
| Commands | Description |
|---|---|
Users
| Command | Description |
|---|---|
| w | Show connected users |
| chown <NewOwner>:<NewGroup> <File> | Change file owner |
| chgrp <NewGroup> <File> | Change group of file |
Processes
PROCESOS Listar procesos: jobs
Para ejecutar en segundo plano poner $
Interrumpir proceso CTRL + C
Pausar proceso CTRL + Z
Recuperar proceso pausado: %PID
Reanudar proceso detenido en segundo plano: bg %PID
Información de procesos: ps, pstree, top, htop (ps -ef)
Parar proceso: kill %PID
Establecer prioridades: nice -n -5 COMANDO, renice 7 PID
Ejecutar procesos evitando que se paren si se cierra la terminal: nohup COMANDO
top, atop, htop: utilidades procesos completilla
pgrep: devuelve el pid del proceso que coincide con la busqueda
locate programa: encuentra la ubicación de un programa
scp archivoorigen usuarioremoto@máquinaremota:destino
vnc:escritorio remoto
Firewall
iptables -l List firewall rules service iptables [start, stop] Activate/deactivate firewall route -n Muestra la tabla de enrutamiento
Instalar KDE
apt-get install kali-defaults kali-root-login desktop-base kde-full
aptitude --purge paquete desinstala un paquete
df -h Muestra lo que hay montado fdisk -l Muestra las particiones
COMPILAR KERNEL 1.- Descargar fuentes apt-get install (version nucleo se averigua con uname -r) se guarda en /usr/src/versionkernel descomprimir el archivo con tar xvf archivo entrar en la carpeta descomprimida 2.- Configurar 3.- Compilar instalar build-essential y libncurses5-dev (con apt-get install) make clean limpia anteriores compilaciones make menuconfig make deb-pkg se generan: linux-image.dev linux-libc.dev linux-headers.deb instalar con dpkg -i
WGET wget -xr website.com will download recursively all the files on that site
-r
--recursive
Turn on recursive retrieving. The default maximum depth is 5.
-l depth
--level=depth
Specify recursion maximum depth level depth
wget -m http://nombredelsitioweb.com wget -H -r --level=1 -k -p http://nombredelsitioweb.com"
TERMINATOR
inciar: terminator
dividir horizontal: CTRL+SHIFT+O
dividir vertical CTRL+SHIFT+E
Redimensionar CTRL+SHIFT+FLECHAS
carmibar de terminal: ALT+FLECHA
Copiar: CTRL+SHIFT+C
Pegar: CTRL+SHIFT+V
Cerrar ventana: CTRL+SHIFT+W
Mostrartodos/Mostrar 1: CTRL+SHIFT+X
Cerrar todo: CTRL+SHIFT+Q
Ampliar/reducir texto: CTRL+ '+/-'
Agrupar todos los terminales en una ventana: SUPER+t
Desagrupar todos los terminales de una ventana: SUPER+SHIFT+T
Archivo de configuración: /.config/terminator/config +++man terminator_config
JOHN
se crea el directorio /root/.john
john --wordlist:[archivodiccionario] [archivo paswords]
john --show[=LEFT] show cracked passwords [if =LEFT, then uncracked]
ARCHIVOS IMPORTANTES
/etc/sudoers
carpetas de archivos ejecutables (para cada usuario en archivo home .bashrc, abrir con vim.bashrc)
(Ver /usr/share/doc/examples/startup-files del paquete bash-doc)
/opt/sge/bin
/usr/local/bin
/etc/init.d/ "directorio para los escripts de los daemons aplicaciones arrancan al inicio.
RED /etc/network/interfaces Configuración de red /etc/NetworkManager/system-connections/name-of-connection NETWORK nm-tool nm-connection-editor /etc/NetworkManager/system-connections/name-of-connection iwconfig: Muestra las conexiones inalambrica service networkmanager restart: Reinicia network manager service networking restart: Reinicia el demonio de red HARDWARE lspci -v: Muestra información dispositivos PCI