Skip to content

Commit b33c05d

Browse files
committed
Add new one liners
1 parent 07bfe3e commit b33c05d

19 files changed

Lines changed: 1722 additions & 2 deletions

File tree

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/IconResources.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ fun BasicCategory.getIconResource(): Int = when (title) {
148148
"Input" -> R.drawable.ic_icon_mouse
149149
"JSON" -> R.drawable.ic_icon_json
150150
"Fun" -> R.drawable.ic_icon_fun
151-
"Coding Agents" -> R.drawable.ic_agent
151+
"Coding agents" -> R.drawable.ic_agent
152152
else -> R.drawable.ic_icon_mouse
153153
}

assets/basics/codingagents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Coding Agents
1+
# Coding agents
22

33
## CLI
44
```[claude](/man/claude)```

assets/basics/oneliners.md

Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
# One-liners
2+
3+
## Run the previous command with sudo
4+
```[sudo](/man/sudo) !!```
5+
6+
## Spin up a local HTTP server
7+
```[python3](/man/python3) -m http.server 8000```
8+
9+
## Play ASCII Star Wars
10+
```[telnet](/man/telnet) towel.blinkenlights.nl```
11+
12+
## Play a video in terminal
13+
```[mplayer](/man/mplayer) -vo caca video.mp4```
14+
15+
## Display system information beautifully
16+
```[screenfetch](/man/screenfetch) or [neofetch](/man/neofetch)```
17+
18+
## Display fortune and cow
19+
```[fortune](/man/fortune) | [cowsay](/man/cowsay)```
20+
21+
## Simulate slow typing
22+
```echo "text" | [pv](/man/pv) -qL 10```
23+
24+
## Matrix digital rain
25+
```[cmatrix](/man/cmatrix)```
26+
27+
## Create 100 numbered directories
28+
```[mkdir](/man/mkdir) project{01..100}```
29+
30+
## Change to the previous directory
31+
```[cd](/man/cd) -```
32+
33+
## Quickly backup a file
34+
```[cp](/man/cp) file{,.bak}```
35+
36+
## Fix typo in the previous command
37+
```^wrong^correct^```
38+
39+
## Get your public IP address
40+
```[curl](/man/curl) ifconfig.me```
41+
42+
## Repeat the last command
43+
```!!```
44+
45+
## Edit current command line in your editor
46+
```Ctrl+X Ctrl+E```
47+
48+
## Pretty-print JSON from stdin
49+
```[jq](/man/jq) .```
50+
51+
## Find largest files/directories in current directory
52+
```[du](/man/du) -h . | [sort](/man/sort) -hr | head -20```
53+
54+
## Show disk usage in human-readable format
55+
```[df](/man/df) -h```
56+
57+
## Show directory sizes sorted
58+
```[du](/man/du) -sh * | [sort](/man/sort) -hr```
59+
60+
## Create a tar.gz backup
61+
```[tar](/man/tar) czf backup.tar.gz directory/```
62+
63+
## Extract a tar.gz archive
64+
```[tar](/man/tar) xzf archive.tar.gz```
65+
66+
## Watch command output refresh every 2 seconds
67+
```[watch](/man/watch) command```
68+
69+
## Kill process by name
70+
```[pkill](/man/pkill) process_name```
71+
72+
## View processes sorted by CPU
73+
```[top](/man/top)```
74+
75+
## List open network ports
76+
```[ss](/man/ss) -tuln```
77+
78+
## Generate random password
79+
```< /dev/urandom [tr](/man/tr) -dc A-Za-z0-9 | head -c 32; echo```
80+
81+
## Search command history interactively
82+
```Ctrl+R```
83+
84+
## Count lines in a file
85+
```[wc](/man/wc) -l file.txt```
86+
87+
## Remove duplicate lines
88+
```[sort](/man/sort) file | [uniq](/man/uniq)```
89+
90+
## Find files by name
91+
```[find](/man/find) . -name "*.log"```
92+
93+
## Find files larger than 100MB
94+
```[find](/man/find) . -type f -size +100M```
95+
96+
## Copy with progress bar
97+
```[rsync](/man/rsync) -ah --progress src dest```
98+
99+
## Download file with resume
100+
```[wget](/man/wget) -c url```
101+
102+
## Mount remote directory over SSH
103+
```[sshfs](/man/sshfs) user@host:/remote /local```
104+
105+
## Check if command exists
106+
```command -v cmd >/dev/null && echo yes```
107+
108+
## List files by modification time
109+
```[ls](/man/ls) -lt```
110+
111+
## Grep recursively ignoring case
112+
```[grep](/man/grep) -ir "text" .```
113+
114+
## Empty/truncate a file
115+
```> file.txt```
116+
117+
## Create directory and cd into it
118+
```[mkdir](/man/mkdir) dir && [cd](/man/cd) dir```
119+
120+
## Compress with bzip2
121+
```[tar](/man/tar) cjf archive.tar.bz2 dir/```
122+
123+
## Show weather in terminal
124+
```[curl](/man/curl) wttr.in```
125+
126+
## Get full weather report
127+
```[curl](/man/curl) v2.wttr.in```
128+
129+
## Pretty-print XML
130+
```[xmllint](/man/xmllint) --format file.xml```
131+
132+
## Convert image to different format
133+
```[convert](/man/convert) input.jpg output.png```
134+
135+
## Create animated GIF from images
136+
```[convert](/man/convert) -delay 10 -loop 0 *.png animation.gif```
137+
138+
## Run the train animation
139+
```[sl](/man/sl)```
140+
141+
## Display system info with ASCII art
142+
```[neofetch](/man/neofetch)```
143+
144+
## Monitor file changes
145+
```[tail](/man/tail) -f logfile```
146+
147+
## Search and replace in files
148+
```[sed](/man/sed) -i 's/old/new/g' *.txt```
149+
150+
## Show only directories
151+
```[ls](/man/ls) -d */```
152+
153+
## Tree view of directory
154+
```[tree](/man/tree)```
155+
156+
## Pipe output to clipboard
157+
```command | [xclip](/man/xclip) -sel clip```
158+
159+
## Create symlink
160+
```[ln](/man/ln) -s target link```
161+
162+
## Show current git branch
163+
```[git](/man/git) branch --show-current```
164+
165+
## Delete files older than 30 days
166+
```[find](/man/find) . -mtime +30 -delete```
167+
168+
## Find and delete empty directories
169+
```[find](/man/find) . -type d -empty -delete```
170+
171+
## Show calendar
172+
```[cal](/man/cal)```
173+
174+
## Show colorful calendar
175+
```[cal](/man/cal) -3```
176+
177+
## Generate QR code
178+
```[qrencode](/man/qrencode) -t ANSI "text"```
179+
180+
## Record terminal session
181+
```[script](/man/script) session.log```
182+
183+
## Replay terminal session
184+
```[scriptreplay](/man/scriptreplay) -t timing.log session.log```
185+
186+
## Check battery percentage
187+
```[upower](/man/upower) -i $(upower -e | grep BAT) | grep percentage```
188+
189+
## Monitor CPU temperature
190+
```[sensors](/man/sensors)```
191+
192+
## List cron jobs
193+
```[crontab](/man/crontab) -l```
194+
195+
## Encrypt file with gpg
196+
```[gpg](/man/gpg) -c file```
197+
198+
## Create RAM disk
199+
```[mount](/man/mount) -t tmpfs -o size=1G tmpfs /mnt/ram```
200+
201+
## Run command in background
202+
```command &```
203+
204+
## Run detached from terminal
205+
```[nohup](/man/nohup) command &```
206+
207+
## Split large file
208+
```[split](/man/split) -b 1G largefile part-```
209+
210+
## Reassemble split files
211+
```[cat](/man/cat) part-* > largefile```
212+
213+
## Check file checksum
214+
```[sha256sum](/man/sha256sum) file```
215+
216+
## Download YouTube video
217+
```[yt-dlp](/man/yt-dlp) url```
218+
219+
## Play YouTube video in terminal
220+
```[mpv](/man/mpv) url```
221+
222+
## Show file with line numbers
223+
```[nl](/man/nl) file.txt```
224+
225+
## Convert DOS to Unix line endings
226+
```[dos2unix](/man/dos2unix) file```
227+
228+
## Reload shell configuration
229+
```source ~/.bashrc```
230+
231+
## Check system uptime
232+
```[uptime](/man/uptime)```
233+
234+
## Progress bar for any command
235+
```command | [pv](/man/pv) -s $(du -b input | cut -f1)```
236+
237+
## View PDF in terminal
238+
```[pdftotext](/man/pdftotext) file.pdf - | [less](/man/less)```
239+
240+
## Burn ISO to USB
241+
```[dd](/man/dd) if=iso.iso of=/dev/sdX bs=4M status=progress```
242+
243+
## Securely wipe drive
244+
```[dd](/man/dd) if=/dev/urandom of=/dev/sdX```
245+
246+
## List hardware info
247+
```[lshw](/man/lshw) -short```
248+
249+
## Disk speed test
250+
```[dd](/man/dd) if=/dev/zero of=test bs=1G count=1 oflag=dsync```
251+
252+
## Play beep
253+
```echo -e "\a"```
254+
255+
## Show current timezone
256+
```[timedatectl](/man/timedatectl)```
257+
258+
## Fireworks animation
259+
```for i in {1..50}; do echo -e "\e[${((RANDOM%7+31))}m✨\e[0m"; sleep 0.1; done```
260+
261+
## Rainbow text
262+
```echo "text" | [lolcat](/man/lolcat)```
263+
264+
## Display clock in terminal
265+
```[watch](/man/watch) -n 1 date```
266+
267+
## Count files in directory
268+
```[ls](/man/ls) | [wc](/man/wc) -l```
269+
270+
## Find broken symlinks
271+
```[find](/man/find) . -type l -! -exec test -e {} \; -print```
272+
273+
## Quick HTTP server in Ruby
274+
```[ruby](/man/ruby) -run -e httpd . -p 8000```
275+
276+
## Quick HTTP server in PHP
277+
```[php](/man/php) -S localhost:8000```
278+
279+
## Quick HTTP server in Node.js
280+
```[npx](/man/npx) http-server```
281+
282+
## Alias to repeat last command
283+
```alias r='fc -s'```
284+
285+
## Show most used commands
286+
```history | awk '{print $2}' | sort | uniq -c | sort -nr | head```
287+
288+
## Extract any archive
289+
```a() { case $1 in *.tar.gz) tar xzf $1;; *.zip) unzip $1;; esac; }; a file```
290+
291+
## Create sparse 10GB file
292+
```[truncate](/man/truncate) -s 10G file.img```
293+
294+
## Merge multiple PDFs
295+
```[gs](/man/gs) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf```
296+
297+
## Convert video to GIF
298+
```[ffmpeg](/man/ffmpeg) -i input.mp4 output.gif```
299+
300+
## Batch rename files
301+
```for f in *.txt; do mv "$f" "${f%.txt}.bak"; done```
302+
303+
## Show git status nicely
304+
```[git](/man/git) status -sb```
305+
306+
## One-liner web server in bash
307+
```while true; do echo -e "HTTP/1.1 200 OK\n\n$(date)" | nc -l 8080; done```

