Comandos básicos para los más nuevos
|
Crear fichero
|
touch fichero.txt
|
|
echo > fichero.txt
|
|
|
Eliminar fichero
|
rm fichero.txt
|
|
Eliminar fichero [forzoso]
|
rm -f fichero.txt
|
|
Mostrar contenido
|
cat
|
|
Abrir fichero con visualizador
|
less
|
|
Mostrar contenido de arriba a abajo
|
more
|
|
Mostrar las 10 primeras líneas
|
head
|
|
Mostrar las 10 últimas líneas
|
tail
|
|
Abrir en editor
|
vi / vim / nano
|
|
Abrir en editor en modo lectura [vi]
|
vi / vim -R
|
|
Abrir en editor en modo lectura [nano]
|
nano --view
|
|
Crear
|
mkdir
|
|
Eliminar [vacio]
|
rmdir
|
|
Eliminar [con contenido]
|
rm -r
|
|
Listar
|
ls
|
|
Listar [ocultos]
|
ls -a
|
|
Copiar
|
cp
|
|
Copiar directorios recursivamente
|
cp -r <source> <destination>
|
|
Mover
|
mv <source> <destination>
|
|
Renombrar
|
mv
|
|
Borrar directorio
|
rm -r
|
|
Ver distribución Linux, kernel,
|
hostnamectl
|
|
lsb_release -a
|
|
|
Contar
|
wc -l
|
|
Cambiar permisos ficheros
|
chown
|
|
Filtrar
|
grep
|
|
filtrar + globbing
|
grep -E
|
|
Go to the first line of the file
|
gg
|
|
Go to the last line of the file
|
G
|
|
Go to the 10th line of the file
|
10G
|
|
Insert at cursor
|
i
|
|
Insert at start of line
|
I (i mayus)
|
|
Append line under cursor
|
o
|
|
Write file
|
:w
|
|
Quit vim
|
:q
|
|
Write and quit
|
:wq
|
|
Enlace duro
|
ln [destino] [nombre_del_enlace]
|
|
Enlace simbólico
|
ln -s [destino] [nombre_del_enlace]
|
|
Eliminar enlace
|
unlink
|
|
Any single character
|
?
|
|
Any number of character
|
*
|
|
Character from a range
|
[ ]
|
|
Starting character
|
^
|
|
Ending Character
|
$
|
|
More than one pattern
|
{ }
|
|
Aplicar más condiciones
|
|
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.