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.
Files changed (60) hide show
  1. guia_linux/__init__.py +4 -0
  2. guia_linux/cli.py +89 -0
  3. guia_linux/tools/__init__.py +62 -0
  4. guia_linux/tools/awk.py +39 -0
  5. guia_linux/tools/cat.py +29 -0
  6. guia_linux/tools/chmod.py +28 -0
  7. guia_linux/tools/chown.py +22 -0
  8. guia_linux/tools/crontab.py +40 -0
  9. guia_linux/tools/curl.py +29 -0
  10. guia_linux/tools/cut.py +21 -0
  11. guia_linux/tools/df.py +30 -0
  12. guia_linux/tools/docker.py +39 -0
  13. guia_linux/tools/du.py +32 -0
  14. guia_linux/tools/file_descriptors.py +32 -0
  15. guia_linux/tools/find.py +38 -0
  16. guia_linux/tools/firewall_cmd.py +29 -0
  17. guia_linux/tools/free.py +26 -0
  18. guia_linux/tools/git.py +62 -0
  19. guia_linux/tools/grep.py +39 -0
  20. guia_linux/tools/head.py +23 -0
  21. guia_linux/tools/htop.py +25 -0
  22. guia_linux/tools/ifconfig.py +28 -0
  23. guia_linux/tools/ip.py +32 -0
  24. guia_linux/tools/iptables.py +30 -0
  25. guia_linux/tools/jq.py +32 -0
  26. guia_linux/tools/logs.py +48 -0
  27. guia_linux/tools/lsblk.py +29 -0
  28. guia_linux/tools/lsof.py +30 -0
  29. guia_linux/tools/lxc.py +24 -0
  30. guia_linux/tools/nc.py +27 -0
  31. guia_linux/tools/netstat.py +28 -0
  32. guia_linux/tools/nmap.py +33 -0
  33. guia_linux/tools/ps.py +30 -0
  34. guia_linux/tools/regex.py +38 -0
  35. guia_linux/tools/rsync.py +27 -0
  36. guia_linux/tools/scp.py +26 -0
  37. guia_linux/tools/sed.py +26 -0
  38. guia_linux/tools/shortcuts.py +32 -0
  39. guia_linux/tools/sort.py +24 -0
  40. guia_linux/tools/ss.py +32 -0
  41. guia_linux/tools/ssh.py +30 -0
  42. guia_linux/tools/system.py +54 -0
  43. guia_linux/tools/systemctl.py +34 -0
  44. guia_linux/tools/tail.py +25 -0
  45. guia_linux/tools/tar.py +27 -0
  46. guia_linux/tools/tee.py +20 -0
  47. guia_linux/tools/tmux.py +37 -0
  48. guia_linux/tools/top.py +34 -0
  49. guia_linux/tools/tr.py +23 -0
  50. guia_linux/tools/uname.py +24 -0
  51. guia_linux/tools/uniq.py +21 -0
  52. guia_linux/tools/vim.py +58 -0
  53. guia_linux/tools/watch.py +24 -0
  54. guia_linux/tools/xargs.py +23 -0
  55. guia_linux/utils.py +59 -0
  56. linux_commands_guide-2.0.0.dist-info/METADATA +147 -0
  57. linux_commands_guide-2.0.0.dist-info/RECORD +60 -0
  58. linux_commands_guide-2.0.0.dist-info/WHEEL +5 -0
  59. linux_commands_guide-2.0.0.dist-info/entry_points.txt +2 -0
  60. linux_commands_guide-2.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,29 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de FIREWALL-CMD"
