Skip to content

Commit 7b6eff3

Browse files
committed
docs: add guides for micro, jdupes, and terminal shell tools
1 parent 589468e commit 7b6eff3

File tree

7 files changed

+802
-0
lines changed

7 files changed

+802
-0
lines changed

docs/Development/editors/micro.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
3+
## What is `micro`?
4+
5+
* **Terminal-Based Editor**: Runs inside the terminal, similar to `nano` or `vim`.
6+
* **Modern Features**:
7+
8+
* Syntax highlighting for many programming languages.
9+
* Mouse support in the terminal.
10+
* Undo/redo system.
11+
* Plugin support for extending functionality.
12+
* True Unicode support.
13+
* Multiple cursors and selection.
14+
* **No Configuration Required**: Works out-of-the-box with sensible defaults, unlike `vim` which requires configuration.
15+
* **Cross-Platform**: Linux, macOS, Windows.
16+
17+
---
18+
19+
## How Micro Differs from Nano
20+
21+
| Feature | `micro` | `nano` |
22+
| ----------------------- | ----------------------------- | ------------------------------ |
23+
| **User Interface** | Modern, clean, supports mouse | Simple, minimal, keyboard only |
24+
| **Syntax Highlighting** | Yes, supports many languages | Limited or none by default |
25+
| **Plugins** | Yes, supports extensions | No |
26+
| **Undo/Redo** | Multiple undo/redo | Basic, limited undo only |
27+
| **Unicode Support** | Full | Limited |
28+
| **Multiple Cursors** | Yes | No |
29+
| **Mouse Support** | Yes | Limited |
30+
| **Configuration** | Optional JSON config file | Minimal, through `.nanorc` |
31+
| **Installation Size** | Slightly larger than nano | Very lightweight |
32+
33+
**In short:**
34+
35+
* `nano` is extremely lightweight, very simple, and ideal for quick edits.
36+
* `micro` adds **modern conveniences** (syntax highlighting, plugins, better undo/redo, mouse support) while keeping the simplicity of `nano`. It’s a good choice for users who want a **“nano but smarter”** editor without jumping to `vim` or `emacs`.
37+
38+
---
39+
40+
## Installation
41+
42+
````markdown
43+
=== "Ubuntu / Debian"
44+
45+
```bash
46+
sudo apt update
47+
sudo apt install micro
48+
````
49+
50+
=== "Arch / Manjaro"
51+
52+
```bash
53+
sudo pacman -S micro
54+
```
55+
56+
=== "Fedora"
57+
58+
```bash
59+
sudo dnf install micro
60+
```
61+
62+
=== "openSUSE"
63+
64+
```bash
65+
sudo zypper install micro
66+
```
67+
68+
````
69+
70+
---
71+
72+
## Basic Usage
73+
74+
- Open a file:
75+
76+
```bash
77+
micro filename.txt
78+
````
79+
80+
* **Common shortcuts** (displayed at the bottom of the screen):
81+
82+
* `Ctrl+S` → Save
83+
* `Ctrl+Q` → Quit
84+
* `Ctrl+C` → Copy
85+
* `Ctrl+V` → Paste
86+
* `Ctrl+Z` → Undo
87+
* `Ctrl+Shift+Z` → Redo
88+
* `Alt+Arrow` → Move cursor by words
89+
* Plugins and configurations are stored in:
90+
91+
```text
92+
~/.config/micro
93+
```
94+
95+
* Install plugins via:
96+
97+
```bash
98+
micro -plugin install <plugin-name>
99+
```
100+

docs/Terminal/cli-tool/jdupes.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
2+
3+
## What is `jdupes`?
4+
5+
* **Duplicate Finder**: Scans directories to detect files that are **byte-for-byte identical**.
6+
* **High Performance**: Optimized for speed and low memory usage; can handle millions of files.
7+
* **Flexible**: Supports options for listing, deleting, or replacing duplicates with hard links.
8+
* **Safe**: Provides interactive and batch modes to prevent accidental deletion.
9+
* **Cross-platform**: Works on Linux, Windows, and macOS.
10+
11+
---
12+
13+
## Installation
14+
15+
````markdown
16+
=== "Ubuntu / Debian"
17+
18+
```bash
19+
sudo apt update
20+
sudo apt install jdupes
21+
````
22+
23+
=== "Arch / Manjaro"
24+
25+
```bash
26+
sudo pacman -S jdupes
27+
```
28+
29+
=== "Fedora"
30+
31+
```bash
32+
sudo dnf install jdupes
33+
```
34+
35+
=== "openSUSE"
36+
37+
```bash
38+
sudo zypper install jdupes
39+
```
40+
41+
````
42+
43+
> On some distributions, `jdupes` might need to be installed from source or a repository if not available in the default package manager.
44+
45+
---
46+
47+
## How to Use `jdupes`
48+
49+
### 1. Basic Duplicate Scan
50+
51+
```bash
52+
jdupes /path/to/directory
53+
````
54+
55+
* Lists all duplicate files in the directory and subdirectories.
56+
57+
### 2. Scan Multiple Directories
58+
59+
```bash
60+
jdupes /dir1 /dir2 /dir3
61+
```
62+
63+
* Finds duplicates across multiple paths.
64+
65+
### 3. Recursively Scan
66+
67+
```bash
68+
jdupes -r /path/to/directory
69+
```
70+
71+
* `-r` enables recursive scanning of all subdirectories.
72+
73+
### 4. Show Only Duplicates
74+
75+
```bash
76+
jdupes -1 /path/to/directory
77+
```
78+
79+
* `-1` prints only files that have duplicates, one per line.
80+
81+
### 5. Delete Duplicates Interactively
82+
83+
```bash
84+
jdupes -d /path/to/directory
85+
```
86+
87+
* Prompts you to select which duplicates to keep or delete.
88+
* **Use with caution**; it will delete files permanently if confirmed.
89+
90+
### 6. Replace Duplicates with Hard Links
91+
92+
```bash
93+
jdupes -L /path/to/directory
94+
```
95+
96+
* Deletes duplicates and replaces them with hard links, saving disk space without losing file access.
97+
98+
### 7. Save Output to a File
99+
100+
```bash
101+
jdupes -r /path/to/directory > duplicates.txt
102+
```
103+
104+
* Useful for reviewing duplicates before taking action.
105+
106+
### 8. Advanced Options
107+
108+
* `-S` → Show size of duplicate sets.
109+
* `-A` → Ignore empty files.
110+
* `-Q` → Quiet mode, minimal output.
111+
* `--nohidden` → Skip hidden files and directories.
112+
113+
---
114+
115+
### Practical Use Cases
116+
117+
1. **Disk Cleanup**: Identify and remove duplicate media, documents, or backups.
118+
2. **Backup Optimization**: Avoid storing multiple copies of the same file.
119+
3. **Automated Scripts**: Integrate into cron jobs to maintain clean directories.
120+
4. **File System Analysis**: Quickly assess how much space duplicates occupy.
121+

