-
Notifications
You must be signed in to change notification settings - Fork 0
/
Terminal_Linux.txt
169 lines (113 loc) · 3.32 KB
/
Terminal_Linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Comandos de Linux
Para ver los archivos y directorios:
ls
Para ver la informacion de los archivo y directorios:
ls -l
Para mostrar archivos que cumplan la condicion de formato:
ls -lh *.<condicion formato>
find <ruta de la carpeta> -name *.<condicion formato>
Para limpiar la terminal:
clear
ctrl + l
Para cambiar de directorio:
cd <ruta del directorio>
Para ir al directorio anterior:
cd ../
Para crear un archivo:
touch <archivo.formato>
Para ejecutar archivos:
./<archivo.formato>
Para ubicarse en la carpeta home:
cd ~
Muestra la ruta del directorio actual:
pwd
Crea un nuevo directorio:
mkdir <nombre del directorio>
Muestra el contenido de un archivo:
cat <archivo>
Elimina archivos:
rm <nombre del archivo>
Elimina directorios vacios:
rmdir <nombre del directorio>
Elimina directorios:
rm -rf <nombre del directorio>
Copia archivos o directorios:
cp <nombre del archivo> <ruta para alojarlo>
Mueve o renombra archivos o directorios:
mv <archivo.txt> </ruta/destino>
Muestra los procesos en ejecución y su uso de recursos en tiempo real:
top
Muestra el manual de otros comandos:
man <comando>
Busca palabras en archivos:
grep <archivo> -e "palabra"
Busca palabras en archivos sin importar las mayusculas o minusculas:
grep -i <archivo> -e "palabra"
Muestra el tiempo:
date
Busca palabras en una carpeta:
grep -i -r <carpeta> -e "palabra"
Muestra el tiempo de inicio y final del comando:
date; <comando>; date
Buscar una palabra y ubicacion:
grep -n <archivo> -e "palabra"
Busca archivos y directorios en el sistema de archivos:
find /ruta -name <nombre del archivo>
Cambia los permisos de archivos y directorios:
chmod +x <archivo.sh>
Cambia el propietario y el grupo de archivos y directorios:
chown usuario:grupo <archivo>
Muestra las primeras líneas de un archivo:
head <archivo>
Muestra las últimas líneas de un archivo:
tail <archivo>
Cuenta líneas, palabras y caracteres en un archivo:
wc <archivo>
Muestra el uso de espacio en disco de archivos y directorios:
du -sh <directorio>
Muestra los procesos en ejecución:
ps aux
Envía señales a procesos para terminarlos:
kill PID
Para ver el historial:
history
Para saber donde esta un comando:
which <comando>
Para editar archivos:
nano <nombre del archivo>
Crear alias:
alias <nombre de la variable>=<comando a ejecutar>
Para comprimir archivos:
zip <nombre al directorio> *<.formato> *<.formato>
Para ver los archivos comprimidos o descomprimirlo:
unzip -vl <nombre del directorio .zip>
Para usar el resultado de un comando en otro:
<comando> | <otro comando>
Para otorgar o cambiar permisos a los archivos:
chmod <ternas> <archivo>
Para hacer cualquier comando sin importar los permisos:
sudo <comando>
Para cambiar el idioma del SO:
locale
sudo dpkg-reconfigure locales
Elegir el idioma presionando la tecla espaciadora
Darle a Enter
Elegir el idioma agregado
Para mostrar todos los archivos con su informacion:
ls -lha
Para abrir la GUI de kali linux:
sudo kali-win-kex
Para reinir la terminal:
sudo reboot
Para actualizar paquetes:
sudo apt update
Para cambiar de usuario:
su - <nombre de usuario>
Para instalar un paquete:
sudo apt install -y <paquete>
Para reproducir archivo de sonido:
aplay <archivo>
Para ver la variables de entorno:
printenv
Para ver los directorios y archivos como un arbol:
tree