Cheat Sheet

Useful bash commands and snippets.

apt

Install specific package version

apt-cache policy kubelet
apt-get install kubelet=1.13.4-00

Hold version

apt-mark hold kubelet kubeadm kubectl

Remove hold version

apt-mark unhold kubelet kubeadm kubectl

crontab

List crontab for all users

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

du

Hidden files

Sort by size

ncurses interface

find

find and du -hsc

find and rm

Find and sed

Tools

fzf

grep

Sort by second column:

Hard drive management

List all hard drives and partitions:

journalctl

Get all logs

Get 20 most recent:

Get process logs

Processes management

Check if process is running

Swap management

Create swap partition

circle-info

Replace 1024 with your desired swap size in MB.

Disable swap

systemctl

Check if process is enable

List all services

telnet

Client close connection

Input ctrl+]

Then execute:

wget

Backup entire website.

References

https://www.linuxjournal.com/content/downloading-entire-web-site-wgetarrow-up-right

Last updated