Aquí la lista de comandos básicos para movernos por Linux:
ls – Listar archivos y directorios
cd – Cambiar directorio de trabajo
pwd – Mostrar directorio actual
mkdir – crear directorio
Opciones con ls
Sólo ls:
kike@kike-lubuntu:/var/www/html$ ls asir dam daw index.html principal.html
Con -l mostramos formato largo:
kike@kike-lubuntu:/var/www/html$ ls -l total 20 drwxr-xr-x 2 root root 4096 feb 2 2015 asir drwxr-xr-x 2 root root 4096 feb 2 2015 dam drwxr-xr-x 2 root root 4096 feb 2 2015 daw -rw-r--r-- 1 root root 180 feb 1 2015 index.html -rw-r--r-- 1 root root 204 feb 1 2015 principal.html
Con -h mostramos tamaño formato “humano”:
kike@kike-lubuntu:/var/www/html$ ls -h asir dam daw index.html principal.html
Con -r ordenado por última modificación:
kike@kike-lubuntu:/var/www/html$ ls -r principal.html index.html daw dam asir
Con -t mostramos de más antiguo a más reciente:
kike@kike-lubuntu:/var/www/html$ ls -t dam daw asir principal.html index.html
Podemos mezclar, por ejemplo, que nos muestre en formato largo y ordenado por tamaño, -lh
kike@kike-lubuntu:/$ ls -lh /var/www/html/ total 20K drwxr-xr-x 2 root root 4,0K feb 2 2015 asir drwxr-xr-x 2 root root 4,0K feb 2 2015 dam drwxr-xr-x 2 root root 4,0K feb 2 2015 daw -rw-r--r-- 1 root root 180 feb 1 2015 index.html -rw-r--r-- 1 root root 204 feb 1 2015 principal.html