linux-commands-guide 2.0.0__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.
- linux_commands_guide-2.1.0/LICENSE +21 -0
- linux_commands_guide-2.1.0/PKG-INFO +208 -0
- linux_commands_guide-2.1.0/README.md +181 -0
- linux_commands_guide-2.1.0/guia_linux/__init__.py +5 -0
- linux_commands_guide-2.1.0/guia_linux/__main__.py +3 -0
- linux_commands_guide-2.1.0/guia_linux/cli.py +155 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/cat.py +5 -5
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/chown.py +1 -1
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/ifconfig.py +1 -1
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/iptables.py +1 -1
- linux_commands_guide-2.1.0/guia_linux/tools/lxc.py +33 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/nc.py +2 -2
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/regex.py +5 -5
- linux_commands_guide-2.1.0/guia_linux/tools/rsync.py +27 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/tmux.py +2 -2
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/xargs.py +1 -1
- linux_commands_guide-2.1.0/guia_linux/utils.py +99 -0
- linux_commands_guide-2.1.0/linux_commands_guide.egg-info/PKG-INFO +208 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/SOURCES.txt +4 -1
- linux_commands_guide-2.1.0/linux_commands_guide.egg-info/entry_points.txt +2 -0
- linux_commands_guide-2.1.0/linux_commands_guide.egg-info/requires.txt +5 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/pyproject.toml +26 -6
- linux_commands_guide-2.1.0/tests/test_guide.py +83 -0
- linux_commands_guide-2.0.0/PKG-INFO +0 -147
- linux_commands_guide-2.0.0/README.md +0 -130
- linux_commands_guide-2.0.0/guia_linux/__init__.py +0 -4
- linux_commands_guide-2.0.0/guia_linux/cli.py +0 -89
- linux_commands_guide-2.0.0/guia_linux/tools/lxc.py +0 -24
- linux_commands_guide-2.0.0/guia_linux/tools/rsync.py +0 -27
- linux_commands_guide-2.0.0/guia_linux/utils.py +0 -59
- linux_commands_guide-2.0.0/linux_commands_guide.egg-info/PKG-INFO +0 -147
- linux_commands_guide-2.0.0/linux_commands_guide.egg-info/entry_points.txt +0 -2
- linux_commands_guide-2.0.0/linux_commands_guide.egg-info/requires.txt +0 -1
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/__init__.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/awk.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/chmod.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/crontab.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/curl.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/cut.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/df.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/docker.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/du.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/file_descriptors.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/find.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/firewall_cmd.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/free.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/git.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/grep.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/head.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/htop.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/ip.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/jq.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/logs.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/lsblk.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/lsof.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/netstat.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/nmap.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/ps.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/scp.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/sed.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/shortcuts.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/sort.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/ss.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/ssh.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/system.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/systemctl.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/tail.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/tar.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/tee.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/top.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/tr.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/uname.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/uniq.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/vim.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/guia_linux/tools/watch.py +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/dependency_links.txt +0 -0
- {linux_commands_guide-2.0.0 → linux_commands_guide-2.1.0}/linux_commands_guide.egg-info/top_level.txt +0 -0
- {linux_commands_guide-2.0.0 → 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
|
+
[](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml)
|
|
31
|
+
[](https://badge.fury.io/py/linux-commands-guide)
|
|
32
|
+
[](LICENSE)
|
|
33
|
+
[](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
|
+
[](https://github.com/serber1990)
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# linux-commands-guide — `lh`
|
|
2
|
+
|
|
3
|
+
[](https://github.com/serber1990/linux-commands-guide/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/py/linux-commands-guide)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](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
|
+
[](https://github.com/serber1990)
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import argparse
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
from shellcolorize import Color
|
|
6
|
+
from guia_linux import __version__
|
|
7
|
+
from guia_linux.tools import TOOLS
|
|
8
|
+
from guia_linux.utils import search_all, strip_ansi
|
|
9
|
+
|
|
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
|
+
|
|
20
|
+
def _help_header(lang: str) -> None:
|
|
21
|
+
title = 'Linux Command Reference' if lang == 'en' else 'Guía de Comandos Linux'
|
|
22
|
+
w = max(46, len(title) + 6)
|
|
23
|
+
border = '═' * w
|
|
24
|
+
print()
|
|
25
|
+
print(f" {Color.CYAN}╔{border}╗{Color.RESET}")
|
|
26
|
+
print(f" {Color.CYAN}║{Color.RESET} {Color.BOLD}{Color.CYAN}{title}{Color.RESET}"
|
|
27
|
+
+ ' ' * max(0, w - len(title) - 4)
|
|
28
|
+
+ f" {Color.CYAN}║{Color.RESET}")
|
|
29
|
+
print(f" {Color.CYAN}╚{border}╝{Color.RESET}")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _print_help(lang: str) -> None:
|
|
33
|
+
_help_header(lang)
|
|
34
|
+
|
|
35
|
+
if lang == 'en':
|
|
36
|
+
print(f"""
|
|
37
|
+
{Color.BOLD}Usage{Color.RESET}
|
|
38
|
+
{Color.GREEN}lh{Color.RESET} <tool> Show commands for a tool
|
|
39
|
+
{Color.GREEN}lh{Color.RESET} <tool> --lang en Force English output
|
|
40
|
+
{Color.GREEN}lh{Color.RESET} -s <keyword> Search across all tools
|
|
41
|
+
{Color.GREEN}lh{Color.RESET} -s <keyword> --lang en Search with English descriptions
|
|
42
|
+
{Color.GREEN}lh{Color.RESET} --version Show version
|
|
43
|
+
|
|
44
|
+
{Color.BOLD}Examples{Color.RESET}
|
|
45
|
+
{Color.GREEN}lh grep{Color.RESET} All grep options
|
|
46
|
+
{Color.GREEN}lh --lang en docker{Color.RESET} Docker commands in English
|
|
47
|
+
{Color.GREEN}lh -s recursive{Color.RESET} Find every command mentioning "recursive"
|
|
48
|
+
""")
|
|
49
|
+
else:
|
|
50
|
+
print(f"""
|
|
51
|
+
{Color.BOLD}Uso{Color.RESET}
|
|
52
|
+
{Color.GREEN}lh{Color.RESET} <herramienta> Muestra comandos de una herramienta
|
|
53
|
+
{Color.GREEN}lh{Color.RESET} <herramienta> --lang es Fuerza salida en español
|
|
54
|
+
{Color.GREEN}lh{Color.RESET} -s <término> Busca en todas las herramientas
|
|
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
|
|
57
|
+
|
|
58
|
+
{Color.BOLD}Ejemplos{Color.RESET}
|
|
59
|
+
{Color.GREEN}lh grep{Color.RESET} Todas las opciones de grep
|
|
60
|
+
{Color.GREEN}lh --lang en docker{Color.RESET} Comandos docker en inglés
|
|
61
|
+
{Color.GREEN}lh -s recursivo{Color.RESET} Busca comandos con "recursivo"
|
|
62
|
+
""")
|
|
63
|
+
|
|
64
|
+
label = 'Tool' if lang == 'en' else 'Herramienta'
|
|
65
|
+
desc = 'Description' if lang == 'en' else 'Descripción'
|
|
66
|
+
print(f" {Color.BOLD}{Color.GREEN}{label:<18}{desc}{Color.RESET}")
|
|
67
|
+
print(f" {Color.DIM}{'─' * 60}{Color.RESET}")
|
|
68
|
+
for name, module in sorted(TOOLS.items()):
|
|
69
|
+
brief = getattr(module, 'BRIEF_EN' if lang == 'en' else 'BRIEF', '')
|
|
70
|
+
print(f" {Color.GREEN}{name:<18}{Color.RESET}{Color.DIM}{brief}{Color.RESET}")
|
|
71
|
+
print()
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _search(query: str, lang: str) -> None:
|
|
75
|
+
results = search_all(query, TOOLS, lang)
|
|
76
|
+
desc_key = 'description_en' if lang == 'en' else 'description'
|
|
77
|
+
|
|
78
|
+
w = 50
|
|
79
|
+
border = '═' * w
|
|
80
|
+
header = f"Search: {query}" if lang == 'en' else f"Búsqueda: {query}"
|
|
81
|
+
count = f'{len(results)} result{"s" if len(results) != 1 else ""}' if lang == 'en' \
|
|
82
|
+
else f'{len(results)} resultado{"s" if len(results) != 1 else ""}'
|
|
83
|
+
|
|
84
|
+
print()
|
|
85
|
+
print(f" {Color.CYAN}╔{border}╗{Color.RESET}")
|
|
86
|
+
print(f" {Color.CYAN}║{Color.RESET} {Color.BOLD}{Color.CYAN}{header}{Color.RESET}"
|
|
87
|
+
+ ' ' * max(0, w - len(header) - 4)
|
|
88
|
+
+ f" {Color.CYAN}║{Color.RESET}")
|
|
89
|
+
print(f" {Color.CYAN}╚{border}╝{Color.RESET}")
|
|
90
|
+
|
|
91
|
+
if not results:
|
|
92
|
+
msg = f"No results for '{query}'" if lang == 'en' else f"Sin resultados para '{query}'"
|
|
93
|
+
print(f"\n {Color.DIM}{msg}{Color.RESET}\n")
|
|
94
|
+
return
|
|
95
|
+
|
|
96
|
+
print(f"\n {Color.DIM}{count}{Color.RESET}\n")
|
|
97
|
+
|
|
98
|
+
current_tool = None
|
|
99
|
+
for tool_name, entry in results:
|
|
100
|
+
if tool_name != current_tool:
|
|
101
|
+
print(f" {Color.CYAN}▶ {Color.BOLD}{tool_name}{Color.RESET}")
|
|
102
|
+
current_tool = tool_name
|
|
103
|
+
display = strip_ansi(str(
|
|
104
|
+
entry.get('command') or entry.get('logfile') or entry.get('pattern') or ''
|
|
105
|
+
))
|
|
106
|
+
desc = entry.get(desc_key, '')
|
|
107
|
+
print(f" {Color.GREEN}{display}{Color.RESET}")
|
|
108
|
+
print(f" {Color.DIM}{desc}{Color.RESET}")
|
|
109
|
+
print()
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def main(argv=None) -> None:
|
|
113
|
+
parser = argparse.ArgumentParser(prog='lh', add_help=False)
|
|
114
|
+
parser.add_argument('tool', nargs='?', default=None)
|
|
115
|
+
parser.add_argument('-s', '--search', metavar='KEYWORD', default=None)
|
|
116
|
+
parser.add_argument('--lang', choices=['es', 'en'], default=None)
|
|
117
|
+
parser.add_argument('-h', '--help', action='store_true')
|
|
118
|
+
parser.add_argument('-V', '--version', action='version', version=f'lh (linux-commands-guide) {__version__}')
|
|
119
|
+
args = parser.parse_args(argv)
|
|
120
|
+
Color.auto()
|
|
121
|
+
|
|
122
|
+
lang = args.lang or default_lang()
|
|
123
|
+
|
|
124
|
+
if args.help or (args.tool is None and args.search is None):
|
|
125
|
+
_print_help(lang)
|
|
126
|
+
return
|
|
127
|
+
|
|
128
|
+
if args.search:
|
|
129
|
+
_search(args.search, lang)
|
|
130
|
+
return
|
|
131
|
+
|
|
132
|
+
key = args.tool.lower()
|
|
133
|
+
if key not in TOOLS:
|
|
134
|
+
msg = (f"Tool '{args.tool}' not found — run 'lh --help' for the full list."
|
|
135
|
+
if lang == 'en'
|
|
136
|
+
else f"Herramienta '{args.tool}' no encontrada — ejecuta 'lh --help' para ver la lista.")
|
|
137
|
+
print(f"\n {Color.RED}✖ {msg}{Color.RESET}\n", file=sys.stderr)
|
|
138
|
+
sys.exit(1)
|
|
139
|
+
|
|
140
|
+
TOOLS[key].show(lang)
|
|
141
|
+
|
|
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
|
+
|
|
154
|
+
if __name__ == '__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}
|
|
20
|
-
{"command": f"{Color.GREEN}
|
|
21
|
-
{"command": f"{Color.GREEN}
|
|
22
|
-
{"command": f"{Color.GREEN}cat{Color.RESET} -u
|
|
23
|
-
{"command": f"{Color.GREEN}
|
|
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
|
|
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 <
|
|
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
|
|
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"},
|