docs/Terminal/shell/apt-file.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
2+
## What is `apt-file`?
3+
4+
* `apt-file` queries the **Debian package database** to locate files contained in packages.
5+
* Unlike `dpkg -L`, which only works for **installed packages**, `apt-file` can search **all available packages in the repositories**.
6+
* Helps find:
7+
8+
* Which package provides a particular executable, library, or config file.
9+
* Files in development packages (`-dev`) for compiling software.
10+
* Missing headers or libraries when compiling from source.
11+
12+
---
13+
14+
## Installation
15+
16+
````markdown
17+
=== "Ubuntu / Debian"
18+
19+
```bash
20+
sudo apt update
21+
sudo apt install apt-file
22+
````
23+
24+
=== "Arch / Manjaro"
25+
26+
```bash
27+
sudo pacman -S apt-file
28+
```
29+
30+
=== "Fedora"
31+
32+
```bash
33+
sudo dnf install apt-file
34+
```
35+
36+
=== "openSUSE"
37+
38+
```bash
39+
sudo zypper install apt-file
40+
```
41+
42+
````
43+
44+
After installation, **update the package index**:
45+
46+
```bash
47+
sudo apt-file update
48+
````
49+
50+
This downloads the latest database of files in packages from the repositories.
51+
52+
---
53+
54+
## How to Use `apt-file`
55+
56+
### 1. Search for a File Across All Packages
57+
58+
```bash
59+
apt-file search filename
60+
```
61+
62+
Example:
63+
64+
```bash
65+
apt-file search /usr/bin/git
66+
```
67+
68+
* Lists all packages that provide `/usr/bin/git`.
69+
70+
### 2. List Contents of a Package (Even If Not Installed)
71+
72+
```bash
73+
apt-file list package_name
74+
```
75+
76+
Example:
77+
78+
```bash
79+
apt-file list curl
80+
```
81+
82+
* Shows all files installed by the `curl` package.
83+
84+
### 3. Update the `apt-file` Database
85+
86+
```bash
87+
sudo apt-file update
88+
```
89+
90+
* Must be done periodically to get the latest repository information.
91+
92+
### 4. Search with Wildcards or Patterns
93+
94+
```bash
95+
apt-file search '*/libssl*.so'
96+
```
97+
98+
* Useful for locating libraries, headers, or other files using patterns.
99+
100+
### 5. Advanced Usage
101+
102+
* **Search only installed packages**:
103+
104+
```bash
105+
dpkg -S filename
106+
```
107+
108+
* **Search for executables in PATH using apt-file**:
109+
110+
```bash
111+
apt-file search bin/program_name
112+
```
113+
114+
* **Combine with grep for filtering**:
115+
116+
```bash
117+
apt-file search program | grep 'bin'
118+
```
119+
120+
---
121+
122+
### Practical Examples
123+
124+
1. **Finding Development Headers**
125+
126+
```bash
127+
apt-file search zlib.h
128+
```
129+
130+
* Tells you which `-dev` package contains `zlib.h` so you can install it for compilation.
131+
132+
2. **Troubleshooting Missing Binaries**
133+
134+
```bash
135+
apt-file search /usr/bin/htop
136+
```
137+
138+
* If `htop` isn’t installed, you’ll see which package provides it (`htop` package).
139+
140+
3. **Locating Configuration Files**
141+
142+
```bash
143+
apt-file search /etc/nginx/nginx.conf
144+
```
145+
146+
* Shows which package provides the configuration file.
147+
148+
---
149+

0 commit comments

Comments
 (0)