assets/commands/clear.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# TLDR
2+
3+
**Clear the terminal screen**
4+
5+
```clear```
6+
7+
**Clear and reset scrollback buffer**
8+
9+
```clear -x```
10+
11+
**Clear for a specific terminal type**
12+
13+
```clear -T [xterm-256color]```
14+
15+
**Alternative using ANSI escape codes**
16+
17+
```printf '\033[2J\033[H'```
18+
19+
# SYNOPSIS
20+
21+
**clear** [_-Ttype_] [_-V_] [_-x_]
22+
23+
# PARAMETERS
24+
25+
**-T** _type_
26+
> Specify the terminal type to use instead of $TERM
27+
28+
**-V**
29+
> Print version information and exit
30+
31+
**-x**
32+
> Don't attempt to clear the terminal's scrollback buffer
33+
34+
# DESCRIPTION
35+
36+
**clear** clears the terminal screen if this is possible, including its scrollback buffer (if the extended E3 capability is defined). It looks in the environment for the terminal type given by the environment variable TERM and then queries the terminfo database to determine how to clear the screen.
37+
38+
The command outputs escape sequences that instruct the terminal emulator to clear the visible screen area and, by default, the scrollback buffer as well. This is equivalent to pressing Ctrl+L in many shells, though Ctrl+L typically only clears the visible portion without affecting scrollback.
39+
40+
The clear command is useful for privacy (removing sensitive output from view), reducing visual clutter during long terminal sessions, and resetting the terminal to a known state.
41+
42+
# CAVEATS
43+
44+
Not all terminals support clearing the scrollback buffer; in such cases only the visible screen is cleared. The behavior depends on the terminal emulator's implementation of the clear sequence. In some configurations, Ctrl+L provides similar functionality but may behave differently regarding scrollback. The cleared content is not securely erased from memory; for sensitive data, consider closing the terminal entirely.
45+
46+
# HISTORY
47+
48+
The **clear** command has been part of Unix systems since the early days, originating from the **termcap** library system for terminal-independent screen handling. The modern implementation is part of the **ncurses** package, which provides terminal handling capabilities for Unix-like systems. The command has remained essentially unchanged in functionality over the decades, though the underlying terminal handling mechanisms have evolved from termcap to terminfo.
49+
50+
# SEE ALSO
51+
52+
[reset](/man/reset)(1), [tput](/man/tput)(1), [stty](/man/stty)(1), [tty](/man/tty)(1)

0 commit comments

Comments
 (0)