├── reboot ├── su ├── more ├── timedatectl ├── usermod ├── exiftool ├── fmt ├── pwd ├── sam2p ├── sudo ├── popd ├── cut ├── nft ├── numfmt ├── firewall-cmd ├── kill ├── ulimit ├── gs ├── apachectl ├── ping6 ├── tidy ├── export ├── xdotool ├── df ├── sockstat ├── iconv ├── pgrep ├── pkill ├── install ├── alias ├── smbclient ├── pushd ├── p4 ├── pkcon ├── indent ├── maven ├── ln ├── cpio ├── rpm2cpio ├── notify-send ├── csplit ├── ab ├── ansible-vault ├── vim-plugins ├── vim-goyo ├── vim-limelight ├── vim-markdown └── vim-fzf ├── history ├── rm ├── ansible ├── rename ├── cat ├── head ├── pandoc ├── jobs ├── fkill ├── snmpwalk ├── mkdir ├── multipass ├── ncdu ├── shutdown ├── xxd ├── split ├── deb ├── trashy ├── udisksctl ├── man ├── comm ├── tee ├── truncate ├── podman ├── apk ├── cheat ├── touch ├── bzip2 ├── ag ├── black ├── at ├── iwconfig ├── ping ├── unzip ├── dhclient ├── od ├── screen ├── pactl ├── stdout ├── z ├── rss2email ├── xrandr ├── cryptsetup ├── urpm ├── dpkg ├── minikube ├── bat ├── guix-shell ├── rmdir ├── patch ├── ssh-copy-id ├── xmlto ├── ps ├── tree ├── weechat ├── aptitude ├── zip ├── slurm ├── tail ├── cups ├── pdftk ├── zoneadm ├── aria2c ├── cd ├── ifconfig ├── mount ├── shred ├── chown ├── systemd ├── uniq ├── python ├── ethtool ├── ssh-add ├── brew ├── quickget ├── ruby ├── scp ├── vagrant ├── fd ├── paste ├── svn ├── hg ├── sort ├── env ├── ss ├── ansible-galaxy ├── jrnl ├── scd ├── xargs ├── dnf ├── du ├── php ├── nova ├── apt-cache ├── wc ├── asciiart ├── asterisk ├── gzip ├── lsblk ├── gcc ├── jar ├── mutt ├── uname ├── gh ├── lib ├── wmctrl ├── woeusb ├── gem ├── gyb ├── bash ├── mv ├── uptime ├── apparmor ├── sar ├── strace ├── cp ├── top ├── hardware-info ├── jq ├── netstat ├── nkf ├── perlbrew ├── cmp ├── for ├── tarsnap ├── fzf ├── bower ├── rcs ├── diff ├── auditd ├── pass ├── sed ├── perldoc ├── acl ├── ntp ├── terraform ├── tr ├── awk ├── rpm ├── ls ├── gradle ├── irssi ├── plenv ├── yum ├── sport ├── cpanm ├── npm ├── lsof ├── sqlite3 ├── kubectl ├── salt ├── yaourt ├── journalctl ├── ip ├── javac ├── pip ├── cpan ├── ncat ├── youtube-dl ├── apt-get ├── crontab ├── pyenv ├── less ├── pkgtools ├── apt ├── grep ├── convert ├── psql ├── mysqldump ├── tmux ├── wget ├── docker-compose ├── nc ├── distcc ├── virtualenv ├── date ├── conda ├── curl ├── ssh-keygen ├── sha256sum ├── mysql ├── chmod ├── .github └── README.md ├── poetry ├── nmcli ├── tar ├── distrobox ├── rsync ├── bosh ├── dd ├── org-mode ├── socat ├── iptables ├── ffmpeg ├── jbang ├── java ├── lvm ├── sqlmap ├── 7z ├── route ├── selinux ├── dwm ├── openssl ├── ssh ├── systemctl ├── pacman ├── mdadm ├── ansi ├── kitty ├── perl ├── emacs ├── tcpdump ├── hub ├── port ├── snap ├── asciidoctor ├── markdown ├── readline └── quickemu /reboot: -------------------------------------------------------------------------------- 1 | # reboot at 22:00 2 | shutdown -r 22:00 3 | -------------------------------------------------------------------------------- /su: -------------------------------------------------------------------------------- 1 | # To switch to another user account: 2 | su 3 | -------------------------------------------------------------------------------- /more: -------------------------------------------------------------------------------- 1 | # To show beginning at line number 5: 2 | more +5 3 | -------------------------------------------------------------------------------- /timedatectl: -------------------------------------------------------------------------------- 1 | # Set timezone 2 | timedatectl set-timezone Europe/Paris 3 | -------------------------------------------------------------------------------- /usermod: -------------------------------------------------------------------------------- 1 | # Add user to sudo group 2 | sudo usermod -aG sudo 3 | -------------------------------------------------------------------------------- /exiftool: -------------------------------------------------------------------------------- 1 | # Delete all metadata in a file 2 | exiftool -all= 3 | -------------------------------------------------------------------------------- /fmt: -------------------------------------------------------------------------------- 1 | # To format lines, 50 words in each line: 2 | cat | fmt -w 50 3 | -------------------------------------------------------------------------------- /pwd: -------------------------------------------------------------------------------- 1 | # Show the absolute path of your current working directory: 2 | pwd 3 | -------------------------------------------------------------------------------- /sam2p: -------------------------------------------------------------------------------- 1 | # To concatenate all pdf files into one: 2 | sam2p *.pdf out.pdf 3 | -------------------------------------------------------------------------------- /sudo: -------------------------------------------------------------------------------- 1 | # Preserve user environment when running command 2 | sudo -E 3 | -------------------------------------------------------------------------------- /popd: -------------------------------------------------------------------------------- 1 | # To return to the directory at the top of the `pushd' stack: 2 | popd 3 | -------------------------------------------------------------------------------- /cut: -------------------------------------------------------------------------------- 1 | # To cut out the third field of text or stdoutput that is delimited by a #: 2 | cut -d# -f3 3 | -------------------------------------------------------------------------------- /nft: -------------------------------------------------------------------------------- 1 | # List applies nft rules: 2 | nft list ruleset 3 | 4 | # Load a ruleset file: 5 | nft -f filename 6 | -------------------------------------------------------------------------------- /numfmt: -------------------------------------------------------------------------------- 1 | # To convert bytes to Human readable format 2 | numfmt --to=iec --suffix=B --padding=7 1048576 3 | -------------------------------------------------------------------------------- /firewall-cmd: -------------------------------------------------------------------------------- 1 | # Reload firewall 2 | firewall-cmd --reload 3 | 4 | # List rules 5 | firewall-cmd --list-all 6 | -------------------------------------------------------------------------------- /kill: -------------------------------------------------------------------------------- 1 | # To kill a process gracefully: 2 | kill -15 3 | 4 | # To kill a process forcefully: 5 | kill -9 6 | -------------------------------------------------------------------------------- /ulimit: -------------------------------------------------------------------------------- 1 | # Report all current limits 2 | ulimit -a 3 | 4 | # Unlimited file descriptors 5 | ulimit -n unlimited 6 | -------------------------------------------------------------------------------- /gs: -------------------------------------------------------------------------------- 1 | # To reduce the size of a pdf file: 2 | gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf 3 | -------------------------------------------------------------------------------- /apachectl: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ apache, httpd ] 3 | --- 4 | # To test Apache configuration file syntax 5 | apachectl configtest 6 | -------------------------------------------------------------------------------- /ping6: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ networking ] 3 | --- 4 | # To Get all ipv6 neighbors via broadcast ping: 5 | ping6 -I eth0 ff02::1 6 | -------------------------------------------------------------------------------- /tidy: -------------------------------------------------------------------------------- 1 | # Enable indentation, wrap lines at column 160, messages to stdout: 2 | tidy -i -wrap 160 -o output.html input.html 3 | -------------------------------------------------------------------------------- /export: -------------------------------------------------------------------------------- 1 | # To show current shell attributes: 2 | export 3 | 4 | # To export an environment variable: 5 | export VARNAME="value" 6 | -------------------------------------------------------------------------------- /xdotool: -------------------------------------------------------------------------------- 1 | # Stroke each the letter b each 1000 millisecond and repeat it 3600 times. 2 | xdotool key --repeat 3600 --delay 1000 b 3 | -------------------------------------------------------------------------------- /df: -------------------------------------------------------------------------------- 1 | # To print free disk space in a human-readable format: 2 | df -h 3 | 4 | # To print the disk for a given path: 5 | df -d 6 | -------------------------------------------------------------------------------- /sockstat: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ networking ] 3 | --- 4 | # To view which users/processes are listening to which ports: 5 | sudo sockstat -l 6 | -------------------------------------------------------------------------------- /iconv: -------------------------------------------------------------------------------- 1 | # To convert file (iconv.src) from iso-8859-1 to utf-8 and save to /tmp/iconv.out 2 | iconv -f iso-8859-1 -t utf-8 iconv.src -o /tmp/iconv.out 3 | -------------------------------------------------------------------------------- /pgrep: -------------------------------------------------------------------------------- 1 | # To get a list of PIDs matching : 2 | pgrep 3 | 4 | # To kill all PIDs matching : 5 | pgrep -f | xargs kill 6 | -------------------------------------------------------------------------------- /pkill: -------------------------------------------------------------------------------- 1 | # To kill a process using its full process name: 2 | pkill 3 | 4 | # To kill a process by its partial name: 5 | pkill -f 6 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | # To create a directory for a user with a group with permission 700 2 | install -o -g -m 700 -d /home// 3 | -------------------------------------------------------------------------------- /alias: -------------------------------------------------------------------------------- 1 | # To show a list of your current shell aliases: 2 | alias 3 | 4 | # To alias `ls -l` to `ll`: 5 | alias ll='ls -l' 6 | 7 | # To remove alias: 8 | unalias ll 9 | -------------------------------------------------------------------------------- /smbclient: -------------------------------------------------------------------------------- 1 | # To display public shares on the server: 2 | smbclient -L -U% 3 | 4 | # To connect to a share: 5 | smbclient /// -U% 6 | -------------------------------------------------------------------------------- /pushd: -------------------------------------------------------------------------------- 1 | # To pushes your current directory to the top of a stack while changing to the specified directory: 2 | pushd 3 | 4 | # To return use popd: 5 | popd 6 | -------------------------------------------------------------------------------- /p4: -------------------------------------------------------------------------------- 1 | tags: [ vcs ] 2 | 3 | # To print details related to client and server configuration: 4 | p4 info 5 | 6 | # To open a file and add it to depot: 7 | p4 add 8 | -------------------------------------------------------------------------------- /pkcon: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ packaging ] 3 | --- 4 | # To update cached information about available updates: 5 | pkcon refresh 6 | 7 | # To update installed packages: 8 | pkcon update 9 | -------------------------------------------------------------------------------- /indent: -------------------------------------------------------------------------------- 1 | # To Format C/C++ source according to the style of Kernighan and Ritchie (K&R), 2 | # no tabs, 3 spaces per indent, wrap lines at 120 characters. 3 | indent -i3 -kr -nut -l120 4 | -------------------------------------------------------------------------------- /maven: -------------------------------------------------------------------------------- 1 | # To manually download artifacts: 2 | mvn org.apache.maven.plugins:maven-dependency-plugin:get -Dartifact=org.apache.geronimo.specs:specs:1.2 -Dpackaging=pom -Dtransitive=false 3 | -------------------------------------------------------------------------------- /ln: -------------------------------------------------------------------------------- 1 | # To create a symlink: 2 | ln -s 3 | 4 | # To symlink, while overwriting existing destination files 5 | ln -sf 6 | -------------------------------------------------------------------------------- /cpio: -------------------------------------------------------------------------------- 1 | # Create a specific cpio archive: 2 | ls | cpio --create > 3 | 4 | # Extract a specific cpio archive: 5 | cpio --extract --make-directories < 6 | -------------------------------------------------------------------------------- /rpm2cpio: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ packaging ] 3 | --- 4 | # To list contents of an RPM: 5 | rpm2cpio | cpio -vt 6 | 7 | # To extract contents of an RPM: 8 | rpm2cpio | cpio -vid 9 | -------------------------------------------------------------------------------- /notify-send: -------------------------------------------------------------------------------- 1 | # To send a desktop notification via dbus: 2 | notify-send -i 'icon-file/name' -a 'application_name' 'summary' 'body of message' 3 | 4 | # The -i and -a flags can be omitted if unneeded. 5 | -------------------------------------------------------------------------------- /csplit: -------------------------------------------------------------------------------- 1 | # To split a file based on a pattern: 2 | csplit '/PATTERN/' 3 | 4 | # To use prefix/suffix to improve output file names: 5 | csplit -f 'prefix-' -b '%d.extension' '/PATTERN/' '{*}' 6 | -------------------------------------------------------------------------------- /ab: -------------------------------------------------------------------------------- 1 | # To send 100 requests with a concurency of 50 requests to a URL: 2 | ab -n 100 -c 50 3 | 4 | # To send requests for 30 seconds with a concurency of 50 requests to a URL: 5 | ab -t 30 -c 50 6 | -------------------------------------------------------------------------------- /ansible-vault: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ orchestration ] 3 | --- 4 | # To enncrypt string using keyfile `backup_encryption_key`: 5 | ansible-vault encrypt_string 'SupersecretPa$$phrase' --name 'backup_encryption_key' 6 | -------------------------------------------------------------------------------- /vim-plugins/vim-goyo: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ vim,vim-plugins ] 3 | --- 4 | 5 | # Toggle Goyo 6 | `:Goyo` 7 | 8 | # Turn on or resize Goyo 9 | `:Goyo [dimension]` 10 | 11 | # Turn Goyo off 12 | `:Goyo!` 13 | -------------------------------------------------------------------------------- /history: -------------------------------------------------------------------------------- 1 | # To see most used top 10 commands: 2 | history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 3 | -------------------------------------------------------------------------------- /rm: -------------------------------------------------------------------------------- 1 | # To remove all files and subdirs in : 2 | rm -rf 3 | 4 | # To ignore non-existent files: 5 | rm -f 6 | 7 | # To remove a file with this inode: 8 | find /tmp/ -inum 6666 -exec rm -i '{}' \; 9 | -------------------------------------------------------------------------------- /ansible: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ orchestration ] 3 | --- 4 | # To run a command on multiple instances at once - using `servers` group from `inventory.yml`: 5 | ansible -u ansible -i inventory.yml servers -m shell -a "ls /var" 6 | -------------------------------------------------------------------------------- /rename: -------------------------------------------------------------------------------- 1 | # To lowercase all files and folders in current directory: 2 | rename 'y/A-Z/a-z/' * 3 | 4 | # To replace 'sometext' with 'replacedby' in all files in current directory: 5 | rename 's/sometext/replacedby/' * 6 | -------------------------------------------------------------------------------- /cat: -------------------------------------------------------------------------------- 1 | # To display the contents of a file: 2 | cat 3 | 4 | # To display file contents with line numbers 5 | cat -n 6 | 7 | # To display file contents with line numbers (blank lines excluded) 8 | cat -b 9 | -------------------------------------------------------------------------------- /head: -------------------------------------------------------------------------------- 1 | # To show the first 10 lines of : 2 | head 3 | 4 | # To show the first lines of : 5 | head -n 6 | 7 | # To show the first bytes of : 8 | head -c 9 | -------------------------------------------------------------------------------- /pandoc: -------------------------------------------------------------------------------- 1 | # Convert HTML file to Markdown 2 | pandoc -f html -t markdown -i -o 3 | 4 | # Convert Markdown file to HTML 5 | pandoc -f markdown -t html -i -o 6 | -------------------------------------------------------------------------------- /jobs: -------------------------------------------------------------------------------- 1 | # To see the background running commands: 2 | jobs 3 | 4 | # To see the background running commands with PID: 5 | jobs -l 6 | 7 | # To see the running jobs only: 8 | jobs -r 9 | 10 | # To see stopped jobs only: 11 | jobs -s 12 | -------------------------------------------------------------------------------- /fkill: -------------------------------------------------------------------------------- 1 | # To kill a process by pid 2 | fkill 1337 3 | 4 | # To kill processes by name (case insensitive) 5 | fkill safari 6 | 7 | # To kill a process listening on a port 8 | fkill :8080 9 | 10 | # To run the interactive interface 11 | fkill 12 | -------------------------------------------------------------------------------- /snmpwalk: -------------------------------------------------------------------------------- 1 | # To retrieve all of the variables under system for host zeus: 2 | snmpwalk -Os -c public -v 1 zeus system 3 | 4 | # To retrieve the scalar values, but omit the sysORTable for host zeus: 5 | snmpwalk -Os -c public -v 1 -CE sysORTable zeus system 6 | -------------------------------------------------------------------------------- /mkdir: -------------------------------------------------------------------------------- 1 | # To create nested directories: 2 | mkdir -p foo/bar/baz 3 | 4 | # To create foo/bar and foo/baz directories: 5 | mkdir -p foo/{bar,baz} 6 | 7 | # To create the foo/bar, foo/baz, foo/baz/zip and foo/baz/zap directories: 8 | mkdir -p foo/{bar,baz/{zip,zap}} 9 | -------------------------------------------------------------------------------- /multipass: -------------------------------------------------------------------------------- 1 | # List all options 2 | multipass 3 | 4 | # List existing VMs on your device 5 | multiplass list 6 | 7 | # Find what VMs can be downloaded 8 | multipass find 9 | 10 | # Download and start a temp VM 11 | multipass launch -v --name todelete 12 | -------------------------------------------------------------------------------- /ncdu: -------------------------------------------------------------------------------- 1 | # To save results to : 2 | ncdu -o 3 | 4 | # To read from : 5 | ncdu -f 6 | 7 | # To save results to a compressed file: 8 | ncdu -o- | gzip > 9 | 10 | # To read from a compressed file: 11 | zcat | ncdu -f- 12 | -------------------------------------------------------------------------------- /shutdown: -------------------------------------------------------------------------------- 1 | # To reboot the system immediately: 2 | shutdown -r now 3 | 4 | # To shut system down immediately: 5 | shutdown -h now 6 | 7 | # To reboot system after 5 minutes: 8 | shutdown -r +5 9 | 10 | # To cancel a scheduled shutdown: 11 | shutdown -c 12 | -------------------------------------------------------------------------------- /xxd: -------------------------------------------------------------------------------- 1 | # To convert bin/string to hex: 2 | echo '42 is the solution' | xxd -p 3 | # output: 34322069732074686520736f6c7574696f6e0a 4 | 5 | # To convert hex to bin/string: 6 | echo '34322069732074686520736f6c7574696f6e0a' | xxd -r -p 7 | # output: 42 is the solution 8 | -------------------------------------------------------------------------------- /split: -------------------------------------------------------------------------------- 1 | # To split a large text file into smaller files of 1000 lines each: 2 | split -l 1000 3 | 4 | # To split a large binary file into smaller files of 10M each: 5 | split -b 10M 6 | 7 | # To consolidate split files into a single file: 8 | cat x* > 9 | -------------------------------------------------------------------------------- /deb: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ packaging ] 3 | --- 4 | # To extract the contents of a .deb file: 5 | ar vx foo.deb # -> data.tar.gz 6 | tar xf data.tar.gz 7 | 8 | # To install .deb file to a debian like system (e.g: Ubuntu): 9 | sudo dpkg -i foo.deb 10 | sudo apt-get install -f 11 | -------------------------------------------------------------------------------- /trashy: -------------------------------------------------------------------------------- 1 | # To trash foo and bar: 2 | trash foo bar 3 | 4 | # To trash "foo bar": 5 | trash foo\ bar 6 | 7 | # To list files in trash: 8 | trash -v --list 9 | 10 | # To restore foo from trash: 11 | trash --restore foo 12 | 13 | # To empty trash: 14 | trash --empty 15 | -------------------------------------------------------------------------------- /udisksctl: -------------------------------------------------------------------------------- 1 | # To get info about a device: 2 | udisksctl info -b 3 | 4 | # To mount a device: 5 | udisksctl mount --block-device 6 | 7 | # To unmount a device: 8 | udisksctl unmount --block-device 9 | 10 | # To get help: 11 | udisksctl help 12 | -------------------------------------------------------------------------------- /man: -------------------------------------------------------------------------------- 1 | # To convert a man page to pdf: 2 | man -t bash | ps2pdf - bash.pdf 3 | 4 | # To view the ascii chart: 5 | man 7 ascii 6 | 7 | # To see config: 8 | cat /private/etc/man.conf 9 | 10 | # To check the existence of a keyword in all of man pages: 11 | man -k 12 | -------------------------------------------------------------------------------- /vim-plugins/vim-limelight: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ vim,vim-plugins ] 3 | --- 4 | 5 | # https://github.com/junegunn/limelight.vim 6 | 7 | #Turn Limelight on 8 | Limelight [0.0 ~ 1.0] 9 | 10 | #Turn Limelight off 11 | Limelight! 12 | 13 | #Toggle Limelight 14 | Limelight!! [0.0 ~ 1.0] 15 | -------------------------------------------------------------------------------- /comm: -------------------------------------------------------------------------------- 1 | # Print lines appearing in both and : 2 | comm -12 <(sort file1.csv) <(sort file2.csv) 3 | 4 | # Print lines appearing only in : 5 | comm -23 6 | 7 | # For diffing CSVs from a database, consider: 8 | # https://aswinkarthik.github.io/csvdiff/ 9 | -------------------------------------------------------------------------------- /tee: -------------------------------------------------------------------------------- 1 | # To tee stdout to : 2 | ls | tee 3 | 4 | # To tee stdout and append to : 5 | ls | tee -a 6 | 7 | # To tee stdout to the terminal, and also pipe it into another program for further processing: 8 | ls | tee /dev/tty | xargs printf "\033[1;34m%s\033[m\n" 9 | -------------------------------------------------------------------------------- /truncate: -------------------------------------------------------------------------------- 1 | # To clear the contents from : 2 | truncate -s 0 3 | 4 | # To truncate to 100 bytes: 5 | truncate -s 100 6 | 7 | # To truncate to 100 KB: 8 | truncate -s 100K 9 | 10 | # (M, G, T, P, E, Z, and Y may be used in place of "K" as required.) 11 | -------------------------------------------------------------------------------- /podman: -------------------------------------------------------------------------------- 1 | # List running container 2 | podman ps 3 | 4 | # List all containers created 5 | podman ps -a 6 | 7 | # Pull an image 8 | podman pull vaultwarden/server:latest 9 | 10 | # List images in local storage 11 | podman images 12 | 13 | # Delete a container 14 | podman rm 15 | -------------------------------------------------------------------------------- /apk: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [ packaging ] 3 | --- 4 | # To install a package: 5 | apk add 6 | 7 | # To remove a package: 8 | apk del 9 | 10 | # To update repos: 11 | apk update 12 | 13 | # To upgrade all packages: 14 | apk upgrade 15 | 16 | # To find a package: 17 | apk search 18 | -------------------------------------------------------------------------------- /cheat: -------------------------------------------------------------------------------- 1 | # To see example usage of a program: 2 | cheat 3 | 4 | # To edit a cheatsheet 5 | cheat -e 6 | 7 | # To list available cheatsheets 8 | cheat -l 9 | 10 | # To search available cheatsheets 11 | cheat -s 12 | 13 | # To get the current `cheat' version 14 | cheat -v 15 | -------------------------------------------------------------------------------- /touch: -------------------------------------------------------------------------------- 1 | # To change a file's modification time: 2 | touch -d