linux-commands-guide 2.0.1__tar.gz → 2.1.0__tar.gz

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 (76) hide show
  1. linux_commands_guide-2.1.0/LICENSE +21 -0
  2. linux_commands_guide-2.1.0/PKG-INFO +208 -0
  3. linux_commands_guide-2.1.0/README.md +181 -0
  4. linux_commands_guide-2.1.0/guia_linux/__init__.py +5 -0
  5. linux_commands_guide-2.1.0/guia_linux/__main__.py +3 -0
  6. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/cli.py +35 -9
  7. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/cat.py +5 -5
  8. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/chown.py +1 -1
  9. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/ifconfig.py +1 -1
  10. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/iptables.py +1 -1
  11. linux_commands_guide-2.1.0/guia_linux/tools/lxc.py +33 -0
  12. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/nc.py +2 -2
  13. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/regex.py +5 -5
  14. linux_commands_guide-2.1.0/guia_linux/tools/rsync.py +27 -0
  15. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/tmux.py +2 -2
  16. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/xargs.py +1 -1
  17. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/utils.py +7 -5
  18. linux_commands_guide-2.1.0/linux_commands_guide.egg-info/PKG-INFO +208 -0
  19. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/SOURCES.txt +4 -1
  20. linux_commands_guide-2.1.0/linux_commands_guide.egg-info/entry_points.txt +2 -0
  21. linux_commands_guide-2.1.0/linux_commands_guide.egg-info/requires.txt +5 -0
  22. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/pyproject.toml +26 -6
  23. linux_commands_guide-2.1.0/tests/test_guide.py +83 -0
  24. linux_commands_guide-2.0.1/PKG-INFO +0 -147
  25. linux_commands_guide-2.0.1/README.md +0 -130
  26. linux_commands_guide-2.0.1/guia_linux/__init__.py +0 -4
  27. linux_commands_guide-2.0.1/guia_linux/tools/lxc.py +0 -24
  28. linux_commands_guide-2.0.1/guia_linux/tools/rsync.py +0 -27
  29. linux_commands_guide-2.0.1/linux_commands_guide.egg-info/PKG-INFO +0 -147
  30. linux_commands_guide-2.0.1/linux_commands_guide.egg-info/entry_points.txt +0 -2
  31. linux_commands_guide-2.0.1/linux_commands_guide.egg-info/requires.txt +0 -1
  32. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/__init__.py +0 -0
  33. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/awk.py +0 -0
  34. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/chmod.py +0 -0
  35. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/crontab.py +0 -0
  36. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/curl.py +0 -0
  37. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/cut.py +0 -0
  38. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/df.py +0 -0
  39. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/docker.py +0 -0
  40. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/du.py +0 -0
  41. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/file_descriptors.py +0 -0
  42. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/find.py +0 -0
  43. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/firewall_cmd.py +0 -0
  44. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/free.py +0 -0
  45. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/git.py +0 -0
  46. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/grep.py +0 -0
  47. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/head.py +0 -0
  48. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/htop.py +0 -0
  49. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/ip.py +0 -0
  50. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/jq.py +0 -0
  51. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/logs.py +0 -0
  52. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/lsblk.py +0 -0
  53. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/lsof.py +0 -0
  54. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/netstat.py +0 -0
  55. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/nmap.py +0 -0
  56. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/ps.py +0 -0
  57. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/scp.py +0 -0
  58. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/sed.py +0 -0
  59. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/shortcuts.py +0 -0
  60. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/sort.py +0 -0
  61. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/ss.py +0 -0
  62. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/ssh.py +0 -0
  63. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/system.py +0 -0
  64. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/systemctl.py +0 -0
  65. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/tail.py +0 -0
  66. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/tar.py +0 -0
  67. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/tee.py +0 -0
  68. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/top.py +0 -0
  69. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/tr.py +0 -0
  70. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/uname.py +0 -0
  71. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/uniq.py +0 -0
  72. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/vim.py +0 -0
  73. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/guia_linux/tools/watch.py +0 -0
  74. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/dependency_links.txt +0 -0
  75. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/top_level.txt +0 -0
  76. {linux_commands_guide-2.0.1 → linux_commands_guide-2.1.0}/setup.cfg +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Serber1990
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: linux-commands-guide
3
+ Version: 2.1.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
+ Project-URL: Changelog, https://github.com/serber1990/linux-commands-guide/blob/main/CHANGELOG.md
11
+ Keywords: linux,cheatsheet,commands,reference,sysadmin,bilingual,cli
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Natural Language :: English
17
+ Classifier: Natural Language :: Spanish
18
+ Classifier: Topic :: System :: Systems Administration
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: shellcolorize>=1.1.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=7; extra == "dev"
25
+ Requires-Dist: ruff>=0.4; extra == "dev"
26
+ Dynamic: license-file
27
+
28
+ # linux-commands-guide — `lh`
29
+
30
+ [![CI](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml/badge.svg)](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml)
31
+ [![PyPI version](https://badge.fury.io/py/linux-commands-guide.svg)](https://badge.fury.io/py/linux-commands-guide)
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
33
+ [![GitHub stars](https://img.shields.io/github/stars/serber1990/linux-commands-guide?style=social)](https://github.com/serber1990/linux-commands-guide/stargazers)
34
+
35
+ **Bilingual ES/EN Linux command reference for the terminal.** 51 tools covered, keyword search across all of
36
+ them, one short command: `lh`. Like a cheat sheet that is always one keystroke away — and works over SSH.
37
+
38
+ *Guía de comandos Linux bilingüe (español / inglés) para la terminal.*
39
+
40
+ ---
41
+
42
+ ## ✨ Features
43
+
44
+ - 🌐 **Bilingual** — Spanish or English, picked from your locale (`--lang es|en` to force it)
45
+ - 🔍 **Cross-tool search** — `lh -s port` finds every command mentioning "port", in both languages
46
+ - 📦 **51 tools** — awk, grep, find, git, docker, ssh, tmux, jq, ss, rsync, tar, systemctl, iptables and more
47
+ - ✅ **Checked content** — every entry is tested for both translations; examples are real, working commands
48
+ - 🔇 **Pipe-friendly** — plain text when piped (`lh tar | less`), honours `NO_COLOR`
49
+
50
+ ---
51
+
52
+ ## 📥 Installation
53
+
54
+ ```bash
55
+ pip install linux-commands-guide
56
+ ```
57
+
58
+ Or from source:
59
+
60
+ ```bash
61
+ git clone https://github.com/serber1990/linux-commands-guide.git
62
+ cd linux-commands-guide
63
+ pip install -e .
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 🛠 Usage
69
+
70
+ ```bash
71
+ lh <tool> # Show commands for a tool
72
+ lh -s <keyword> # Search across all tools
73
+ lh --lang en <tool> # Force English (or --lang es for Spanish)
74
+ lh --help # Help and the full tool list
75
+ lh --version
76
+ ```
77
+
78
+ ### Examples
79
+
80
+ ```bash
81
+ lh ssh
82
+ ```
83
+
84
+ ```
85
+ ╔══════════════════════════════════════════════╗
86
+ ║ SSH Options ║
87
+ ╚══════════════════════════════════════════════╝
88
+
89
+ Command Description
90
+ ──────────────────────────────────────────────────────────────────────────────────────────────
91
+ ssh user@host Connect to host as the given user
92
+ ssh -p <port> user@host Connect using the specified port
93
+ ssh -i key.pem user@host Use a private key for authentication
94
+ ssh -L 8080:localhost:80 user@host Local tunnel: forward local port 8080 to host port 80
95
+ ssh -R 9090:localhost:8080 user@host Remote tunnel: forward host port 9090 to local port 8080
96
+ …
97
+ ```
98
+
99
+ ```bash
100
+ lh -s port
101
+ ```
102
+
103
+ ```
104
+ ╔══════════════════════════════════════════════════╗
105
+ ║ Search: port ║
106
+ ╚══════════════════════════════════════════════════╝
107
+
108
+ 34 results
109
+
110
+ ▶ docker
111
+ docker run -p 8080:80 image_name
112
+ Map host port to container port
113
+ ▶ firewall-cmd
114
+ firewall-cmd --zone=zone --add-port=80/tcp --permanent
115
+ Permanently open TCP port 80
116
+ firewall-cmd --zone=zone --remove-port=80/tcp --permanent
117
+ …
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 🔧 Available Tools
123
+
124
+ | Tool | Description |
125
+ |------|-------------|
126
+ | `awk` | Column-based text processing |
127
+ | `cat` | Display and concatenate file contents |
128
+ | `chmod` | Change file permissions |
129
+ | `chown` | Change file owner and group |
130
+ | `crontab` | Periodic task scheduling |
131
+ | `curl` | Transfer data with URLs |
132
+ | `cut` | Extract sections from each line |
133
+ | `df` | Display disk space usage |
134
+ | `docker` | Docker container management |
135
+ | `du` | Display directory space usage |
136
+ | `descriptors` | File descriptors and redirections |
137
+ | `find` | Search for files and directories |
138
+ | `firewall-cmd` | Manage the firewalld firewall |
139
+ | `free` | Display system memory usage |
140
+ | `git` | Version control with Git |
141
+ | `grep` | Search for patterns in files |
142
+ | `head` | Display the beginning of a file |
143
+ | `htop` | Interactive process monitor |
144
+ | `ifconfig` | Network interface configuration (legacy) |
145
+ | `ip` | Modern network interface and routing management |
146
+ | `iptables` | Kernel firewall rule management |
147
+ | `jq` | Command-line JSON processor |
148
+ | `logs` | Important log file paths in Linux |
149
+ | `lsblk` | List block devices |
150
+ | `lsof` | List open files by processes |
151
+ | `lxc` | LXC container management |
152
+ | `nc` | TCP/IP Swiss army knife |
153
+ | `netstat` | Network connection statistics |
154
+ | `nmap` | Network and port scanner |
155
+ | `ps` | Information about running processes |
156
+ | `regex` | Regular expression patterns |
157
+ | `rsync` | Efficient file synchronization |
158
+ | `scp` | Secure file copy over SSH |
159
+ | `sed` | Stream text editor |
160
+ | `shortcuts` | Terminal keyboard shortcuts |
161
+ | `sort` | Sort lines of text |
162
+ | `ss` | Socket statistics (replaces netstat) |
163
+ | `ssh` | Secure Shell client |
164
+ | `system` | Basic system commands |
165
+ | `systemctl` | Manage services with systemd |
166
+ | `tail` | Display the end of a file |
167
+ | `tar` | File archiving and compression |
168
+ | `tee` | Read stdin and write to stdout and files |
169
+ | `tmux` | Terminal multiplexer |
170
+ | `top` | Real-time process monitor |
171
+ | `tr` | Translate or delete characters |
172
+ | `uname` | System and kernel information |
173
+ | `uniq` | Filter adjacent duplicate lines |
174
+ | `vim` | Modal terminal text editor |
175
+ | `watch` | Execute a command periodically |
176
+ | `xargs` | Build and execute commands from stdin |
177
+
178
+ ---
179
+
180
+ ## 🧪 Development
181
+
182
+ ```bash
183
+ pip install -e ".[dev]"
184
+ ruff check .
185
+ pytest
186
+ ```
187
+
188
+ Each tool is a small module in `guia_linux/tools/` with a `COMMANDS` list. To add one, copy an existing
189
+ module, register it in `guia_linux/tools/__init__.py`, add it to the table above, and run `pytest` —
190
+ the test suite checks that every entry has both translations and that the README lists every tool.
191
+
192
+ See [CHANGELOG.md](CHANGELOG.md) for release notes.
193
+
194
+ ---
195
+
196
+ ## 📝 License
197
+
198
+ MIT — see [LICENSE](LICENSE).
199
+
200
+ ---
201
+
202
+ ## 💬 Feedback
203
+
204
+ Open an issue or reach out via GitHub.
205
+
206
+ ## 🌐 Connect
207
+
208
+ [![GitHub](https://img.shields.io/badge/GitHub-@serber1990-181717?style=flat-square&logo=github)](https://github.com/serber1990)
@@ -0,0 +1,181 @@
1
+ # linux-commands-guide — `lh`
2
+
3
+ [![CI](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml/badge.svg)](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml)
4
+ [![PyPI version](https://badge.fury.io/py/linux-commands-guide.svg)](https://badge.fury.io/py/linux-commands-guide)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
6
+ [![GitHub stars](https://img.shields.io/github/stars/serber1990/linux-commands-guide?style=social)](https://github.com/serber1990/linux-commands-guide/stargazers)
7
+
8
+ **Bilingual ES/EN Linux command reference for the terminal.** 51 tools covered, keyword search across all of
9
+ them, one short command: `lh`. Like a cheat sheet that is always one keystroke away — and works over SSH.
10
+
11
+ *Guía de comandos Linux bilingüe (español / inglés) para la terminal.*
12
+
13
+ ---
14
+
15
+ ## ✨ Features
16
+
17
+ - 🌐 **Bilingual** — Spanish or English, picked from your locale (`--lang es|en` to force it)
18
+ - 🔍 **Cross-tool search** — `lh -s port` finds every command mentioning "port", in both languages
19
+ - 📦 **51 tools** — awk, grep, find, git, docker, ssh, tmux, jq, ss, rsync, tar, systemctl, iptables and more
20
+ - ✅ **Checked content** — every entry is tested for both translations; examples are real, working commands
21
+ - 🔇 **Pipe-friendly** — plain text when piped (`lh tar | less`), honours `NO_COLOR`
22
+
23
+ ---
24
+
25
+ ## 📥 Installation
26
+
27
+ ```bash
28
+ pip install linux-commands-guide
29
+ ```
30
+
31
+ Or from source:
32
+
33
+ ```bash
34
+ git clone https://github.com/serber1990/linux-commands-guide.git
35
+ cd linux-commands-guide
36
+ pip install -e .
37
+ ```
38
+
39
+ ---
40
+
41
+ ## 🛠 Usage
42
+
43
+ ```bash
44
+ lh <tool> # Show commands for a tool
45
+ lh -s <keyword> # Search across all tools
46
+ lh --lang en <tool> # Force English (or --lang es for Spanish)
47
+ lh --help # Help and the full tool list
48
+ lh --version
49
+ ```
50
+
51
+ ### Examples
52
+
53
+ ```bash
54
+ lh ssh
55
+ ```
56
+
57
+ ```
58
+ ╔══════════════════════════════════════════════╗
59
+ ║ SSH Options ║
60
+ ╚══════════════════════════════════════════════╝
61
+
62
+ Command Description
63
+ ──────────────────────────────────────────────────────────────────────────────────────────────
64
+ ssh user@host Connect to host as the given user
65
+ ssh -p <port> user@host Connect using the specified port
66
+ ssh -i key.pem user@host Use a private key for authentication
67
+ ssh -L 8080:localhost:80 user@host Local tunnel: forward local port 8080 to host port 80
68
+ ssh -R 9090:localhost:8080 user@host Remote tunnel: forward host port 9090 to local port 8080
69
+ …
70
+ ```
71
+
72
+ ```bash
73
+ lh -s port
74
+ ```
75
+
76
+ ```
77
+ ╔══════════════════════════════════════════════════╗
78
+ ║ Search: port ║
79
+ ╚══════════════════════════════════════════════════╝
80
+
81
+ 34 results
82
+
83
+ ▶ docker
84
+ docker run -p 8080:80 image_name
85
+ Map host port to container port
86
+ ▶ firewall-cmd
87
+ firewall-cmd --zone=zone --add-port=80/tcp --permanent
88
+ Permanently open TCP port 80
89
+ firewall-cmd --zone=zone --remove-port=80/tcp --permanent
90
+ …
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 🔧 Available Tools
96
+
97
+ | Tool | Description |
98
+ |------|-------------|
99
+ | `awk` | Column-based text processing |
100
+ | `cat` | Display and concatenate file contents |
101
+ | `chmod` | Change file permissions |
102
+ | `chown` | Change file owner and group |
103
+ | `crontab` | Periodic task scheduling |
104
+ | `curl` | Transfer data with URLs |
105
+ | `cut` | Extract sections from each line |
106
+ | `df` | Display disk space usage |
107
+ | `docker` | Docker container management |
108
+ | `du` | Display directory space usage |
109
+ | `descriptors` | File descriptors and redirections |
110
+ | `find` | Search for files and directories |
111
+ | `firewall-cmd` | Manage the firewalld firewall |
112
+ | `free` | Display system memory usage |
113
+ | `git` | Version control with Git |
114
+ | `grep` | Search for patterns in files |
115
+ | `head` | Display the beginning of a file |
116
+ | `htop` | Interactive process monitor |
117
+ | `ifconfig` | Network interface configuration (legacy) |
118
+ | `ip` | Modern network interface and routing management |
119
+ | `iptables` | Kernel firewall rule management |
120
+ | `jq` | Command-line JSON processor |
121
+ | `logs` | Important log file paths in Linux |
122
+ | `lsblk` | List block devices |
123
+ | `lsof` | List open files by processes |
124
+ | `lxc` | LXC container management |
125
+ | `nc` | TCP/IP Swiss army knife |
126
+ | `netstat` | Network connection statistics |
127
+ | `nmap` | Network and port scanner |
128
+ | `ps` | Information about running processes |
129
+ | `regex` | Regular expression patterns |
130
+ | `rsync` | Efficient file synchronization |
131
+ | `scp` | Secure file copy over SSH |
132
+ | `sed` | Stream text editor |
133
+ | `shortcuts` | Terminal keyboard shortcuts |
134
+ | `sort` | Sort lines of text |
135
+ | `ss` | Socket statistics (replaces netstat) |
136
+ | `ssh` | Secure Shell client |
137
+ | `system` | Basic system commands |
138
+ | `systemctl` | Manage services with systemd |
139
+ | `tail` | Display the end of a file |
140
+ | `tar` | File archiving and compression |
141
+ | `tee` | Read stdin and write to stdout and files |
142
+ | `tmux` | Terminal multiplexer |
143
+ | `top` | Real-time process monitor |
144
+ | `tr` | Translate or delete characters |
145
+ | `uname` | System and kernel information |
146
+ | `uniq` | Filter adjacent duplicate lines |
147
+ | `vim` | Modal terminal text editor |
148
+ | `watch` | Execute a command periodically |
149
+ | `xargs` | Build and execute commands from stdin |
150
+
151
+ ---
152
+
153
+ ## 🧪 Development
154
+
155
+ ```bash
156
+ pip install -e ".[dev]"
157
+ ruff check .
158
+ pytest
159
+ ```
160
+
161
+ Each tool is a small module in `guia_linux/tools/` with a `COMMANDS` list. To add one, copy an existing
162
+ module, register it in `guia_linux/tools/__init__.py`, add it to the table above, and run `pytest` —
163
+ the test suite checks that every entry has both translations and that the README lists every tool.
164
+
165
+ See [CHANGELOG.md](CHANGELOG.md) for release notes.
166
+
167
+ ---
168
+
169
+ ## 📝 License
170
+
171
+ MIT — see [LICENSE](LICENSE).
172
+
173
+ ---
174
+
175
+ ## 💬 Feedback
176
+
177
+ Open an issue or reach out via GitHub.
178
+
179
+ ## 🌐 Connect
180
+
181
+ [![GitHub](https://img.shields.io/badge/GitHub-@serber1990-181717?style=flat-square&logo=github)](https://github.com/serber1990)
@@ -0,0 +1,5 @@
1
+ __version__ = "2.1.0"
2
+
3
+ from guia_linux.cli import main # noqa: E402 (after __version__: cli imports it)
4
+
5
+ __all__ = ["main", "__version__"]
@@ -0,0 +1,3 @@
1
+ from guia_linux.cli import run
2
+
3
+ run()
@@ -1,11 +1,22 @@
1
1
  #!/usr/bin/env python3
2
2
  import argparse
3
+ import os
3
4
  import sys
4
5
  from shellcolorize import Color
6
+ from guia_linux import __version__
5
7
  from guia_linux.tools import TOOLS
6
8
  from guia_linux.utils import search_all, strip_ansi
7
9
 
8
10
 
11
+ def default_lang() -> str:
12
+ """Spanish for es_* locales, English otherwise."""
13
+ for var in ('LC_ALL', 'LC_MESSAGES', 'LANG', 'LANGUAGE'):
14
+ value = os.environ.get(var)
15
+ if value:
16
+ return 'es' if value.lower().startswith('es') else 'en'
17
+ return 'en'
18
+
19
+
9
20
  def _help_header(lang: str) -> None:
10
21
  title = 'Linux Command Reference' if lang == 'en' else 'Guía de Comandos Linux'
11
22
  w = max(46, len(title) + 6)
@@ -13,7 +24,7 @@ def _help_header(lang: str) -> None:
13
24
  print()
14
25
  print(f" {Color.CYAN}╔{border}╗{Color.RESET}")
15
26
  print(f" {Color.CYAN}║{Color.RESET} {Color.BOLD}{Color.CYAN}{title}{Color.RESET}"
16
- + ' ' * max(0, w - len(title) - 2)
27
+ + ' ' * max(0, w - len(title) - 4)
17
28
  + f" {Color.CYAN}║{Color.RESET}")
18
29
  print(f" {Color.CYAN}╚{border}╝{Color.RESET}")
19
30
 
@@ -28,6 +39,7 @@ def _print_help(lang: str) -> None:
28
39
  {Color.GREEN}lh{Color.RESET} <tool> --lang en Force English output
29
40
  {Color.GREEN}lh{Color.RESET} -s <keyword> Search across all tools
30
41
  {Color.GREEN}lh{Color.RESET} -s <keyword> --lang en Search with English descriptions
42
+ {Color.GREEN}lh{Color.RESET} --version Show version
31
43
 
32
44
  {Color.BOLD}Examples{Color.RESET}
33
45
  {Color.GREEN}lh grep{Color.RESET} All grep options
@@ -41,6 +53,7 @@ def _print_help(lang: str) -> None:
41
53
  {Color.GREEN}lh{Color.RESET} <herramienta> --lang es Fuerza salida en español
42
54
  {Color.GREEN}lh{Color.RESET} -s <término> Busca en todas las herramientas
43
55
  {Color.GREEN}lh{Color.RESET} -s <término> --lang en Busca con descripciones en inglés
56
+ {Color.GREEN}lh{Color.RESET} --version Muestra la versión
44
57
 
45
58
  {Color.BOLD}Ejemplos{Color.RESET}
46
59
  {Color.GREEN}lh grep{Color.RESET} Todas las opciones de grep
@@ -71,7 +84,7 @@ def _search(query: str, lang: str) -> None:
71
84
  print()
72
85
  print(f" {Color.CYAN}╔{border}╗{Color.RESET}")
73
86
  print(f" {Color.CYAN}║{Color.RESET} {Color.BOLD}{Color.CYAN}{header}{Color.RESET}"
74
- + ' ' * max(0, w - len(header) - 2)
87
+ + ' ' * max(0, w - len(header) - 4)
75
88
  + f" {Color.CYAN}║{Color.RESET}")
76
89
  print(f" {Color.CYAN}╚{border}╝{Color.RESET}")
77
90
 
@@ -96,15 +109,17 @@ def _search(query: str, lang: str) -> None:
96
109
  print()
97
110
 
98
111
 
99
- def main() -> None:
100
- parser = argparse.ArgumentParser(add_help=False)
112
+ def main(argv=None) -> None:
113
+ parser = argparse.ArgumentParser(prog='lh', add_help=False)
101
114
  parser.add_argument('tool', nargs='?', default=None)
102
115
  parser.add_argument('-s', '--search', metavar='KEYWORD', default=None)
103
- parser.add_argument('--lang', choices=['es', 'en'], default='es')
116
+ parser.add_argument('--lang', choices=['es', 'en'], default=None)
104
117
  parser.add_argument('-h', '--help', action='store_true')
105
- args = parser.parse_args()
118
+ parser.add_argument('-V', '--version', action='version', version=f'lh (linux-commands-guide) {__version__}')
119
+ args = parser.parse_args(argv)
120
+ Color.auto()
106
121
 
107
- lang = args.lang
122
+ lang = args.lang or default_lang()
108
123
 
109
124
  if args.help or (args.tool is None and args.search is None):
110
125
  _print_help(lang)
@@ -119,11 +134,22 @@ def main() -> None:
119
134
  msg = (f"Tool '{args.tool}' not found — run 'lh --help' for the full list."
120
135
  if lang == 'en'
121
136
  else f"Herramienta '{args.tool}' no encontrada — ejecuta 'lh --help' para ver la lista.")
122
- print(f"\n {Color.RED}✖ {msg}{Color.RESET}\n")
137
+ print(f"\n {Color.RED}✖ {msg}{Color.RESET}\n", file=sys.stderr)
123
138
  sys.exit(1)
124
139
 
125
140
  TOOLS[key].show(lang)
126
141
 
127
142
 
143
+ def run() -> None:
144
+ """Console entry point: like main(), but quiet when the output pipe is closed early (| head)."""
145
+ try:
146
+ main()
147
+ sys.stdout.flush()
148
+ except BrokenPipeError:
149
+ devnull = os.open(os.devnull, os.O_WRONLY)
150
+ os.dup2(devnull, sys.stdout.fileno())
151
+ sys.exit(141)
152
+
153
+
128
154
  if __name__ == '__main__':
129
- main()
155
+ run()
@@ -16,11 +16,11 @@ COMMANDS = [
16
16
  {"command": f"{Color.GREEN}cat{Color.RESET} -E filename", "description": "Muestra $ al final de cada línea", "description_en": "Show $ at end of each line"},
17
17
  {"command": f"{Color.GREEN}cat{Color.RESET} -v filename", "description": "Muestra caracteres no imprimibles", "description_en": "Show non-printable characters"},
18
18
  {"command": f"{Color.GREEN}cat{Color.RESET} -A filename", "description": "Muestra todos los caracteres especiales", "description_en": "Show all special characters"},
19
- {"command": f"{Color.GREEN}cat{Color.RESET} -r, --line-range N:M filename", "description": "Muestra solo las líneas N a M (batcat)", "description_en": "Show only lines N to M (batcat)"},
20
- {"command": f"{Color.GREEN}cat{Color.RESET} --theme <theme>", "description": "Establece el tema de resaltado de sintaxis (batcat)", "description_en": "Set syntax-highlighting theme (batcat)"},
21
- {"command": f"{Color.GREEN}cat{Color.RESET} --paging never filename", "description": "Desactiva el paginador en batcat", "description_en": "Disable pager in batcat"},
22
- {"command": f"{Color.GREEN}cat{Color.RESET} -u, --unbuffered", "description": "Desactiva el buffering (compatibilidad POSIX)", "description_en": "Disable buffering (POSIX compatibility)"},
23
- {"command": f"{Color.GREEN}cat{Color.RESET} -L, --list-languages", "description": "Lista los lenguajes soportados para resaltado", "description_en": "List supported syntax-highlighting languages"},
19
+ {"command": f"{Color.GREEN}bat{Color.RESET} -r N:M filename", "description": "Muestra solo las líneas N a M (bat/batcat)", "description_en": "Show only lines N to M (bat/batcat)"},
20
+ {"command": f"{Color.GREEN}bat{Color.RESET} --theme=<theme> filename", "description": "Resalta la sintaxis con el tema indicado (bat)", "description_en": "Highlight syntax with the given theme (bat)"},
21
+ {"command": f"{Color.GREEN}bat{Color.RESET} --paging=never filename", "description": "Muestra el archivo sin paginador (bat)", "description_en": "Print the file without a pager (bat)"},
22
+ {"command": f"{Color.GREEN}cat{Color.RESET} -u filename", "description": "Ignorada por GNU cat (se mantiene por compatibilidad POSIX)", "description_en": "Ignored by GNU cat (kept for POSIX compatibility)"},
23
+ {"command": f"{Color.GREEN}bat{Color.RESET} --list-languages", "description": "Lista los lenguajes con resaltado de sintaxis (bat)", "description_en": "List languages with syntax highlighting (bat)"},
24
24
  ]
25
25
 
26
26
 
@@ -12,7 +12,7 @@ COMMANDS = [
12
12
  {"command": f"{Color.GREEN}chown{Color.RESET} :group filename", "description": "Cambia solo el grupo", "description_en": "Change group only"},
13
13
  {"command": f"{Color.GREEN}chown{Color.RESET} -R user directory", "description": "Cambia propietario recursivamente", "description_en": "Change owner recursively"},
14
14
  {"command": f"{Color.GREEN}chown{Color.RESET} -R user:group directory", "description": "Cambia propietario y grupo recursivamente", "description_en": "Change owner and group recursively"},
15
- {"command": f"{Color.GREEN}chown{Color.RESET} --from=old_user:new_user filename", "description": "Cambia solo si coincide con el propietario actual", "description_en": "Change only if current owner matches"},
15
+ {"command": f"{Color.GREEN}chown{Color.RESET} --from=old_user new_user filename", "description": "Cambia a new_user solo si el propietario actual es old_user", "description_en": "Change owner to new_user only if the current owner is old_user"},
16
16
  {"command": f"{Color.GREEN}chown{Color.RESET} --reference=ref_file filename", "description": "Copia propietario y grupo de otro archivo", "description_en": "Copy owner and group from another file"},
17
17
  ]
18
18
 
@@ -17,7 +17,7 @@ COMMANDS = [
17
17
  {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> promisc", "description": "Activa el modo promiscuo", "description_en": "Enable promiscuous mode"},
18
18
  {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> -promisc", "description": "Desactiva el modo promiscuo", "description_en": "Disable promiscuous mode"},
19
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"},
20
+ {"command": f"{Color.GREEN}ifconfig{Color.RESET} <iface> add <ipv6>/<prefix>", "description": "Añade una dirección IPv6 (en IPv4 se usan alias <iface>:N)", "description_en": "Add an IPv6 address (IPv4 uses <iface>:N aliases)"},
21
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
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
23
  ]
@@ -14,7 +14,7 @@ COMMANDS = [
14
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
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
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"},
17
+ {"command": f"{Color.GREEN}iptables{Color.RESET} -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT", "description": "Permite el tráfico de conexiones ya establecidas", "description_en": "Allow traffic from established connections"},
18
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
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
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"},
@@ -0,0 +1,33 @@
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} -f", "description": "Lista los contenedores con estado, IP y tipo", "description_en": "List containers with state, IP and type"},
11
+ {"command": f"{Color.GREEN}lxc-create{Color.RESET} -n name -t download", "description": "Crea un contenedor desde una imagen (asistente interactivo)", "description_en": "Create a container from an image (interactive)"},
12
+ {"command": f"{Color.GREEN}lxc-create{Color.RESET} -n name -t download -- -d debian -r bookworm -a amd64", "description": "Crea un contenedor Debian sin preguntas", "description_en": "Create a Debian container non-interactively"},
13
+ {"command": f"{Color.GREEN}lxc-start{Color.RESET} -n name", "description": "Inicia un contenedor en segundo plano", "description_en": "Start a container in the background"},
14
+ {"command": f"{Color.GREEN}lxc-stop{Color.RESET} -n name", "description": "Detiene un contenedor", "description_en": "Stop a container"},
15
+ {"command": f"{Color.GREEN}lxc-stop{Color.RESET} -n name -r", "description": "Reinicia un contenedor", "description_en": "Reboot a container"},
16
+ {"command": f"{Color.GREEN}lxc-attach{Color.RESET} -n name", "description": "Abre una shell dentro del contenedor", "description_en": "Open a shell inside the container"},
17
+ {"command": f"{Color.GREEN}lxc-attach{Color.RESET} -n name -- command", "description": "Ejecuta un comando dentro del contenedor", "description_en": "Run a command inside the container"},
18
+ {"command": f"{Color.GREEN}lxc-console{Color.RESET} -n name", "description": "Conecta a la consola (salir: Ctrl+A Q)", "description_en": "Attach to the console (exit: Ctrl+A Q)"},
19
+ {"command": f"{Color.GREEN}lxc-info{Color.RESET} -n name", "description": "Muestra estado, PID, IP y uso de recursos", "description_en": "Show state, PID, IP and resource usage"},
20
+ {"command": f"{Color.GREEN}lxc-freeze{Color.RESET} -n name", "description": "Congela todos los procesos del contenedor", "description_en": "Freeze all processes in the container"},
21
+ {"command": f"{Color.GREEN}lxc-unfreeze{Color.RESET} -n name", "description": "Descongela el contenedor", "description_en": "Unfreeze the container"},
22
+ {"command": f"{Color.GREEN}lxc-copy{Color.RESET} -n name -N new_name", "description": "Clona un contenedor", "description_en": "Clone a container"},
23
+ {"command": f"{Color.GREEN}lxc-snapshot{Color.RESET} -n name", "description": "Crea un snapshot (el contenedor debe estar parado)", "description_en": "Create a snapshot (container must be stopped)"},
24
+ {"command": f"{Color.GREEN}lxc-snapshot{Color.RESET} -n name -L", "description": "Lista los snapshots", "description_en": "List snapshots"},
25
+ {"command": f"{Color.GREEN}lxc-destroy{Color.RESET} -n name", "description": "Elimina un contenedor y su sistema de archivos", "description_en": "Delete a container and its filesystem"},
26
+ {"command": f"{Color.GREEN}lxc-config{Color.RESET} lxc.lxcpath", "description": "Muestra dónde se guardan los contenedores", "description_en": "Show where containers are stored"},
27
+ {"command": f"{Color.GREEN}lxc-checkconfig{Color.RESET}", "description": "Comprueba el soporte del kernel para LXC", "description_en": "Check kernel support for LXC"},
28
+ ]
29
+
30
+
31
+ def show(lang: str = "es") -> None:
32
+ title = TITLE_EN if lang == "en" else TITLE
33
+ print_table(title, COMMANDS, lang)
@@ -7,7 +7,7 @@ BRIEF = "Navaja suiza de TCP/IP"
7
7
  BRIEF_EN = "TCP/IP Swiss army knife"
8
8
 
9
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)"},
10
+ {"command": f"{Color.GREEN}nc{Color.RESET} -l -p <port>", "description": "Escucha en el puerto (netcat tradicional; en OpenBSD: nc -l <port>)", "description_en": "Listen on a port (traditional netcat; OpenBSD: nc -l <port>)"},
11
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
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
13
  {"command": f"{Color.GREEN}nc{Color.RESET} -z <host> 20-80", "description": "Escanea un rango de puertos", "description_en": "Scan a port range"},
@@ -16,7 +16,7 @@ COMMANDS = [
16
16
  {"command": f"{Color.GREEN}nc{Color.RESET} -n", "description": "Omite la resolución DNS", "description_en": "Skip DNS resolution"},
17
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
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"},
19
+ {"command": f"{Color.GREEN}nc{Color.RESET} -e <command>", "description": "Ejecuta un comando tras la conexión (solo netcat tradicional/ncat)", "description_en": "Execute a command after connecting (traditional netcat/ncat only)"},
20
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
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
22
  ]