linux-commands-guide 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- guia_linux/__init__.py +4 -0
- guia_linux/cli.py +89 -0
- guia_linux/tools/__init__.py +62 -0
- guia_linux/tools/awk.py +39 -0
- guia_linux/tools/cat.py +29 -0
- guia_linux/tools/chmod.py +28 -0
- guia_linux/tools/chown.py +22 -0
- guia_linux/tools/crontab.py +40 -0
- guia_linux/tools/curl.py +29 -0
- guia_linux/tools/cut.py +21 -0
- guia_linux/tools/df.py +30 -0
- guia_linux/tools/docker.py +39 -0
- guia_linux/tools/du.py +32 -0
- guia_linux/tools/file_descriptors.py +32 -0
- guia_linux/tools/find.py +38 -0
- guia_linux/tools/firewall_cmd.py +29 -0
- guia_linux/tools/free.py +26 -0
- guia_linux/tools/git.py +62 -0
- guia_linux/tools/grep.py +39 -0
- guia_linux/tools/head.py +23 -0
- guia_linux/tools/htop.py +25 -0
- guia_linux/tools/ifconfig.py +28 -0
- guia_linux/tools/ip.py +32 -0
- guia_linux/tools/iptables.py +30 -0
- guia_linux/tools/jq.py +32 -0
- guia_linux/tools/logs.py +48 -0
- guia_linux/tools/lsblk.py +29 -0
- guia_linux/tools/lsof.py +30 -0
- guia_linux/tools/lxc.py +24 -0
- guia_linux/tools/nc.py +27 -0
- guia_linux/tools/netstat.py +28 -0
- guia_linux/tools/nmap.py +33 -0
- guia_linux/tools/ps.py +30 -0
- guia_linux/tools/regex.py +38 -0
- guia_linux/tools/rsync.py +27 -0
- guia_linux/tools/scp.py +26 -0
- guia_linux/tools/sed.py +26 -0
- guia_linux/tools/shortcuts.py +32 -0
- guia_linux/tools/sort.py +24 -0
- guia_linux/tools/ss.py +32 -0
- guia_linux/tools/ssh.py +30 -0
- guia_linux/tools/system.py +54 -0
- guia_linux/tools/systemctl.py +34 -0
- guia_linux/tools/tail.py +25 -0
- guia_linux/tools/tar.py +27 -0
- guia_linux/tools/tee.py +20 -0
- guia_linux/tools/tmux.py +37 -0
- guia_linux/tools/top.py +34 -0
- guia_linux/tools/tr.py +23 -0
- guia_linux/tools/uname.py +24 -0
- guia_linux/tools/uniq.py +21 -0
- guia_linux/tools/vim.py +58 -0
- guia_linux/tools/watch.py +24 -0
- guia_linux/tools/xargs.py +23 -0
- guia_linux/utils.py +59 -0
- linux_commands_guide-2.0.0.dist-info/METADATA +147 -0
- linux_commands_guide-2.0.0.dist-info/RECORD +60 -0
- linux_commands_guide-2.0.0.dist-info/WHEEL +5 -0
- linux_commands_guide-2.0.0.dist-info/entry_points.txt +2 -0
- linux_commands_guide-2.0.0.dist-info/top_level.txt +1 -0
guia_linux/tools/tr.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Opciones de TR"
|
|
5
|
+
TITLE_EN = "TR Options"
|
|
6
|
+
BRIEF = "Traduce o elimina caracteres"
|
|
7
|
+
BRIEF_EN = "Translate or delete characters"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} 'a-z' 'A-Z' < filename", "description": "Convierte minúsculas a mayúsculas", "description_en": "Convert lowercase to uppercase"},
|
|
11
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} 'A-Z' 'a-z' < filename", "description": "Convierte mayúsculas a minúsculas", "description_en": "Convert uppercase to lowercase"},
|
|
12
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} -d '[:digit:]' < filename", "description": "Elimina todos los dígitos", "description_en": "Delete all digits"},
|
|
13
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} ' ' '_' < filename", "description": "Reemplaza espacios con guiones bajos", "description_en": "Replace spaces with underscores"},
|
|
14
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} -s ' ' < filename", "description": "Comprime secuencias de espacios en uno", "description_en": "Squeeze consecutive spaces into one"},
|
|
15
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} -c '[:alnum:]' '_' < filename", "description": "Reemplaza todo lo que no sea alfanumérico con '_'", "description_en": "Replace non-alphanumeric characters with '_'"},
|
|
16
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} -d '\\n' < filename", "description": "Elimina los saltos de línea", "description_en": "Remove newline characters"},
|
|
17
|
+
{"command": f"{Color.GREEN}tr{Color.RESET} -d '[:space:]' < filename", "description": "Elimina todos los espacios en blanco", "description_en": "Delete all whitespace characters"},
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def show(lang: str = "es") -> None:
|
|
22
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
23
|
+
print_table(title, COMMANDS, lang)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Opciones de UNAME"
|
|
5
|
+
TITLE_EN = "UNAME Options"
|
|
6
|
+
BRIEF = "Información del sistema y kernel"
|
|
7
|
+
BRIEF_EN = "System and kernel information"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"command": f"{Color.GREEN}uname{Color.RESET}", "description": "Muestra el nombre del kernel", "description_en": "Show the kernel name"},
|
|
11
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -a", "description": "Muestra toda la información del sistema", "description_en": "Show all system information"},
|
|
12
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -s", "description": "Muestra el nombre del kernel", "description_en": "Show the kernel name"},
|
|
13
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -n", "description": "Muestra el nombre de red del host", "description_en": "Show the network hostname"},
|
|
14
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -r", "description": "Muestra la versión del kernel", "description_en": "Show the kernel release"},
|
|
15
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -v", "description": "Muestra la fecha de compilación del kernel", "description_en": "Show the kernel build date"},
|
|
16
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -m", "description": "Muestra el tipo de hardware de la máquina", "description_en": "Show the machine hardware type"},
|
|
17
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -p", "description": "Muestra el tipo de procesador", "description_en": "Show the processor type"},
|
|
18
|
+
{"command": f"{Color.GREEN}uname{Color.RESET} -o", "description": "Muestra el sistema operativo", "description_en": "Show the operating system"},
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def show(lang: str = "es") -> None:
|
|
23
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
24
|
+
print_table(title, COMMANDS, lang)
|
guia_linux/tools/uniq.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Opciones de UNIQ"
|
|
5
|
+
TITLE_EN = "UNIQ Options"
|
|
6
|
+
BRIEF = "Filtra líneas duplicadas adyacentes"
|
|
7
|
+
BRIEF_EN = "Filter adjacent duplicate lines"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"command": f"{Color.GREEN}uniq{Color.RESET} filename", "description": "Elimina líneas duplicadas consecutivas", "description_en": "Remove consecutive duplicate lines"},
|
|
11
|
+
{"command": f"{Color.GREEN}uniq{Color.RESET} -c filename", "description": "Cuenta las ocurrencias de cada línea", "description_en": "Count occurrences of each line"},
|
|
12
|
+
{"command": f"{Color.GREEN}uniq{Color.RESET} -d filename", "description": "Muestra solo las líneas duplicadas", "description_en": "Show only duplicate lines"},
|
|
13
|
+
{"command": f"{Color.GREEN}uniq{Color.RESET} -u filename", "description": "Muestra solo las líneas únicas (no duplicadas)", "description_en": "Show only unique (non-duplicated) lines"},
|
|
14
|
+
{"command": f"{Color.GREEN}uniq{Color.RESET} -i filename", "description": "Ignora mayúsculas/minúsculas al comparar", "description_en": "Ignore case when comparing"},
|
|
15
|
+
{"command": f"{Color.GREEN}sort{Color.RESET} filename | {Color.GREEN}uniq{Color.RESET}", "description": "Patrón habitual: ordenar antes de aplicar uniq", "description_en": "Common pattern: sort first, then apply uniq"},
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def show(lang: str = "es") -> None:
|
|
20
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
21
|
+
print_table(title, COMMANDS, lang)
|
guia_linux/tools/vim.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Comandos de VIM"
|
|
5
|
+
TITLE_EN = "VIM Commands"
|
|
6
|
+
BRIEF = "Editor de texto modal en terminal"
|
|
7
|
+
BRIEF_EN = "Modal terminal text editor"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"section": "Archivos", "section_en": "Files"},
|
|
11
|
+
{"command": f"{Color.GREEN}:w{Color.RESET}", "description": "Guarda el archivo actual", "description_en": "Save the current file"},
|
|
12
|
+
{"command": f"{Color.GREEN}:q{Color.RESET}", "description": "Cierra si no hay cambios sin guardar", "description_en": "Close if no unsaved changes"},
|
|
13
|
+
{"command": f"{Color.GREEN}:q!{Color.RESET}", "description": "Fuerza la salida sin guardar", "description_en": "Force quit without saving"},
|
|
14
|
+
{"command": f"{Color.GREEN}:wq{Color.RESET}", "description": "Guarda y cierra el archivo", "description_en": "Save and quit"},
|
|
15
|
+
{"command": f"{Color.GREEN}:e filename{Color.RESET}", "description": "Abre un archivo para editar", "description_en": "Open a file for editing"},
|
|
16
|
+
{"command": f"{Color.GREEN}:w filename{Color.RESET}", "description": "Guarda con un nombre de archivo diferente", "description_en": "Save with a different filename"},
|
|
17
|
+
|
|
18
|
+
{"section": "Modos", "section_en": "Modes"},
|
|
19
|
+
{"command": f"{Color.GREEN}i{Color.RESET}", "description": "Entra en modo inserción en la posición actual", "description_en": "Enter insert mode at cursor position"},
|
|
20
|
+
{"command": f"{Color.GREEN}I{Color.RESET}", "description": "Entra en modo inserción al inicio de la línea", "description_en": "Enter insert mode at line start"},
|
|
21
|
+
{"command": f"{Color.GREEN}a{Color.RESET}", "description": "Entra en modo inserción después del cursor", "description_en": "Enter insert mode after cursor"},
|
|
22
|
+
{"command": f"{Color.GREEN}A{Color.RESET}", "description": "Entra en modo inserción al final de la línea", "description_en": "Enter insert mode at line end"},
|
|
23
|
+
{"command": f"{Color.GREEN}o{Color.RESET}", "description": "Abre una nueva línea debajo y entra en inserción", "description_en": "Open new line below and enter insert mode"},
|
|
24
|
+
{"command": f"{Color.GREEN}O{Color.RESET}", "description": "Abre una nueva línea arriba y entra en inserción", "description_en": "Open new line above and enter insert mode"},
|
|
25
|
+
{"command": f"{Color.GREEN}v{Color.RESET}", "description": "Entra en modo visual (selección)", "description_en": "Enter visual mode (selection)"},
|
|
26
|
+
{"command": f"{Color.GREEN}V{Color.RESET}", "description": "Entra en modo visual de línea completa", "description_en": "Enter visual line mode"},
|
|
27
|
+
{"command": f"{Color.GREEN}ESC{Color.RESET}", "description": "Regresa al modo normal", "description_en": "Return to normal mode"},
|
|
28
|
+
|
|
29
|
+
{"section": "Navegación", "section_en": "Navigation"},
|
|
30
|
+
{"command": f"{Color.GREEN}gg{Color.RESET}", "description": "Va al inicio del archivo", "description_en": "Go to beginning of file"},
|
|
31
|
+
{"command": f"{Color.GREEN}G{Color.RESET}", "description": "Va al final del archivo", "description_en": "Go to end of file"},
|
|
32
|
+
{"command": f"{Color.GREEN}:N{Color.RESET}", "description": "Va a la línea N", "description_en": "Go to line N"},
|
|
33
|
+
{"command": f"{Color.GREEN}0{Color.RESET}", "description": "Va al inicio de la línea", "description_en": "Go to start of line"},
|
|
34
|
+
{"command": f"{Color.GREEN}${Color.RESET}", "description": "Va al final de la línea", "description_en": "Go to end of line"},
|
|
35
|
+
{"command": f"{Color.GREEN}w{Color.RESET}", "description": "Salta al inicio de la siguiente palabra", "description_en": "Jump to start of next word"},
|
|
36
|
+
{"command": f"{Color.GREEN}b{Color.RESET}", "description": "Salta al inicio de la palabra anterior", "description_en": "Jump to start of previous word"},
|
|
37
|
+
|
|
38
|
+
{"section": "Edición", "section_en": "Editing"},
|
|
39
|
+
{"command": f"{Color.GREEN}dd{Color.RESET}", "description": "Elimina (corta) la línea actual", "description_en": "Delete (cut) current line"},
|
|
40
|
+
{"command": f"{Color.GREEN}yy{Color.RESET}", "description": "Copia la línea actual", "description_en": "Yank (copy) current line"},
|
|
41
|
+
{"command": f"{Color.GREEN}p{Color.RESET}", "description": "Pega después del cursor", "description_en": "Paste after cursor"},
|
|
42
|
+
{"command": f"{Color.GREEN}u{Color.RESET}", "description": "Deshace el último cambio", "description_en": "Undo last change"},
|
|
43
|
+
{"command": f"{Color.GREEN}CTRL+r{Color.RESET}", "description": "Rehace el último cambio deshecho", "description_en": "Redo last undone change"},
|
|
44
|
+
{"command": f"{Color.GREEN}x{Color.RESET}", "description": "Elimina el carácter bajo el cursor", "description_en": "Delete character under cursor"},
|
|
45
|
+
|
|
46
|
+
{"section": "Búsqueda y sustitución", "section_en": "Search and Replace"},
|
|
47
|
+
{"command": f"{Color.GREEN}/word{Color.RESET}", "description": "Busca 'word' hacia adelante", "description_en": "Search for 'word' forward"},
|
|
48
|
+
{"command": f"{Color.GREEN}?word{Color.RESET}", "description": "Busca 'word' hacia atrás", "description_en": "Search for 'word' backward"},
|
|
49
|
+
{"command": f"{Color.GREEN}n{Color.RESET}", "description": "Va a la siguiente coincidencia", "description_en": "Go to next match"},
|
|
50
|
+
{"command": f"{Color.GREEN}N{Color.RESET}", "description": "Va a la coincidencia anterior", "description_en": "Go to previous match"},
|
|
51
|
+
{"command": f"{Color.GREEN}:%s/old/new/g{Color.RESET}", "description": "Reemplaza 'old' por 'new' en todo el archivo", "description_en": "Replace 'old' with 'new' throughout the file"},
|
|
52
|
+
{"command": f"{Color.GREEN}:%s/old/new/gc{Color.RESET}", "description": "Reemplaza con confirmación", "description_en": "Replace with confirmation"},
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def show(lang: str = "es") -> None:
|
|
57
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
58
|
+
print_table(title, COMMANDS, lang)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Opciones de WATCH"
|
|
5
|
+
TITLE_EN = "WATCH Options"
|
|
6
|
+
BRIEF = "Ejecuta un comando periódicamente"
|
|
7
|
+
BRIEF_EN = "Execute a command periodically"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} command", "description": "Ejecuta el comando cada 2 segundos (por defecto)", "description_en": "Execute command every 2 seconds (default)"},
|
|
11
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -n N command", "description": "Ejecuta el comando cada N segundos", "description_en": "Execute command every N seconds"},
|
|
12
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -d command", "description": "Resalta los cambios entre actualizaciones", "description_en": "Highlight changes between updates"},
|
|
13
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -t command", "description": "Oculta el encabezado de watch", "description_en": "Hide the watch header"},
|
|
14
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -p command", "description": "Intenta ejecutar el comando con precisión periódica", "description_en": "Attempt precise period execution"},
|
|
15
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -e command", "description": "Sale si el comando devuelve un error", "description_en": "Exit if command returns an error"},
|
|
16
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -g command", "description": "Sale cuando la salida del comando cambia", "description_en": "Exit when the command output changes"},
|
|
17
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -n 1 df -h", "description": "Ejemplo: monitoriza el disco cada segundo", "description_en": "Example: monitor disk usage every second"},
|
|
18
|
+
{"command": f"{Color.GREEN}watch{Color.RESET} -n 2 'ps aux | grep nginx'", "description": "Ejemplo: monitoriza el proceso nginx", "description_en": "Example: monitor the nginx process"},
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def show(lang: str = "es") -> None:
|
|
23
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
24
|
+
print_table(title, COMMANDS, lang)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from shellcolorize import Color
|
|
2
|
+
from guia_linux.utils import print_table
|
|
3
|
+
|
|
4
|
+
TITLE = "Opciones de XARGS"
|
|
5
|
+
TITLE_EN = "XARGS Options"
|
|
6
|
+
BRIEF = "Construye y ejecuta comandos desde stdin"
|
|
7
|
+
BRIEF_EN = "Build and execute commands from stdin"
|
|
8
|
+
|
|
9
|
+
COMMANDS = [
|
|
10
|
+
{"command": f"{Color.GREEN}find{Color.RESET} /path -name '*.log' | {Color.GREEN}xargs{Color.RESET} rm", "description": "Elimina todos los archivos .log encontrados", "description_en": "Delete all found .log files"},
|
|
11
|
+
{"command": f"{Color.GREEN}cat{Color.RESET} list.txt | {Color.GREEN}xargs{Color.RESET} mkdir", "description": "Crea directorios a partir de una lista", "description_en": "Create directories from a list"},
|
|
12
|
+
{"command": f"{Color.GREEN}echo{Color.RESET} 'a b c' | {Color.GREEN}xargs{Color.RESET} -n 1 echo", "description": "Procesa un argumento por vez", "description_en": "Process one argument at a time"},
|
|
13
|
+
{"command": f"{Color.GREEN}find{Color.RESET} /path -print0 | {Color.GREEN}xargs{Color.RESET} -0 ls", "description": "Maneja nombres con espacios usando NUL como separador", "description_en": "Handle filenames with spaces using NUL separator"},
|
|
14
|
+
{"command": f"{Color.GREEN}echo{Color.RESET} 'f1 f2 f3' | {Color.GREEN}xargs{Color.RESET} -I{{}} cp {{}} /dest/", "description": "Sustituye {} por cada argumento", "description_en": "Replace {} with each argument"},
|
|
15
|
+
{"command": f"{Color.GREEN}find{Color.RESET} /path -name '*.py' | {Color.GREEN}xargs{Color.RESET} -P 4 python3", "description": "Ejecuta hasta 4 procesos en paralelo", "description_en": "Run up to 4 processes in parallel"},
|
|
16
|
+
{"command": f"{Color.GREEN}cat{Color.RESET} urls.txt | {Color.GREEN}xargs{Color.RESET} -n 1 curl -O", "description": "Descarga URLs de una en una", "description_en": "Download URLs one at a time"},
|
|
17
|
+
{"command": f"{Color.GREEN}find{Color.RESET} . -name '*.txt' | {Color.GREEN}xargs{Color.RESET} grep 'word'", "description": "Busca 'word' en todos los .txt encontrados", "description_en": "Search for 'word' in all found .txt files"},
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def show(lang: str = "es") -> None:
|
|
22
|
+
title = TITLE_EN if lang == "en" else TITLE
|
|
23
|
+
print_table(title, COMMANDS, lang)
|
guia_linux/utils.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from shellcolorize import Color
|
|
3
|
+
|
|
4
|
+
_ANSI_RE = re.compile(r'\033\[[0-9;]*m')
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def strip_ansi(text: str) -> str:
|
|
8
|
+
return _ANSI_RE.sub('', text)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def ansi_ljust(text: str, width: int) -> str:
|
|
12
|
+
visible = len(strip_ansi(text))
|
|
13
|
+
return text + ' ' * max(0, width - visible)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def print_table(title: str, commands: list, lang: str = "es") -> None:
|
|
17
|
+
desc_key = "description_en" if lang == "en" else "description"
|
|
18
|
+
cmd_label = "Command" if lang == "en" else "Comando"
|
|
19
|
+
desc_label = "Description" if lang == "en" else "Descripción"
|
|
20
|
+
sep = "-" * 132
|
|
21
|
+
|
|
22
|
+
print(f"\n{Color.CYAN}{Color.BOLD}{title}{Color.RESET}:\n")
|
|
23
|
+
print(f"{cmd_label:<50} | {desc_label}")
|
|
24
|
+
print(sep)
|
|
25
|
+
|
|
26
|
+
for entry in commands:
|
|
27
|
+
# Section / category headers
|
|
28
|
+
if "section" in entry or "category" in entry:
|
|
29
|
+
key = "section" if "section" in entry else "category"
|
|
30
|
+
text = entry.get(f"{key}_en" if lang == "en" else key, entry.get(key, ""))
|
|
31
|
+
if text:
|
|
32
|
+
print(f"\n{Color.CYAN}{strip_ansi(str(text))}{Color.RESET}")
|
|
33
|
+
print(sep)
|
|
34
|
+
continue
|
|
35
|
+
|
|
36
|
+
display = entry.get("command") or entry.get("logfile") or entry.get("pattern") or ""
|
|
37
|
+
desc = entry.get(desc_key, "")
|
|
38
|
+
|
|
39
|
+
if display or desc:
|
|
40
|
+
print(f"{ansi_ljust(str(display), 59)} | {Color.RED}{desc}{Color.RESET}")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def search_all(query: str, tools: dict, lang: str = "es") -> list:
|
|
44
|
+
desc_key = "description_en" if lang == "en" else "description"
|
|
45
|
+
results = []
|
|
46
|
+
q = query.lower()
|
|
47
|
+
for tool_name, module in tools.items():
|
|
48
|
+
for entry in getattr(module, 'COMMANDS', []):
|
|
49
|
+
if "section" in entry or "category" in entry:
|
|
50
|
+
continue
|
|
51
|
+
display = strip_ansi(str(
|
|
52
|
+
entry.get("command") or
|
|
53
|
+
entry.get("logfile") or
|
|
54
|
+
entry.get("pattern") or ""
|
|
55
|
+
))
|
|
56
|
+
desc = entry.get(desc_key, "")
|
|
57
|
+
if q in display.lower() or q in desc.lower():
|
|
58
|
+
results.append((tool_name, entry))
|
|
59
|
+
return results
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: linux-commands-guide
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Bilingual ES/EN interactive Linux command reference — 50+ tools with keyword search
|
|
5
|
+
Author-email: Serber1990 <serber1990@pm.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/serber1990/linux-commands-guide
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/serber1990/linux-commands-guide/issues
|
|
9
|
+
Project-URL: Source Code, https://github.com/serber1990/linux-commands-guide
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Topic :: System :: Systems Administration
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: shellcolorize
|
|
17
|
+
|
|
18
|
+
# Guia-Comandos-Linux
|
|
19
|
+
|
|
20
|
+
[](https://opensource.org/licenses/MIT)
|
|
21
|
+
[](https://github.com/serber1990/linux-commands-guide/stargazers)
|
|
22
|
+
|
|
23
|
+
**Bilingual ES/EN interactive Linux command reference for the terminal.** 50+ tools covered, keyword search across all of them, pip-installable with a single `lh` command.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ✨ Features
|
|
28
|
+
|
|
29
|
+
- 🌐 **Bilingual** — full Spanish and English descriptions via `--lang en` / `--lang es`
|
|
30
|
+
- 🔍 **Cross-tool search** — `lh -s recursive` finds every command mentioning "recursive" across all tools
|
|
31
|
+
- 📦 **50+ tools** — awk, grep, find, git, docker, ssh, tmux, jq, ss, rsync, tar, crontab and many more
|
|
32
|
+
- 🚀 **pip-installable** — one command, available anywhere in your shell as `lh`
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📥 Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install guia-linux
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or clone and install in development mode:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git clone https://github.com/serber1990/linux-commands-guide.git
|
|
46
|
+
cd Guia-Comandos-Linux
|
|
47
|
+
pip install -e .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 🛠 Usage
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
lh <tool> # Show commands for a tool (Spanish by default)
|
|
56
|
+
lh --lang en <tool> # Force English output
|
|
57
|
+
lh -s <keyword> # Search across all tools
|
|
58
|
+
lh -s <keyword> --lang en # Search in English
|
|
59
|
+
lh --help # Show help and full tool list
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Examples
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
lh grep # All grep options in Spanish
|
|
66
|
+
lh --lang en grep # All grep options in English
|
|
67
|
+
lh -s recursive # Find every command mentioning "recursive"
|
|
68
|
+
lh -s port --lang en # Find port-related commands (English descriptions)
|
|
69
|
+
lh ssh
|
|
70
|
+
lh docker
|
|
71
|
+
lh tmux
|
|
72
|
+
lh jq
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🔧 Available Tools
|
|
78
|
+
|
|
79
|
+
| Tool | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| `awk` | Column-based text processing |
|
|
82
|
+
| `cat` | Display and concatenate file contents |
|
|
83
|
+
| `chmod` | Change file permissions |
|
|
84
|
+
| `chown` | Change file owner and group |
|
|
85
|
+
| `crontab` | Periodic task scheduling |
|
|
86
|
+
| `curl` | Transfer data with URLs |
|
|
87
|
+
| `cut` | Extract sections from each line |
|
|
88
|
+
| `df` | Display disk space usage |
|
|
89
|
+
| `docker` | Docker container management |
|
|
90
|
+
| `du` | Display directory space usage |
|
|
91
|
+
| `descriptors` | File descriptors and redirections |
|
|
92
|
+
| `find` | Search for files and directories |
|
|
93
|
+
| `firewall-cmd` | Manage the firewalld firewall |
|
|
94
|
+
| `free` | Display system memory usage |
|
|
95
|
+
| `git` | Version control with Git |
|
|
96
|
+
| `grep` | Search for patterns in files |
|
|
97
|
+
| `head` | Display the beginning of a file |
|
|
98
|
+
| `htop` | Interactive process monitor |
|
|
99
|
+
| `ifconfig` | Network interface configuration (legacy) |
|
|
100
|
+
| `ip` | Modern network interface and routing management |
|
|
101
|
+
| `iptables` | Kernel firewall rule management |
|
|
102
|
+
| `jq` | Command-line JSON processor |
|
|
103
|
+
| `logs` | Important log file paths in Linux |
|
|
104
|
+
| `lsblk` | List block devices |
|
|
105
|
+
| `lsof` | List open files by processes |
|
|
106
|
+
| `lxc` | LXC container management |
|
|
107
|
+
| `nc` | TCP/IP Swiss army knife |
|
|
108
|
+
| `netstat` | Network connection statistics |
|
|
109
|
+
| `nmap` | Network and port scanner |
|
|
110
|
+
| `ps` | Information about running processes |
|
|
111
|
+
| `regex` | Regular expression patterns |
|
|
112
|
+
| `rsync` | Efficient file synchronization |
|
|
113
|
+
| `scp` | Secure file copy over SSH |
|
|
114
|
+
| `sed` | Stream text editor |
|
|
115
|
+
| `shortcuts` | Terminal keyboard shortcuts |
|
|
116
|
+
| `sort` | Sort lines of text |
|
|
117
|
+
| `ss` | Socket statistics (replaces netstat) |
|
|
118
|
+
| `ssh` | Secure Shell client |
|
|
119
|
+
| `system` | Basic system commands |
|
|
120
|
+
| `systemctl` | Manage services with systemd |
|
|
121
|
+
| `tail` | Display the end of a file |
|
|
122
|
+
| `tar` | File archiving and compression |
|
|
123
|
+
| `tee` | Read stdin and write to stdout and files |
|
|
124
|
+
| `tmux` | Terminal multiplexer |
|
|
125
|
+
| `top` | Real-time process monitor |
|
|
126
|
+
| `tr` | Translate or delete characters |
|
|
127
|
+
| `uname` | System and kernel information |
|
|
128
|
+
| `uniq` | Filter adjacent duplicate lines |
|
|
129
|
+
| `vim` | Modal terminal text editor |
|
|
130
|
+
| `watch` | Execute a command periodically |
|
|
131
|
+
| `xargs` | Build and execute commands from stdin |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 📝 License
|
|
136
|
+
|
|
137
|
+
MIT — see [LICENSE](LICENSE).
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 💬 Feedback
|
|
142
|
+
|
|
143
|
+
Open an issue or reach out via GitHub.
|
|
144
|
+
|
|
145
|
+
## 🌐 Connect
|
|
146
|
+
|
|
147
|
+
[](https://github.com/serber1990)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
guia_linux/__init__.py,sha256=rkR8LVoOHC7hrBNw-zb8zJT2pez0PwBZnyd_CyIWGEo,74
|
|
2
|
+
guia_linux/cli.py,sha256=51UHRje8wvkIIe8aqGnd3zVbgFvK7QLAXx0BOdzQj0A,3729
|
|
3
|
+
guia_linux/utils.py,sha256=FP_09LZ-d3sc7lQIH2VzHaTIOP3GX3gS630lxApFFPs,2064
|
|
4
|
+
guia_linux/tools/__init__.py,sha256=uyr72jLMgFVl_x0cTUcaPuxjZ2LsKdkjz4Oj_aM5ATI,1708
|
|
5
|
+
guia_linux/tools/awk.py,sha256=8KRJOlO9QLUXAATte44kvoNi_cVW9-djiW_OWNjznGs,5006
|
|
6
|
+
guia_linux/tools/cat.py,sha256=UjzSKMA15IaydaQxZjxhsOj5DXLx29kxkxItoagAuTM,2822
|
|
7
|
+
guia_linux/tools/chmod.py,sha256=1eMCx9l3YO-FrMa3Vs-KoIQ9mcSIBXdvB6mct7WLzJ8,2652
|
|
8
|
+
guia_linux/tools/chown.py,sha256=pJrwm9CnDIzIVFxKvVWxs_I3_n9ikAg4z6nDLrjsNYI,1607
|
|
9
|
+
guia_linux/tools/crontab.py,sha256=dMlCeyMEXfVyFN6FRfWyHgx_U4jPeIlRSVPW9KZ_MvE,4013
|
|
10
|
+
guia_linux/tools/curl.py,sha256=azeTgPDHe3ERJPT_1RGqwF1tJJV9WfdexY5cpo3eWlY,2904
|
|
11
|
+
guia_linux/tools/cut.py,sha256=Zw3EMzXCBpGOPmnvjjP3NydIg1xcsX8pmzM_49s5kCQ,1547
|
|
12
|
+
guia_linux/tools/df.py,sha256=4N4uXUxk-waZ8Ad-PdVgZmyvMwiXmMHZcUyQWqlAgnM,2855
|
|
13
|
+
guia_linux/tools/docker.py,sha256=FBZpphsMqx01rDiiAWvLshI5e87UviY6auvDLzsbMCA,4580
|
|
14
|
+
guia_linux/tools/du.py,sha256=aexuC9rld40XovQsn6KUnHLpVI8iZZsTOctdC71rSw8,3138
|
|
15
|
+
guia_linux/tools/file_descriptors.py,sha256=5p1LnGtrKJlwhJDhD5802nGRqosL2gvjzm7E1qJtUmc,3266
|
|
16
|
+
guia_linux/tools/find.py,sha256=W9JsqUVbTPNB2sVOjzATciHmReQVtEUzOxjKuhTPOqk,4470
|
|
17
|
+
guia_linux/tools/firewall_cmd.py,sha256=8_90V0MDq06JCdlZVKWR5M0-dJ6GnkiREd0EiIIc4Vg,3058
|
|
18
|
+
guia_linux/tools/free.py,sha256=fHIQuuoF39zHSEC-WVZGxXRyijeTvHs7B2q_rbOpV1M,2172
|
|
19
|
+
guia_linux/tools/git.py,sha256=klijeqHXyxLicySJ8pk1aUsc6OA3AH6McGmnodXR6po,6359
|
|
20
|
+
guia_linux/tools/grep.py,sha256=SlqOqtQVoWZijf6KapTgAxic9TUv4E8xli6cxb2sqzU,4906
|
|
21
|
+
guia_linux/tools/head.py,sha256=fv966JiYza8DkFpQObrfQNf7sNF0r43t1U8750bBXVY,1679
|
|
22
|
+
guia_linux/tools/htop.py,sha256=Pz9FEVN0HtqdXLapYHudxVXdgYeWBv56Ivfm-ys4LoQ,2035
|
|
23
|
+
guia_linux/tools/ifconfig.py,sha256=TxDX_8CHykTElySIsQcCobceKKfHfLmi5l_IZLsOByE,2630
|
|
24
|
+
guia_linux/tools/ip.py,sha256=OvGWtglIrTsBlqVRegmQYDyLrMpXSuppIMlUOkbNVvo,3267
|
|
25
|
+
guia_linux/tools/iptables.py,sha256=aCzyiZJN__Swyqzz3jZ5HRzmtQEz-GpAnI7K-6pYfpQ,3323
|
|
26
|
+
guia_linux/tools/jq.py,sha256=n3_XBrXlReAzj4JPQDSmAZpP_BFF2kQdo32U8FMrutA,3406
|
|
27
|
+
guia_linux/tools/logs.py,sha256=r9Ihivg5_VnU2wlgEhGP9MIOTFlox5zCMXnh9r2Hg1Q,4696
|
|
28
|
+
guia_linux/tools/lsblk.py,sha256=6p7kR3SojTosoHJTgNMB7YSMmjV_bv2AemZOUg5Et5c,2595
|
|
29
|
+
guia_linux/tools/lsof.py,sha256=FkGQkdtB7ruDdUpEf_zuR93IrVX2EskTZfLxJURq7xc,2869
|
|
30
|
+
guia_linux/tools/lxc.py,sha256=euL0dlkoJqFQHvNClzDdrUJiGvJZAAgV1eZoseXuW_U,1990
|
|
31
|
+
guia_linux/tools/nc.py,sha256=1RxxdO57qY-xe4LkeEBndtJGF-FbFryvBhy-zqOQ3-I,2357
|
|
32
|
+
guia_linux/tools/netstat.py,sha256=Mw1GETC3APEJwJs6QyjqwlgO2M4WneX1G0jtKGocRn4,2576
|
|
33
|
+
guia_linux/tools/nmap.py,sha256=DKBv2LIr0Kjrmjd4sBB1HnDMLcecIvn1xJ06NKnsemU,3311
|
|
34
|
+
guia_linux/tools/ps.py,sha256=RrmX7nhuIfk0YTqLWI5Ra_DzX_NisfNmaM5THGlJDJ4,2838
|
|
35
|
+
guia_linux/tools/regex.py,sha256=17tlz_GEMLoKaNfacWWaH-eicYWy7EmfYFxHA77by_8,4022
|
|
36
|
+
guia_linux/tools/rsync.py,sha256=8eJFrV22tFVVJzfKxRKCCoAdAqCbmP2O7WUE5Gvewi8,2736
|
|
37
|
+
guia_linux/tools/scp.py,sha256=f2IBtVi0g1woFBmGyR7i-mQSGnBpCNSW-D8EH_ZG-pg,2402
|
|
38
|
+
guia_linux/tools/sed.py,sha256=sKslEZsITrFpCfMjfP3Z_lMURRmVbzIu8aCjJawyZag,2371
|
|
39
|
+
guia_linux/tools/shortcuts.py,sha256=XYzinJJesjsqUj7dQ9i7DZBk6Rf1OGNg0fS3QHs8LBs,3220
|
|
40
|
+
guia_linux/tools/sort.py,sha256=wHRwX0EcvgodbW4Nw-L7M_349B2JjmKlrcsAX_-5HZY,1892
|
|
41
|
+
guia_linux/tools/ss.py,sha256=m5n_CYOo6mHp4UGErR_QZPFBqiUHXeiaYCmGqiftbio,3160
|
|
42
|
+
guia_linux/tools/ssh.py,sha256=z0j70AvojRCne6Ig0FasW4v-S4jKV7iDJepAFWwQuuI,3246
|
|
43
|
+
guia_linux/tools/system.py,sha256=Bsu7cOBEJMrmE3PKcAX3EG7CGf4EP5kigBfPCIwdhfU,5829
|
|
44
|
+
guia_linux/tools/systemctl.py,sha256=4t3Iw3pGPmSTS4Te4ik0gRE734pKx5mwykrqWtP1cKc,3798
|
|
45
|
+
guia_linux/tools/tail.py,sha256=Z3exP2Ze2DQHTC4dWWeVwngMrk_x4mYc2pZIDBcOsHE,2102
|
|
46
|
+
guia_linux/tools/tar.py,sha256=WyoV8AJaFE8MtmT1Zc6_mtsjsnVs7LUXSymqcBhcbC0,2646
|
|
47
|
+
guia_linux/tools/tee.py,sha256=qB1Wn0T740tCgV1v-YMRrSKZ6vnLZsVS1GJKHC900zQ,1515
|
|
48
|
+
guia_linux/tools/tmux.py,sha256=5HD_JvGzfPUWU7hJlaZ9Or8FirhYChTi2lRz0DpTfpM,3423
|
|
49
|
+
guia_linux/tools/top.py,sha256=nm83R17wKYO3QJm7LxdrdnAmDyry8VB2ByBlF464JHE,3142
|
|
50
|
+
guia_linux/tools/tr.py,sha256=0JNYNdnM6jD_EpMjo2ThZWZYYSNoH9ea6lVE2aswisg,1788
|
|
51
|
+
guia_linux/tools/uname.py,sha256=vDnSLHEau773Av2iWSs-IyZXk-ga5v4lbmH4bnG2zJw,1747
|
|
52
|
+
guia_linux/tools/uniq.py,sha256=WdQ6a9kTeWZrz5RtWCMBXnN0laKQnLhUcBOTzD3GadQ,1462
|
|
53
|
+
guia_linux/tools/vim.py,sha256=E4Yd7So9FWLZB_rrDgD7hWmy7ds4eqMzGd_R28KoL1I,5737
|
|
54
|
+
guia_linux/tools/watch.py,sha256=U6hrkl1DEzGAz5607kpU_C5BOWjRvsXNzsqy2pXExkY,1977
|
|
55
|
+
guia_linux/tools/xargs.py,sha256=EUQYgIpMWrMTlRjgLbbyB90iz7C_6X73A_gi47B2Qv0,2140
|
|
56
|
+
linux_commands_guide-2.0.0.dist-info/METADATA,sha256=SLB7txh2P-876-Sp_eLoquVSbE_scT21rdN4_CVoyxE,5000
|
|
57
|
+
linux_commands_guide-2.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
58
|
+
linux_commands_guide-2.0.0.dist-info/entry_points.txt,sha256=WUqhhdx8iSJLRPfoVngRcZKHAHph_3Mln4wkhSLxJB0,43
|
|
59
|
+
linux_commands_guide-2.0.0.dist-info/top_level.txt,sha256=9iiJuAch1o-2BxwChWyUkwsg5tc0WRsn9ORob1Wr-pg,11
|
|
60
|
+
linux_commands_guide-2.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
guia_linux
|