5
+ TITLE_EN = "FIREWALL-CMD Options"
6
+ BRIEF = "Gestión del firewall firewalld"
7
+ BRIEF_EN = "Manage the firewalld firewall"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --state", "description": "Muestra el estado del firewall", "description_en": "Show firewall state"},
11
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --get-default-zone", "description": "Muestra la zona por defecto", "description_en": "Show the default zone"},
12
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --list-all", "description": "Lista todas las reglas de la zona por defecto", "description_en": "List all rules in the default zone"},
13
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --list-all-zones", "description": "Lista todas las zonas y sus configuraciones", "description_en": "List all zones and their settings"},
14
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --zone=zone --add-port=80/tcp --permanent", "description": "Abre el puerto 80 TCP de forma permanente", "description_en": "Permanently open TCP port 80"},
15
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --zone=zone --remove-port=80/tcp --permanent", "description": "Cierra el puerto 80 TCP de forma permanente", "description_en": "Permanently close TCP port 80"},
16
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --zone=zone --add-service=http --permanent", "description": "Permite el servicio HTTP de forma permanente", "description_en": "Permanently allow the HTTP service"},
17
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --zone=zone --remove-service=http --permanent", "description": "Bloquea el servicio HTTP de forma permanente", "description_en": "Permanently block the HTTP service"},
18
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --reload", "description": "Recarga la configuración del firewall", "description_en": "Reload firewall configuration"},
19
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --runtime-to-permanent", "description": "Guarda los cambios en tiempo real como permanentes", "description_en": "Save runtime changes as permanent"},
20
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --zone=zone --add-interface=eth0", "description": "Asocia eth0 a una zona", "description_en": "Bind eth0 to a zone"},
21
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --get-zones", "description": "Lista todas las zonas disponibles", "description_en": "List all available zones"},
22
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --new-zone=custom --permanent", "description": "Crea una nueva zona personalizada", "description_en": "Create a new custom zone"},
23
+ {"command": f"{Color.GREEN}firewall-cmd{Color.RESET} --delete-zone=custom --permanent", "description": "Elimina una zona personalizada", "description_en": "Delete a custom zone"},
24
+ ]
25
+
26
+
27
+ def show(lang: str = "es") -> None:
28
+ title = TITLE_EN if lang == "en" else TITLE
29
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,26 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de FREE"
5
+ TITLE_EN = "FREE Options"
6
+ BRIEF = "Muestra el uso de memoria del sistema"
7
+ BRIEF_EN = "Display system memory usage"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}free{Color.RESET}", "description": "Muestra el uso de memoria y swap", "description_en": "Show memory and swap usage"},
11
+ {"command": f"{Color.GREEN}free{Color.RESET} -b", "description": "Muestra el uso de memoria en bytes", "description_en": "Show memory in bytes"},
12
+ {"command": f"{Color.GREEN}free{Color.RESET} -k", "description": "Muestra el uso de memoria en kilobytes", "description_en": "Show memory in kilobytes"},
13
+ {"command": f"{Color.GREEN}free{Color.RESET} -m", "description": "Muestra el uso de memoria en megabytes", "description_en": "Show memory in megabytes"},
14
+ {"command": f"{Color.GREEN}free{Color.RESET} -g", "description": "Muestra el uso de memoria en gigabytes", "description_en": "Show memory in gigabytes"},
15
+ {"command": f"{Color.GREEN}free{Color.RESET} -h", "description": "Formato legible por humanos", "description_en": "Human-readable format"},
16
+ {"command": f"{Color.GREEN}free{Color.RESET} --si", "description": "Usa potencias de 1000 en lugar de 1024", "description_en": "Use powers of 1000 instead of 1024"},
17
+ {"command": f"{Color.GREEN}free{Color.RESET} -t", "description": "Muestra una línea con el total (memoria + swap)", "description_en": "Show a total line (memory + swap)"},
18
+ {"command": f"{Color.GREEN}free{Color.RESET} -s N", "description": "Actualiza la salida cada N segundos", "description_en": "Refresh output every N seconds"},
19
+ {"command": f"{Color.GREEN}free{Color.RESET} -c N", "description": "Especifica el número de actualizaciones antes de salir", "description_en": "Number of updates before exiting (use with -s)"},
20
+ {"command": f"{Color.GREEN}free{Color.RESET} -w", "description": "Muestra columnas de buffers y caché por separado", "description_en": "Show buffers and cache in separate columns"},
21
+ ]
22
+
23
+
24
+ def show(lang: str = "es") -> None:
25
+ title = TITLE_EN if lang == "en" else TITLE
26
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,62 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de GIT"
5
+ TITLE_EN = "GIT Options"
6
+ BRIEF = "Control de versiones con Git"
7
+ BRIEF_EN = "Version control with Git"
8
+
9
+ COMMANDS = [
10
+ {"section": "Gestión del repositorio", "section_en": "Repository Management"},
11
+ {"command": f"{Color.GREEN}git{Color.RESET} init", "description": "Crea un nuevo repositorio Git", "description_en": "Create a new Git repository"},
12
+ {"command": f"{Color.GREEN}git{Color.RESET} clone URL", "description": "Clona un repositorio desde la URL", "description_en": "Clone a repository from URL"},
13
+ {"command": f"{Color.GREEN}git{Color.RESET} remote add origin URL", "description": "Asocia el remoto 'origin' a la URL", "description_en": "Associate remote 'origin' with URL"},
14
+ {"command": f"{Color.GREEN}git{Color.RESET} remote -v", "description": "Muestra los remotos asociados", "description_en": "Show associated remotes"},
15
+
16
+ {"section": "Staging y commits", "section_en": "Staging and Commits"},
17
+ {"command": f"{Color.GREEN}git{Color.RESET} add filename", "description": "Añade un archivo al área de staging", "description_en": "Add a file to the staging area"},
18
+ {"command": f"{Color.GREEN}git{Color.RESET} add .", "description": "Añade todos los cambios al staging", "description_en": "Stage all current changes"},
19
+ {"command": f"{Color.GREEN}git{Color.RESET} commit -m 'message'", "description": "Realiza un commit con el mensaje dado", "description_en": "Commit with the given message"},
20
+ {"command": f"{Color.GREEN}git{Color.RESET} commit -am 'message'", "description": "Añade y hace commit en un solo paso", "description_en": "Stage tracked changes and commit in one step"},
21
+ {"command": f"{Color.GREEN}git{Color.RESET} commit --amend", "description": "Modifica el último commit", "description_en": "Amend the last commit"},
22
+
23
+ {"section": "Ramas", "section_en": "Branching"},
24
+ {"command": f"{Color.GREEN}git{Color.RESET} branch branch_name", "description": "Crea una nueva rama", "description_en": "Create a new branch"},
25
+ {"command": f"{Color.GREEN}git{Color.RESET} branch -d branch_name", "description": "Elimina una rama", "description_en": "Delete a branch"},
26
+ {"command": f"{Color.GREEN}git{Color.RESET} branch -a", "description": "Lista ramas locales y remotas", "description_en": "List all local and remote branches"},
27
+ {"command": f"{Color.GREEN}git{Color.RESET} checkout branch_name", "description": "Cambia a la rama especificada", "description_en": "Switch to the specified branch"},
28
+ {"command": f"{Color.GREEN}git{Color.RESET} checkout -b new_branch", "description": "Crea y cambia a una nueva rama", "description_en": "Create and switch to a new branch"},
29
+ {"command": f"{Color.GREEN}git{Color.RESET} switch branch_name", "description": "Cambia de rama (comando moderno)", "description_en": "Switch branches (modern command)"},
30
+
31
+ {"section": "Merge y Rebase", "section_en": "Merge and Rebase"},
32
+ {"command": f"{Color.GREEN}git{Color.RESET} merge branch_name", "description": "Fusiona la rama en la rama actual", "description_en": "Merge branch into current branch"},
33
+ {"command": f"{Color.GREEN}git{Color.RESET} rebase branch_name", "description": "Reaplica commits sobre la rama base", "description_en": "Reapply commits onto base branch"},
34
+ {"command": f"{Color.GREEN}git{Color.RESET} rebase --continue", "description": "Continúa un rebase tras resolver conflictos", "description_en": "Continue rebase after resolving conflicts"},
35
+ {"command": f"{Color.GREEN}git{Color.RESET} rebase --abort", "description": "Cancela un rebase en curso", "description_en": "Abort an in-progress rebase"},
36
+
37
+ {"section": "Remotos", "section_en": "Working with Remotes"},
38
+ {"command": f"{Color.GREEN}git{Color.RESET} push origin branch_name", "description": "Envía commits al remoto", "description_en": "Push commits to remote"},
39
+ {"command": f"{Color.GREEN}git{Color.RESET} pull origin branch_name", "description": "Actualiza la rama desde el remoto", "description_en": "Pull and merge from remote"},
40
+ {"command": f"{Color.GREEN}git{Color.RESET} fetch origin", "description": "Descarga cambios del remoto sin fusionarlos", "description_en": "Fetch remote changes without merging"},
41
+
42
+ {"section": "Stash", "section_en": "Stashing"},
43
+ {"command": f"{Color.GREEN}git{Color.RESET} stash", "description": "Guarda los cambios actuales sin commit", "description_en": "Save current changes without committing"},
44
+ {"command": f"{Color.GREEN}git{Color.RESET} stash pop", "description": "Aplica y elimina el último stash", "description_en": "Apply and remove the last stash"},
45
+ {"command": f"{Color.GREEN}git{Color.RESET} stash list", "description": "Lista todos los stashes guardados", "description_en": "List all saved stashes"},
46
+
47
+ {"section": "Historial y estado", "section_en": "Log and Status"},
48
+ {"command": f"{Color.GREEN}git{Color.RESET} status", "description": "Muestra el estado del repositorio", "description_en": "Show repository status"},
49
+ {"command": f"{Color.GREEN}git{Color.RESET} log --oneline", "description": "Muestra el historial en una línea por commit", "description_en": "Show one-line commit history"},
50
+ {"command": f"{Color.GREEN}git{Color.RESET} diff", "description": "Muestra cambios sin commit", "description_en": "Show uncommitted changes"},
51
+ {"command": f"{Color.GREEN}git{Color.RESET} show commit_id", "description": "Muestra detalles de un commit específico", "description_en": "Show details of a specific commit"},
52
+
53
+ {"section": "Deshacer cambios", "section_en": "Undoing Changes"},
54
+ {"command": f"{Color.GREEN}git{Color.RESET} reset --soft HEAD~1", "description": "Deshace el último commit manteniendo los cambios en staging", "description_en": "Undo last commit, keep changes staged"},
55
+ {"command": f"{Color.GREEN}git{Color.RESET} reset --hard HEAD~1", "description": "Deshace el último commit y elimina los cambios", "description_en": "Undo last commit and discard changes"},
56
+ {"command": f"{Color.GREEN}git{Color.RESET} restore filename", "description": "Descarta cambios en el archivo de trabajo", "description_en": "Discard working-tree changes in file"},
57
+ ]
58
+
59
+
60
+ def show(lang: str = "es") -> None:
61
+ title = TITLE_EN if lang == "en" else TITLE
62
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,39 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de GREP"
5
+ TITLE_EN = "GREP Options"
6
+ BRIEF = "Busca patrones en archivos"
7
+ BRIEF_EN = "Search for patterns in files"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}grep{Color.RESET} 'word' filename", "description": "Busca líneas que contengan 'word' en el archivo", "description_en": "Search lines containing 'word' in the file"},
11
+ {"command": f"{Color.GREEN}grep{Color.RESET} -i 'word' filename", "description": "Busca ignorando mayúsculas/minúsculas", "description_en": "Case-insensitive search"},
12
+ {"command": f"{Color.GREEN}grep{Color.RESET} -v 'word' filename", "description": "Muestra líneas que NO contienen 'word'", "description_en": "Show lines that do NOT contain 'word'"},
13
+ {"command": f"{Color.GREEN}grep{Color.RESET} -w 'word' filename", "description": "Busca 'word' como palabra completa", "description_en": "Match 'word' as a whole word"},
14
+ {"command": f"{Color.GREEN}grep{Color.RESET} -x 'word' filename", "description": "Muestra líneas que coinciden exactamente con 'word'", "description_en": "Match lines that exactly equal 'word'"},
15
+ {"command": f"{Color.GREEN}grep{Color.RESET} -c 'word' filename", "description": "Cuenta las líneas que contienen 'word'", "description_en": "Count lines containing 'word'"},
16
+ {"command": f"{Color.GREEN}grep{Color.RESET} -l 'word' *", "description": "Lista archivos que contienen 'word'", "description_en": "List files containing 'word'"},
17
+ {"command": f"{Color.GREEN}grep{Color.RESET} -L 'word' *", "description": "Lista archivos que NO contienen 'word'", "description_en": "List files NOT containing 'word'"},
18
+ {"command": f"{Color.GREEN}grep{Color.RESET} -n 'word' filename", "description": "Muestra número de línea junto a cada coincidencia", "description_en": "Show line numbers alongside matches"},
19
+ {"command": f"{Color.GREEN}grep{Color.RESET} -A N 'word' filename", "description": "Muestra N líneas después de la coincidencia", "description_en": "Print N lines after each match"},
20
+ {"command": f"{Color.GREEN}grep{Color.RESET} -B N 'word' filename", "description": "Muestra N líneas antes de la coincidencia", "description_en": "Print N lines before each match"},
21
+ {"command": f"{Color.GREEN}grep{Color.RESET} -C N 'word' filename", "description": "Muestra N líneas alrededor de la coincidencia", "description_en": "Print N lines around each match"},
22
+ {"command": f"{Color.GREEN}grep{Color.RESET} --color 'word' filename", "description": "Resalta 'word' en color en la salida", "description_en": "Highlight 'word' in color"},
23
+ {"command": f"{Color.GREEN}grep{Color.RESET} -E 'w1|w2' filename", "description": "Expresiones regulares extendidas (OR lógico)", "description_en": "Extended regex — logical OR"},
24
+ {"command": f"{Color.GREEN}grep{Color.RESET} -f patterns.txt filename", "description": "Lee los patrones de búsqueda desde un archivo", "description_en": "Read search patterns from a file"},
25
+ {"command": f"{Color.GREEN}grep{Color.RESET} -o 'word' filename", "description": "Muestra solo la parte coincidente, no la línea entera", "description_en": "Print only the matching part, not the full line"},
26
+ {"command": f"{Color.GREEN}grep{Color.RESET} -q 'word' filename", "description": "Modo silencioso — devuelve código de salida sin imprimir", "description_en": "Quiet mode — return exit code without printing"},
27
+ {"command": f"{Color.GREEN}grep{Color.RESET} -R 'word' directory", "description": "Busca recursivamente en todos los archivos del directorio", "description_en": "Recursively search all files in directory"},
28
+ {"command": f"{Color.GREEN}grep{Color.RESET} -m N 'word' filename", "description": "Muestra solo las primeras N coincidencias", "description_en": "Stop after N matches"},
29
+ {"command": f"{Color.GREEN}grep{Color.RESET} --exclude='*.log' 'word' dir", "description": "Excluye archivos que coincidan con el patrón", "description_en": "Exclude files matching pattern"},
30
+ {"command": f"{Color.GREEN}grep{Color.RESET} --include='*.txt' 'word' dir", "description": "Incluye solo archivos que coincidan con el patrón", "description_en": "Include only files matching pattern"},
31
+ {"command": f"{Color.GREEN}grep{Color.RESET} -P 'word' filename", "description": "Usa expresiones regulares Perl (PCRE)", "description_en": "Use Perl-compatible regular expressions (PCRE)"},
32
+ {"command": f"{Color.GREEN}grep{Color.RESET} '^word' filename", "description": "Busca líneas que comiencen con 'word'", "description_en": "Match lines starting with 'word'"},
33
+ {"command": f"{Color.GREEN}grep{Color.RESET} 'word$' filename", "description": "Busca líneas que terminen con 'word'", "description_en": "Match lines ending with 'word'"},
34
+ ]
35
+
36
+
37
+ def show(lang: str = "es") -> None:
38
+ title = TITLE_EN if lang == "en" else TITLE
39
+ 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 HEAD"
5
+ TITLE_EN = "HEAD Options"
6
+ BRIEF = "Muestra el inicio de un archivo"
7
+ BRIEF_EN = "Display the beginning of a file"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}head{Color.RESET} filename", "description": "Muestra las primeras 10 líneas del archivo", "description_en": "Show the first 10 lines of the file"},
11
+ {"command": f"{Color.GREEN}head{Color.RESET} -n N filename", "description": "Muestra las primeras N líneas", "description_en": "Show the first N lines"},
12
+ {"command": f"{Color.GREEN}head{Color.RESET} -c N filename", "description": "Muestra los primeros N bytes", "description_en": "Show the first N bytes"},
13
+ {"command": f"{Color.GREEN}head{Color.RESET} -q file1 file2", "description": "Suprime los encabezados de archivo en la salida", "description_en": "Suppress file headers in output"},
14
+ {"command": f"{Color.GREEN}head{Color.RESET} -v filename", "description": "Muestra siempre el encabezado del archivo", "description_en": "Always show file header"},
15
+ {"command": f"{Color.GREEN}head{Color.RESET} --lines=N filename", "description": "Igual que -n N", "description_en": "Same as -n N"},
16
+ {"command": f"{Color.GREEN}head{Color.RESET} --bytes=N filename", "description": "Igual que -c N", "description_en": "Same as -c N"},
17
+ {"command": f"{Color.GREEN}head{Color.RESET} -z filename", "description": "Usa NUL como terminador en lugar de nueva línea", "description_en": "Use NUL as line delimiter instead of newline"},
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,25 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de HTOP"
5
+ TITLE_EN = "HTOP Options"
6
+ BRIEF = "Monitor de procesos interactivo"
7
+ BRIEF_EN = "Interactive process monitor"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}htop{Color.RESET}", "description": "Inicia htop con configuración predeterminada", "description_en": "Start htop with default settings"},
11
+ {"command": f"{Color.GREEN}htop{Color.RESET} -d N", "description": "Retardo de actualización en décimas de segundo", "description_en": "Update delay in tenths of a second"},
12
+ {"command": f"{Color.GREEN}htop{Color.RESET} -C", "description": "Desactiva el uso de colores", "description_en": "Disable colors"},
13
+ {"command": f"{Color.GREEN}htop{Color.RESET} -u user", "description": "Muestra solo procesos del usuario indicado", "description_en": "Show only processes of the given user"},
14
+ {"command": f"{Color.GREEN}htop{Color.RESET} -p pid1,pid2", "description": "Muestra solo los procesos con los PIDs indicados", "description_en": "Show only the specified PIDs"},
15
+ {"command": f"{Color.GREEN}htop{Color.RESET} -s column", "description": "Ordena por la columna especificada (cpu, mem...)", "description_en": "Sort by the specified column (cpu, mem...)"},
16
+ {"command": f"{Color.GREEN}htop{Color.RESET} -t", "description": "Activa la vista de árbol de procesos", "description_en": "Enable tree view of processes"},
17
+ {"command": f"{Color.GREEN}htop{Color.RESET} --no-color", "description": "Alias de -C; desactiva colores", "description_en": "Alias for -C; disable colors"},
18
+ {"command": f"{Color.GREEN}htop{Color.RESET} --tree", "description": "Alias de -t; vista en árbol", "description_en": "Alias for -t; tree view"},
19
+ {"command": f"{Color.GREEN}htop{Color.RESET} --version", "description": "Muestra la versión de htop instalada", "description_en": "Show installed htop version"},
20
+ ]
21
+
22
+
23
+ def show(lang: str = "es") -> None:
24
+ title = TITLE_EN if lang == "en" else TITLE
25
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,28 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de IFCONFIG"
5
+ TITLE_EN = "IFCONFIG Options"
6
+ BRIEF = "Configuración de interfaces de red (legacy)"
7
+ BRIEF_EN = "Network interface configuration (legacy)"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET}", "description": "Muestra el estado de todas las interfaces activas", "description_en": "Show all active network interfaces"},
11
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface>", "description": "Muestra el estado de la interfaz especificada", "description_en": "Show the specified interface"},
12
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> up", "description": "Activa la interfaz de red", "description_en": "Bring the interface up"},
13
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> down", "description": "Desactiva la interfaz de red", "description_en": "Bring the interface down"},
14
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> <ip> netmask <mask>", "description": "Asigna IP y máscara a la interfaz", "description_en": "Assign IP and netmask to the interface"},
15
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> broadcast <addr>", "description": "Establece la dirección de broadcast", "description_en": "Set the broadcast address"},
16
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> mtu <size>", "description": "Define el tamaño de MTU", "description_en": "Set the MTU size"},
17
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> promisc", "description": "Activa el modo promiscuo", "description_en": "Enable promiscuous mode"},
18
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> -promisc", "description": "Desactiva el modo promiscuo", "description_en": "Disable promiscuous mode"},
19
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> hw ether <mac>", "description": "Cambia la dirección MAC", "description_en": "Change the MAC address"},
20
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> add <ip>", "description": "Añade una dirección IP secundaria", "description_en": "Add a secondary IP address"},
21
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> del <ip>", "description": "Elimina una dirección IP secundaria", "description_en": "Remove a secondary IP address"},
22
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} -a", "description": "Muestra todas las interfaces, activas e inactivas", "description_en": "Show all interfaces, active and inactive"},
23
+ ]
24
+
25
+
26
+ def show(lang: str = "es") -> None:
27
+ title = TITLE_EN if lang == "en" else TITLE
28
+ print_table(title, COMMANDS, lang)
guia_linux/tools/ip.py ADDED
@@ -0,0 +1,32 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de IP"
5
+ TITLE_EN = "IP Command Options"
6
+ BRIEF = "Gestión moderna de interfaces y rutas de red"
7
+ BRIEF_EN = "Modern network interface and routing management"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}ip{Color.RESET} link show", "description": "Muestra el estado de todos los enlaces de red", "description_en": "Show all network links"},
11
+ {"command": f"{Color.GREEN}ip{Color.RESET} link set <iface> up", "description": "Activa la interfaz", "description_en": "Bring interface up"},
12
+ {"command": f"{Color.GREEN}ip{Color.RESET} link set <iface> down", "description": "Desactiva la interfaz", "description_en": "Bring interface down"},
13
+ {"command": f"{Color.GREEN}ip{Color.RESET} addr show", "description": "Muestra las IPs configuradas en todas las interfaces", "description_en": "Show IP addresses on all interfaces"},
14
+ {"command": f"{Color.GREEN}ip{Color.RESET} addr add <ip/mask> dev <iface>", "description": "Asigna una IP a la interfaz", "description_en": "Assign an IP address to interface"},
15
+ {"command": f"{Color.GREEN}ip{Color.RESET} addr del <ip/mask> dev <iface>", "description": "Elimina una IP de la interfaz", "description_en": "Remove an IP address from interface"},
16
+ {"command": f"{Color.GREEN}ip{Color.RESET} addr flush dev <iface>", "description": "Elimina todas las IPs de la interfaz", "description_en": "Flush all IP addresses from interface"},
17
+ {"command": f"{Color.GREEN}ip{Color.RESET} route show", "description": "Muestra la tabla de enrutamiento", "description_en": "Show the routing table"},
18
+ {"command": f"{Color.GREEN}ip{Color.RESET} route add <dest> via <gw> dev <iface>", "description": "Añade una ruta a la tabla de enrutamiento", "description_en": "Add a route to the routing table"},
19
+ {"command": f"{Color.GREEN}ip{Color.RESET} route del <dest>", "description": "Elimina una ruta", "description_en": "Remove a route"},
20
+ {"command": f"{Color.GREEN}ip{Color.RESET} route flush cache", "description": "Limpia la caché de rutas", "description_en": "Flush the routing cache"},
21
+ {"command": f"{Color.GREEN}ip{Color.RESET} neigh show", "description": "Muestra la tabla ARP/NDP", "description_en": "Show the ARP/NDP neighbor table"},
22
+ {"command": f"{Color.GREEN}ip{Color.RESET} neigh add <ip> lladdr <mac> dev <iface>", "description": "Añade una entrada ARP estática", "description_en": "Add a static ARP entry"},
23
+ {"command": f"{Color.GREEN}ip{Color.RESET} link set <iface> mtu <size>", "description": "Establece el MTU de la interfaz", "description_en": "Set interface MTU"},
24
+ {"command": f"{Color.GREEN}ip{Color.RESET} link set <iface> promisc on", "description": "Activa el modo promiscuo", "description_en": "Enable promiscuous mode"},
25
+ {"command": f"{Color.GREEN}ip{Color.RESET} link set dev <iface> address <mac>", "description": "Cambia la dirección MAC", "description_en": "Change the MAC address"},
26
+ {"command": f"{Color.GREEN}ip{Color.RESET} tunnel add <name> mode <mode>", "description": "Crea un túnel de red", "description_en": "Create a network tunnel"},
27
+ ]
28
+
29
+
30
+ def show(lang: str = "es") -> None:
31
+ title = TITLE_EN if lang == "en" else TITLE
32
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,30 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de IPTABLES"
5
+ TITLE_EN = "IPTABLES Options"
6
+ BRIEF = "Gestión de reglas de firewall del kernel"
7
+ BRIEF_EN = "Kernel firewall rule management"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -L", "description": "Lista todas las reglas de las cadenas", "description_en": "List all rules in all chains"},
11
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -F", "description": "Limpia todas las reglas de las cadenas", "description_en": "Flush all rules from all chains"},
12
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -s IP -j ACCEPT", "description": "Permite tráfico de una IP en INPUT", "description_en": "Allow traffic from an IP in INPUT"},
13
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -p tcp --dport 80 -j ACCEPT", "description": "Permite tráfico HTTP entrante (puerto 80)", "description_en": "Allow incoming HTTP traffic (port 80)"},
14
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -p tcp --dport 443 -j ACCEPT", "description": "Permite tráfico HTTPS entrante (puerto 443)", "description_en": "Allow incoming HTTPS traffic (port 443)"},
15
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A OUTPUT -d IP -j DROP", "description": "Bloquea el tráfico saliente hacia una IP", "description_en": "Block outgoing traffic to an IP"},
16
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -p icmp --icmp-type 8 -j ACCEPT", "description": "Permite ping (ICMP tipo 8)", "description_en": "Allow ping (ICMP type 8)"},
17
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT", "description": "Permite tráfico de conexiones existentes", "description_en": "Allow traffic from established connections"},
18
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -P INPUT DROP", "description": "Política por defecto DROP en INPUT", "description_en": "Set default DROP policy for INPUT"},
19
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -P OUTPUT ACCEPT", "description": "Política por defecto ACCEPT en OUTPUT", "description_en": "Set default ACCEPT policy for OUTPUT"},
20
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -D INPUT -s IP -j ACCEPT", "description": "Elimina una regla específica de INPUT", "description_en": "Delete a specific rule from INPUT"},
21
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -I INPUT 1 -s IP -j ACCEPT", "description": "Inserta una regla al inicio de INPUT", "description_en": "Insert a rule at the top of INPUT"},
22
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -p udp --dport 53 -j ACCEPT", "description": "Permite DNS entrante (UDP 53)", "description_en": "Allow incoming DNS (UDP port 53)"},
23
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -t nat -A POSTROUTING -o eth0 -j MASQUERADE", "description": "Habilita NAT en la interfaz de salida", "description_en": "Enable NAT on the outgoing interface"},
24
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080", "description": "Redirige el puerto 80 al 8080", "description_en": "Redirect port 80 to 8080"},
25
+ ]
26
+
27
+
28
+ def show(lang: str = "es") -> None:
29
+ title = TITLE_EN if lang == "en" else TITLE
30
+ print_table(title, COMMANDS, lang)
guia_linux/tools/jq.py ADDED
@@ -0,0 +1,32 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de JQ"
5
+ TITLE_EN = "JQ Options"
6
+ BRIEF = "Procesador de JSON en línea de comandos"
7
+ BRIEF_EN = "Command-line JSON processor"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.' file.json", "description": "Formatea y colorea el JSON de entrada", "description_en": "Pretty-print and colorize JSON input"},
11
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.key' file.json", "description": "Extrae el valor de una clave", "description_en": "Extract the value of a key"},
12
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.key.nested' file.json", "description": "Accede a una clave anidada", "description_en": "Access a nested key"},
13
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.array[]' file.json", "description": "Itera sobre los elementos de un array", "description_en": "Iterate over array elements"},
14
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.array[0]' file.json", "description": "Accede al primer elemento de un array", "description_en": "Access the first array element"},
15
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.[] | .name' file.json", "description": "Extrae 'name' de cada objeto del array", "description_en": "Extract 'name' from each array object"},
16
+ {"command": f"{Color.GREEN}jq{Color.RESET} 'keys' file.json", "description": "Lista las claves del objeto JSON", "description_en": "List the keys of the JSON object"},
17
+ {"command": f"{Color.GREEN}jq{Color.RESET} 'length' file.json", "description": "Devuelve la longitud del array u objeto", "description_en": "Return the length of array or object"},
18
+ {"command": f"{Color.GREEN}jq{Color.RESET} 'select(.age > 18)' file.json", "description": "Filtra objetos por condición", "description_en": "Filter objects by condition"},
19
+ {"command": f"{Color.GREEN}jq{Color.RESET} '{{name, age}}' file.json", "description": "Proyecta solo los campos seleccionados", "description_en": "Project only selected fields"},
20
+ {"command": f"{Color.GREEN}jq{Color.RESET} '.[] | .name' file.json | {Color.GREEN}sort{Color.RESET}", "description": "Extrae y ordena valores", "description_en": "Extract and sort values"},
21
+ {"command": f"{Color.GREEN}jq{Color.RESET} -r '.name' file.json", "description": "Salida en texto plano (sin comillas)", "description_en": "Raw string output (no quotes)"},
22
+ {"command": f"{Color.GREEN}jq{Color.RESET} -c '.' file.json", "description": "Salida compacta en una sola línea", "description_en": "Compact single-line output"},
23
+ {"command": f"{Color.GREEN}jq{Color.RESET} -n '{{a: 1, b: 2}}'", "description": "Crea un objeto JSON sin entrada", "description_en": "Create a JSON object without input"},
24
+ {"command": f"{Color.GREEN}curl{Color.RESET} -s URL | {Color.GREEN}jq{Color.RESET} '.data'", "description": "Procesa la respuesta JSON de una API", "description_en": "Process JSON response from an API"},
25
+ {"command": f"{Color.GREEN}jq{Color.RESET} '. + {{\"new_key\": \"value\"}}' file.json", "description": "Añade un campo nuevo al objeto", "description_en": "Add a new field to the object"},
26
+ {"command": f"{Color.GREEN}jq{Color.RESET} 'del(.key)' file.json", "description": "Elimina un campo del objeto", "description_en": "Remove a field from the object"},
27
+ ]
28
+
29
+
30
+ def show(lang: str = "es") -> None:
31
+ title = TITLE_EN if lang == "en" else TITLE
32
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,48 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Ubicaciones de Logs del Sistema"
5
+ TITLE_EN = "System Log Locations"
6
+ BRIEF = "Rutas de logs importantes en Linux"
7
+ BRIEF_EN = "Important log file paths in Linux"
8
+
9
+ COMMANDS = [
10
+ {"category": "Logs de Sistema", "category_en": "System Logs"},
11
+ {"logfile": f"{Color.GREEN}/var/log/syslog{Color.RESET}", "description": "Log principal del sistema (Debian/Ubuntu)", "description_en": "Main system log (Debian/Ubuntu)"},
12
+ {"logfile": f"{Color.GREEN}/var/log/messages{Color.RESET}", "description": "Log principal del sistema (RHEL/CentOS)", "description_en": "Main system log (RHEL/CentOS)"},
13
+ {"logfile": f"{Color.GREEN}/var/log/kern.log{Color.RESET}", "description": "Mensajes del kernel", "description_en": "Kernel messages"},
14
+ {"logfile": f"{Color.GREEN}/var/log/auth.log{Color.RESET}", "description": "Autenticaciones y accesos (Debian/Ubuntu)", "description_en": "Authentication and access log (Debian/Ubuntu)"},
15
+ {"logfile": f"{Color.GREEN}/var/log/secure{Color.RESET}", "description": "Autenticaciones y accesos (RHEL/CentOS)", "description_en": "Authentication and access log (RHEL/CentOS)"},
16
+ {"logfile": f"{Color.GREEN}/var/log/cron.log{Color.RESET}", "description": "Log de tareas cron", "description_en": "Cron job log"},
17
+ {"logfile": f"{Color.GREEN}/var/log/audit/audit.log{Color.RESET}", "description": "Eventos auditados del sistema", "description_en": "Audited system events"},
18
+ {"logfile": f"{Color.GREEN}/var/log/boot.log{Color.RESET}", "description": "Mensajes de arranque del sistema", "description_en": "System boot messages"},
19
+ {"logfile": f"{Color.GREEN}/var/log/dmesg{Color.RESET}", "description": "Mensajes de diagnóstico del kernel", "description_en": "Kernel diagnostic messages"},
20
+ {"logfile": f"{Color.GREEN}/var/log/faillog{Color.RESET}", "description": "Intentos de inicio de sesión fallidos", "description_en": "Failed login attempts"},
21
+ {"logfile": f"{Color.GREEN}/var/log/lastlog{Color.RESET}", "description": "Último inicio de sesión de cada usuario", "description_en": "Last login for each user"},
22
+
23
+ {"category": "Logs de Servidores Web", "category_en": "Web Server Logs"},
24
+ {"logfile": f"{Color.GREEN}Apache: /var/log/apache2/access.log{Color.RESET}", "description": "Log de accesos de Apache (Debian)", "description_en": "Apache access log (Debian)"},
25
+ {"logfile": f"{Color.GREEN}Apache: /var/log/apache2/error.log{Color.RESET}", "description": "Log de errores de Apache", "description_en": "Apache error log"},
26
+ {"logfile": f"{Color.GREEN}Nginx: /var/log/nginx/access.log{Color.RESET}", "description": "Log de accesos de Nginx", "description_en": "Nginx access log"},
27
+ {"logfile": f"{Color.GREEN}Nginx: /var/log/nginx/error.log{Color.RESET}", "description": "Log de errores de Nginx", "description_en": "Nginx error log"},
28
+
29
+ {"category": "Logs de Bases de Datos", "category_en": "Database Logs"},
30
+ {"logfile": f"{Color.GREEN}MySQL: /var/log/mysql/mysql.log{Color.RESET}", "description": "Log general de MySQL", "description_en": "MySQL general log"},
31
+ {"logfile": f"{Color.GREEN}MySQL: /var/log/mysql/error.log{Color.RESET}", "description": "Log de errores de MySQL", "description_en": "MySQL error log"},
32
+ {"logfile": f"{Color.GREEN}PostgreSQL: /var/log/postgresql/*.log{Color.RESET}", "description": "Logs de PostgreSQL", "description_en": "PostgreSQL logs"},
33
+
34
+ {"category": "Logs de Servicios", "category_en": "Service Logs"},
35
+ {"logfile": f"{Color.GREEN}Systemd: /var/log/journal/{Color.RESET}", "description": "Logs binarios de systemd (usar journalctl)", "description_en": "systemd binary logs (use journalctl)"},
36
+ {"logfile": f"{Color.GREEN}Docker: /var/log/docker.log{Color.RESET}", "description": "Log de eventos de Docker", "description_en": "Docker event log"},
37
+ {"logfile": f"{Color.GREEN}Postfix: /var/log/mail.log{Color.RESET}", "description": "Log de correo electrónico", "description_en": "Mail server log"},
38
+ {"logfile": f"{Color.GREEN}FTP: /var/log/vsftpd.log{Color.RESET}", "description": "Log del servicio vsftpd", "description_en": "vsftpd FTP service log"},
39
+
40
+ {"category": "Logs de Firewall", "category_en": "Firewall Logs"},
41
+ {"logfile": f"{Color.GREEN}Firewalld: /var/log/firewalld{Color.RESET}", "description": "Log de firewalld", "description_en": "firewalld log"},
42
+ {"logfile": f"{Color.GREEN}UFW: /var/log/ufw.log{Color.RESET}", "description": "Log de UFW (Uncomplicated Firewall)", "description_en": "UFW (Uncomplicated Firewall) log"},
43
+ ]
44
+
45
+
46
+ def show(lang: str = "es") -> None:
47
+ title = TITLE_EN if lang == "en" else TITLE
48
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,29 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de LSBLK"
5
+ TITLE_EN = "LSBLK Options"
6
+ BRIEF = "Lista dispositivos de bloque del sistema"
7
+ BRIEF_EN = "List block devices"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}lsblk{Color.RESET}", "description": "Lista todos los dispositivos de bloque", "description_en": "List all block devices"},
11
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -a", "description": "Incluye dispositivos vacíos", "description_en": "Include empty devices"},
12
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -b", "description": "Muestra tamaños en bytes", "description_en": "Show sizes in bytes"},
13
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -d", "description": "Muestra solo discos, sin particiones", "description_en": "Show only disks, no partitions"},
14
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -f", "description": "Muestra sistema de archivos, UUID y etiqueta", "description_en": "Show filesystem, UUID and label"},
15
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -J", "description": "Salida en formato JSON", "description_en": "JSON format output"},
16
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -l", "description": "Formato de lista plana (sin árbol)", "description_en": "Flat list format (no tree)"},
17
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -m", "description": "Incluye información de permisos", "description_en": "Include permission information"},
18
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -n", "description": "Suprime la fila de encabezado", "description_en": "Suppress header row"},
19
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -o NAME,SIZE,TYPE,MOUNTPOINT", "description": "Muestra solo las columnas especificadas", "description_en": "Show only the specified columns"},
20
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} -P", "description": "Salida en formato clave=valor", "description_en": "Key=value format output"},
21
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} --output-all", "description": "Muestra todas las columnas disponibles", "description_en": "Show all available columns"},
22
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} --paths", "description": "Muestra rutas completas en la columna NAME", "description_en": "Show full device paths in NAME column"},
23
+ {"command": f"{Color.GREEN}lsblk{Color.RESET} --scsi", "description": "Incluye información SCSI del dispositivo", "description_en": "Include SCSI device information"},
24
+ ]
25
+
26
+
27
+ def show(lang: str = "es") -> None:
28
+ title = TITLE_EN if lang == "en" else TITLE
29
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,30 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de LSOF"
5
+ TITLE_EN = "LSOF Options"
6
+ BRIEF = "Lista archivos abiertos por procesos"
7
+ BRIEF_EN = "List open files by processes"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}lsof{Color.RESET}", "description": "Muestra todos los archivos abiertos", "description_en": "Show all open files"},
11
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -u username", "description": "Archivos abiertos por un usuario específico", "description_en": "Files opened by a specific user"},
12
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -c process_name", "description": "Archivos abiertos por un proceso específico", "description_en": "Files opened by a specific process"},
13
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -p PID", "description": "Archivos abiertos por el PID dado", "description_en": "Files opened by the given PID"},
14
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -i", "description": "Muestra archivos de red abiertos (TCP/UDP)", "description_en": "Show open network files (TCP/UDP)"},
15
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -i :80", "description": "Archivos abiertos en el puerto 80", "description_en": "Open files on port 80"},
16
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -i TCP", "description": "Muestra solo conexiones TCP", "description_en": "Show only TCP connections"},
17
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -i UDP", "description": "Muestra solo conexiones UDP", "description_en": "Show only UDP connections"},
18
+ {"command": f"{Color.GREEN}lsof{Color.RESET} +D /path/to/dir", "description": "Archivos abiertos en el directorio (recursivo)", "description_en": "Open files in directory (recursive)"},
19
+ {"command": f"{Color.GREEN}lsof{Color.RESET} +d /path/to/dir", "description": "Archivos abiertos en el directorio (sin recursión)", "description_en": "Open files in directory (non-recursive)"},
20
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -t", "description": "Muestra solo los PIDs", "description_en": "Show only PIDs"},
21
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -n", "description": "No resuelve nombres de host", "description_en": "Do not resolve hostnames"},
22
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -P", "description": "No convierte puertos a nombres de servicio", "description_en": "Do not convert port numbers to service names"},
23
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -r N", "description": "Refresca el listado cada N segundos", "description_en": "Refresh listing every N seconds"},
24
+ {"command": f"{Color.GREEN}lsof{Color.RESET} -a -u user -c proc", "description": "AND lógico — combina múltiples filtros", "description_en": "Logical AND — combine multiple filters"},
25
+ ]
26
+
27
+
28
+ def show(lang: str = "es") -> None:
29
+ title = TITLE_EN if lang == "en" else TITLE
30
+ 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 LXC"
5
+ TITLE_EN = "LXC Options"
6
+ BRIEF = "Gestión de contenedores LXC"
7
+ BRIEF_EN = "LXC container management"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}lxc-ls{Color.RESET}", "description": "Lista todos los contenedores existentes", "description_en": "List all existing containers"},
11
+ {"command": f"{Color.GREEN}lxc-stop{Color.RESET} -n container_name", "description": "Detiene un contenedor en ejecución", "description_en": "Stop a running container"},
12
+ {"command": f"{Color.GREEN}lxc-start{Color.RESET} -n container_name", "description": "Inicia un contenedor detenido", "description_en": "Start a stopped container"},
13
+ {"command": f"{Color.GREEN}lxc-restart{Color.RESET} -n container_name", "description": "Reinicia un contenedor", "description_en": "Restart a container"},
14
+ {"command": f"{Color.GREEN}lxc-config{Color.RESET} -n container_name -s storage", "description": "Administra el almacenamiento del contenedor", "description_en": "Manage container storage"},
15
+ {"command": f"{Color.GREEN}lxc-config{Color.RESET} -n container_name -s network", "description": "Administra la configuración de red", "description_en": "Manage network configuration"},
16
+ {"command": f"{Color.GREEN}lxc-config{Color.RESET} -n container_name -s security", "description": "Administra la configuración de seguridad", "description_en": "Manage security configuration"},
17
+ {"command": f"{Color.GREEN}lxc-attach{Color.RESET} -n container_name", "description": "Conecta al contenedor especificado", "description_en": "Attach to the specified container"},
18
+ {"command": f"{Color.GREEN}lxc-attach{Color.RESET} -n container_name -f /path", "description": "Conecta al contenedor y comparte un directorio", "description_en": "Attach to container and share a directory"},
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/nc.py ADDED
@@ -0,0 +1,27 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de NC (Netcat)"
5
+ TITLE_EN = "NC (Netcat) Options"
6
+ BRIEF = "Navaja suiza de TCP/IP"
7
+ BRIEF_EN = "TCP/IP Swiss army knife"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}nc{Color.RESET} -l -p <port>", "description": "Escucha en el puerto especificado (modo servidor)", "description_en": "Listen on the specified port (server mode)"},
11
+ {"command": f"{Color.GREEN}nc{Color.RESET} <host> <port>", "description": "Conecta al host y puerto (modo cliente)", "description_en": "Connect to host and port (client mode)"},
12
+ {"command": f"{Color.GREEN}nc{Color.RESET} -z <host> <port>", "description": "Escanea puertos sin enviar datos", "description_en": "Port scan without sending data"},
13
+ {"command": f"{Color.GREEN}nc{Color.RESET} -z <host> 20-80", "description": "Escanea un rango de puertos", "description_en": "Scan a port range"},
14
+ {"command": f"{Color.GREEN}nc{Color.RESET} -v", "description": "Modo verbose — salida detallada", "description_en": "Verbose mode — detailed output"},
15
+ {"command": f"{Color.GREEN}nc{Color.RESET} -u", "description": "Usa UDP en lugar de TCP", "description_en": "Use UDP instead of TCP"},
16
+ {"command": f"{Color.GREEN}nc{Color.RESET} -n", "description": "Omite la resolución DNS", "description_en": "Skip DNS resolution"},
17
+ {"command": f"{Color.GREEN}nc{Color.RESET} -k", "description": "Mantiene la conexión abierta tras desconexión", "description_en": "Keep listening after client disconnects"},
18
+ {"command": f"{Color.GREEN}nc{Color.RESET} -w <timeout>", "description": "Tiempo de espera en segundos", "description_en": "Connection timeout in seconds"},
19
+ {"command": f"{Color.GREEN}nc{Color.RESET} -e <command>", "description": "Ejecuta un comando tras la conexión", "description_en": "Execute command after connection"},
20
+ {"command": f"{Color.GREEN}nc{Color.RESET} -x <proxy>", "description": "Usa un proxy SOCKS para la conexión", "description_en": "Use a SOCKS proxy for the connection"},
21
+ {"command": f"{Color.GREEN}nc{Color.RESET} -q <seconds>", "description": "Espera N segundos tras EOF antes de cerrar", "description_en": "Wait N seconds after EOF before closing"},
22
+ ]
23
+
24
+
25
+ def show(lang: str = "es") -> None:
26
+ title = TITLE_EN if lang == "en" else TITLE
27
+ print_table(title, COMMANDS, lang)
@@ -0,0 +1,28 @@
1
+ from shellcolorize import Color
2
+ from guia_linux.utils import print_table
3
+
4
+ TITLE = "Opciones de NETSTAT"
5
+ TITLE_EN = "NETSTAT Options"
6
+ BRIEF = "Estadísticas de conexiones de red"
7
+ BRIEF_EN = "Network connection statistics"
8
+
9
+ COMMANDS = [
10
+ {"command": f"{Color.GREEN}netstat{Color.RESET}", "description": "Muestra todas las conexiones de red activas", "description_en": "Show all active network connections"},
11
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -a", "description": "Muestra todas las conexiones y puertos en escucha", "description_en": "Show all connections and listening ports"},
12
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -t", "description": "Muestra solo conexiones TCP", "description_en": "Show only TCP connections"},
13
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -u", "description": "Muestra solo conexiones UDP", "description_en": "Show only UDP connections"},
14
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -l", "description": "Muestra solo puertos en escucha", "description_en": "Show only listening ports"},
15
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -p", "description": "Muestra el proceso (PID) de cada conexión", "description_en": "Show the process (PID) for each connection"},
16
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -n", "description": "Muestra IPs y puertos en formato numérico", "description_en": "Show IPs and ports in numeric format"},
17
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -r", "description": "Muestra la tabla de enrutamiento", "description_en": "Show the routing table"},
18
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -i", "description": "Muestra estadísticas de interfaz de red", "description_en": "Show network interface statistics"},
19
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -c", "description": "Actualiza la información en intervalos continuos", "description_en": "Continuously update output"},
20
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -s", "description": "Muestra estadísticas por protocolo", "description_en": "Show per-protocol statistics"},
21
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -g", "description": "Muestra la tabla de membresía multicast", "description_en": "Show multicast group membership"},
22
+ {"command": f"{Color.GREEN}netstat{Color.RESET} -tulnp", "description": "Combinación común: TCP/UDP puertos en escucha con PID", "description_en": "Common combo: TCP/UDP listening ports with PID"},
23
+ ]
24
+
25
+
26
+ def show(lang: str = "es") -> None:
27
+ title = TITLE_EN if lang == "en" else TITLE
28
+ print_table(title, COMMANDS, lang)