Useful linux command line tools - Part2
TLDR
The tldr-pages project is a collection of community-maintained help pages for command-line tools, that aims to be a simpler, more approachable complement to traditional man pages.
Installation
sudo apt install tldr
Examples
tldr tar
tar
Archiving utility.Often combined with a compression method, such as gzip or bzip2.More information: https://www.gnu.org/software/tar.
- [c]reate an archive and write it to a [f]ile:
tar cf {{target.tar}} {{file1}} {{file2}} {{file3}}
- [c]reate a g[z]ipped archive and write it to a [f]ile:
tar czf {{target.tar.gz}} {{file1}} {{file2}} {{file3}}
- [c]reate a g[z]ipped archive from a directory using relative paths:
tar czf {{target.tar.gz}} --directory={{path/to/directory}} .
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
tar xvf {{source.tar[.gz|.bz2|.xz]}}
- E[x]tract a (compressed) archive [f]ile into the target directory:
tar xf {{source.tar[.gz|.bz2|.xz]}} --directory={{path/to/directory}}
- [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program:
tar caf {{target.tar.xz}} {{file1}} {{file2}} {{file3}}
- Lis[t] the contents of a tar [f]ile [v]erbosely:
tar tvf {{source.tar}}
- E[x]tract files matching a pattern from an archive [f]ile:
tar xf {{source.tar}} --wildcards "{{*.html}}"
SCC
SCC is a tool similar to cloc, sloccount and tokei. For counting physical the lines of code, blank lines, comment lines, and physical lines of source code in many programming languages.
Installation
wget https://github.com/boyter/scc/releases/download/v3.1.0/scc_3.1.0_Linux_x86_64.tar.gz
tar -xvzf scc_3.1.0_Linux_x86_64.tar.gz
chmod +x scc
sudo mv scc /usr/local/bin/
Example
scc
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
JSX 16 1386 109 0 1277 28
JavaScript 7 425 24 12 389 1
JSON 5 15185 0 0 15185 0
SVG 4 11 0 0 11 0
CSS 2 51 7 0 44 0
Markdown 1 42 16 0 26 0
XML 1 1284 80 0 1204 0
gitignore 1 36 9 10 17 0
───────────────────────────────────────────────────────────────────────────────
Total 37 18420 245 22 18153 29
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $566,880
Estimated Schedule Effort (organic) 11.09 months
Estimated People Required (organic) 4.54
───────────────────────────────────────────────────────────────────────────────
Processed 971789 bytes, 0.972 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
DUF
DUF is a Disk Usage/Free Utility - a better 'df' alternative.
Installation
wget https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_x86_64.tar.gz
tar -xvzf duf_0.8.1_linux_x86_64.tar.gz
chmod +x duf
sudo mv duf /usr/local/bin/
Example
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 2 local devices │
├────────────┬────────┬────────┬────────┬───────────────────────────────┬──────┬───────────────────┤
│ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │
├────────────┼────────┼────────┼────────┼───────────────────────────────┼──────┼───────────────────┤
│ / │ 466.9G │ 271.3G │ 171.9G │ [###########.........] 58.1% │ ext4 │ /dev/vgzorin/root │
│ /boot/efi │ 199.8M │ 15.5M │ 184.2M │ [#...................] 7.8% │ vfat │ /dev/sda1 │
╰────────────┴────────┴────────┴────────┴───────────────────────────────┴──────┴───────────────────╯
╭─────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 7 special devices │
├────────────────┬───────┬────────┬───────┬───────────────────────────────┬──────────┬────────────┤
│ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │
├────────────────┼───────┼────────┼───────┼───────────────────────────────┼──────────┼────────────┤
│ /dev │ 15.5G │ 0B │ 15.5G │ │ devtmpfs │ udev │
│ /dev/shm │ 15.6G │ 184.2M │ 15.4G │ [....................] 1.2% │ tmpfs │ tmpfs │
│ /run │ 3.1G │ 3.1M │ 3.1G │ [....................] 0.1% │ tmpfs │ tmpfs │
│ /run/lock │ 5.0M │ 0B │ 5.0M │ │ tmpfs │ tmpfs │
│ /run/user/1000 │ 3.1G │ 84.0K │ 3.1G │ [....................] 0.0% │ tmpfs │ tmpfs │
│ /sys/fs/cgroup │ 15.6G │ 0B │ 15.6G │ │ tmpfs │ tmpfs │
╰────────────────┴───────┴────────┴───────┴───────────────────────────────┴──────────┴────────────╯
Diff So Fancy
Diff So Fancy is a Good-lookin' diffs. Actually… nah… The best-lookin' diffs.
Installation
sudo add-apt-repository ppa:aos1/diff-so-fancy
sudo apt update
sudo apt install diff-so-fancy
Configure Git to use diff so fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
git config --global interactive.diffFilter "diff-so-fancy --patch"
Example
git diff
───────────────────────────
modified: README
───────────────────────────
@ README:1 @
I am testing diff so fancy
It looks really greate
DUA
DUA is a tool to view disk space usage and delete unwanted data, fast.
Installation
wget https://github.com/Byron/dua-cli/releases/download/v2.19.1/dua-v2.19.1-x86_64-unknown-linux-musl.tar.gz
tar -xvzf dua-v2.19.1-x86_64-unknown-linux-musl.tar.gz
chmod + dua-v2.19.1-x86_64-unknown-linux-musl/dua
sudo mv dua-v2.19.1-x86_64-unknown-linux-musl/dua /usr/local/bin/
Example
dua
4.10 KB README
184.32 KB dua-v2.19.1-x86_64-unknown-linux-musl
729.09 KB dua-v2.19.1-x86_64-unknown-linux-musl.tar.gz
1.02 MB total
dua i
┌ /tmp/test (4 items) ──────────────────────────────────────────────────────────────────── . = o|.. = u ── ⇊ = Ctrl+d|↓ = j|⇈ = Ctrl+u|↑ = k ┐
│ 729.09 KB | 71.5% ███████▏ | dua-v2.19.1-x86_64-unknown-linux-musl.tar.gz │
│ 184.32 KB | 18.1% █▊ | dua-v2.19.1-x86_64-unknown-linux-musl │
│ 4.10 KB | 0.4% | README │
│ │
└─────────────────────────────────────────────────────────────────────────────────────── mark-move = d | mark-toggle = space | toggle-all = a┘
Total disk usage: 1.02 MB Entries: 47
KDASH
KDASH is a simple and fast dashboard for Kubernetes.
Installation
curl https://raw.githubusercontent.com/kdash-rs/kdash/main/deployment/getLatest.sh | bash
mv kdash /usr/local/bin
Example
FZF
FZF is a command-line fuzzy finder.
Installation
wget https://github.com/junegunn/fzf/releases/download/0.38.0/fzf-0.38.0-linux_amd64.tar.gz
tar -xvzf fzf-0.38.0-linux_amd64.tar.gz
chmod +x fzf
sudo mv fzf /usr/local/bin/
Example
NAVI
NAVI is an interactive cheatsheet tool for the command-line.
Installation
Navi has dependency to FZF. So install that first.
wget https://github.com/denisidoro/navi/releases/download/v2.20.1/navi-v2.20.1-x86_64-unknown-linux-musl.tar.gz
tar -xvzf navi-v2.20.1-x86_64-unknown-linux-musl.tar.gz
chmod +x navi
sudo mv navi /usr/local/bin/
Example
Figlet
Figlet is a program for making large letters out of ordinary text.
Installation
sudo apt install figlet
Example
figlet SIAVASH
____ ___ ___ ___ ____ _ _
/ ___|_ _| / \ \ / / \ / ___|| | | |
\___ \| | / _ \ \ / / _ \ \___ \| |_| |
___) | | / ___ \ V / ___ \ ___) | _ |
|____/___/_/ \_\_/_/ \_\____/|_| |_|
Btop
Btop is a tool to monitor the computer resources.
Installation
wget https://github.com/aristocratos/btop/releases/download/v1.2.13/btop-x86_64-linux-musl.tbz
tar -xf btop-x86_64-linux-musl.tbz
mv btop/bin/btop /usr/local/bin
Example
Hyperfine
Hyperfine is a command-line benchmarking tool.
Installation
wget https://github.com/sharkdp/hyperfine/releases/download/v1.15.0/hyperfine_1.15.0_amd64.deb
sudo dpkg -i hyperfine_1.15.0_amd64.deb