# BasicCommand

mans: adventure
command:
adventure\n\n
You are standing at the end of a road before a small brick building.\n
Around you is a forest.  A small stream flows out of the building and down a gully.\n
open gully\n
\n
You are in a valley in the forest beside a stream tumbling along arocky bed.\n
go east\n
...


mans: boggle
command:
boggle\n\n
+---+---+---+---+ 1:57\n
| E | M | E | O |\n
+---+---+---+---+\n
| A | Y | P | Y |\n
+---+---+---+---+\n
| V | Z | O | M |\n
+---+---+---+---+\n
| S | B | U | Y |\n
+---+---+---+---+\n
\n
boy\n
buy\n


mans: backgammon
command:
backgammon\n\n
_________________________\n
|                       |\n
|13  14  15  16  17  18 |\n
| w               r     |\n
| w               r     |\n
| w               r     |\n
| w                     |\n
| w                     |\n
|                       |\n
| r                     |\n
| r                     |\n
| r               w     |\n
| r               w     |\n
| r               w     |\n
|12  11  10   9   8   7 |\n
|_______________________|\n


mans: atc
command:
atc\n
\n
7-----------------------1\n
| + . . . . . . . . . . |\n
| . + . . . . . . . . . |\n
| . . + . . . . . . . . |\n
| . . . + . . . . . . . |\n
| . . . . + . . . . . . |\n
| . . . . . + . . . . . |\n
6 + a7+ + + + + + + + + 2\n
| . . . . . . . . . . . |\n
| . . . . . . . . . . . |\n
| . . . . . . . . . . . |\n
| . . . . . . . . . . . |\n
| . . . . . . . . . . . |\n
5 + + + + + + + + + + + |\n
| . . . . . . . . . . . |\n
| . . . . . . . . . . . |\n
| . . . . . . . . . + . |\n
------------------4------\n


mans: battlestar
command:
battlestar\n
This is a luxurious stateroom. The floor is carpeted with a soft animal fur and the great wooden furniture is inlaid with strips of platinum and gold.  Electronic equipment built into the walls and ceiling is flashing wildly.  The floor shudders and the sounds of dull explosions rumble though the room.  From a window in the wall ahead comes a view of darkest space.  There is a small adjoining room behind you, and a doorway right.\n
>-: move r\n
...


mans: worm
command:
worm\n\n
┌***************************┐\n
*                           * \n
*                @ooo       * \n
*                   o       * \n
*                   o       * \n
*                   o       * \n
*  o                o       * \n
*  oooooooooooooooooo       * \n
*                       6   * \n
*                           * \n
└***************************┘


mans: nethack-console
command:
nethack-console\n\n
What type of things do you want to take off?\n\n
      a - All worn types\n
      b - Weapons\n
      c - Armor\n
      (end) \n
             +.....|\n
             |.....|\n
             |...d.|\n
             |..<..|\n
             |.@...|\n
             -------


mans: zangband
command:
zangband\n\n
Elf      .;;.....%..%.........\n
Warrior  ..;;.....%.....%%...;\n
Rookie   .;....%..############\n
LEVEL  1 .........############\n
EXP    0 .........##..........\n
AU   277 .........##..........\n
         .........##..........\n
STR:19.6 .........##..........\n
INT:14.5 .........##..........\n
WIS:15.2 .........##..........\n
DEX:18.1 .##########..........\n
CON:13.4 .##########.......>..\n
CHR:15.3 .##..................\n
         .##..................\n
Cur AC 2 .##..................\n
Max HP17 .##.............@....\n
Cur HP17 .##.....######.......\n
         .##.....######.......\n
         .+......######.######\n
         .+......######.######


mans: ninvaders
command:
ninvaders\n\n
 ,^,,^,,^,,^,,^,,^,,^,,^,,^,,\n
 \n
 _O-_O-_O-_O-   _O-_O-_O-_O-_\n
\n
 _O-_O-_O-_O-_O-_O-_O-_O-_O-_\n
\n
 -o--o-   -o--o--o-   -o--o--\n
\n
 -o--o--o-   -o--o-   -o-   -\n
\n
   ###\n
  #####               #####\n
 #######             #######\n
 ##   ##             ##   ##\n           

\n\n\n
   ###                 ###\n
  #####               #####\n
 #######             #######\n
 ##   ##             ##   ##\n
 \n
 \n
            /-Λ-\


mans: greed
command:
greed\n\n
46158478591614129875257576943\n
9372558327914     34335181291\n
6793583286734 149 62271829675\n
2675431288535 463 33652837793\n
3692          325 29845237478\n
7512 163196893369 68997755721\n
8829 251614341338   728658292\n
4727             34 6     @24\n
5133297843588915 44 5 5126924\n
2333219345387699 45 4 5473243\n
3479121838893646 42 6 9    17\n
73459       7915 44 6 4 27 48\n
51681 75276 3274 58 6 6 52 13\n
68586 39327 8317 92 3   39 78\n
23845 94162 4897 52 816291 16\n
43793 66833 6935 72        96\n
18995 37589      254642376629\n
57283 21985754773457173749116\n
63234 96485454662987847646584


mans: moon-buggy
command:
moon-buggy\n\n
                   Omm\n
                (\)-(\)\n
#########  ###############\n
##########################\n


mans: awk,print,grep,wc,cat,sleep,echo,dc
command:
HZ=`awk '/\\#define HZ/ {print $3}' /usr/include/asm-generic/param.h`; NUMCPUS=`grep ^proc /proc/cpuinfo | wc -l`; FIRST=`cat /proc/stat | awk '/^cpu / {print $5}'`; sleep 1; SECOND=`cat /proc/stat | awk '/^cpu / {print $5}'`; USED=`echo 4 k 100 $SECOND $FIRST - $NUMCPUS $HZ \\* / 100 \\* - p | dc`; echo ${USED}


mans: grep,wc,cat,awk,sleep,print,echo,dc
command:
NUMCPUS=`grep ^proc /proc/cpuinfo | wc -l`; FIRST=`cat /proc/stat | awk '/^cpu / {print $5}'`; sleep 1; SECOND=`cat /proc/stat | awk '/^cpu / {print $5}'`; USED=`echo 2 k 100 $SECOND $FIRST - $NUMCPUS / - p | dc`; echo ${USED}%


mans: grep,awk,print,expr,echo
command:
max=$(grep 'last full capacity:' /proc/acpi/battery/BAT1/info|awk '{print $4}') ; current=$(grep 'remaining capacity:' /proc/acpi/battery/BAT1/state|awk '{print $3}'); percent=$(expr $current'00' / $max ); echo -e $percent


mans: cat,awk,print,sed
command:
cat /sys/class/power_supply/BAT1/uevent | awk '/POWER_SUPPLY_CAPACITY/ {print $1}' | sed 's/POWER_SUPPLY_CAPACITY=//'


mans: dbus-send
command:
dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock


mans: dbus-send
command:
dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive boolean:false


mans: find,sort,uniq,xargs,find,xargs,md5sum,sort,uniq
command:
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate


mans: wget,sed
command:
translate(){ wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }


mans: tr,dd,grep
command:
tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"


mans: echo,grep
command:
i="8uyxVmdaJ-w";mplayer -fs $(curl -s "http://www.youtube.com/get_video_info?&video_id=$i" | echo -e $(sed 's/%/\\x/g;s/.*\(v[0-9]\.lscache.*\)/http:\/\/\1/g') | grep -oP '^[^|,]*')


mans: netstat,grep,awk,awk,sort,uniq,awk,print
command:
netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'


mans: curl,tr,awk,sed
command:
curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p"


mans: curl
command:
cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }


mans: wget
command:
wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world


mans: du,sort,perl
command:
du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e'


mans: lsmod,perl,print
command:
lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -


mans: wget,sed,sed,sed,tr,sed,wget
command:
wget http://www.youtube.com/watch?v=dQw4w9WgXcQ -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv


mans: gzip
command:
for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done


mans: mkfifo,cat,tee,tee
command:
mkfifo /tmp/fifo; cat /tmp/fifo | nc -l -p 1234 | tee -a to.log | nc machine port | tee -a from.log > /tmp/fifo


mans: wget
command:
wget -qO - http://infiltrated.net/blacklisted|awk '!/#|[a-z]/&&/./{print "iptables -A INPUT -s "$1" -j DROP"}'


mans: echo,lshw,grep,tail,awk,cut,head,awk,cut,tr,sudo,tee
command:
echo $(sudo lshw -businfo | grep -B 1 -m 1 $(df "/path/to/file" | tail -1 | awk '{print $1}' | cut -c 6-8) | head -n 1 | awk '{print $1}' | cut -c 5- | tr ":" "-") | sudo tee /sys/bus/usb/drivers/usb/unbind


mans: ssh
command:
mysqldump --add-drop-table --extended-insert --force --log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost "mysql -uUSER -pPASS NEW_DB_NAME"


mans: file,convert,sed
command:
for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; done


mans: printf
command:
PROMPT_COMMAND='if [ $RANDOM -le 3200 ]; then printf "\0337\033[%d;%dH\033[4%dm \033[m\0338" $((RANDOM%LINES+1)) $((RANDOM%COLUMNS+1)) $((RANDOM%8)); fi'


mans: wget
command:
xkcd(){ wget -qO- http://xkcd.com/|tee >(feh $(grep -Po '(?<=")http://imgs[^/]+/comics/[^"]+\.\w{3}'))|grep -Po '(?<=(\w{3})" title=").*(?=" alt)';}


mans: wget
command:
clfavs(){ URL="http://www.commandlinefu.com";wget -O - --save-cookies c --post-data "username=$1&password=$2&submit=Let+me+in" $URL/users/signin;for i in `seq 0 25 $3`;do wget -O - --load-cookies c $URL/commands/favourites/plaintext/$i >>$4;done;rm -f c;}


mans: lynx
command:
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\'


mans: script,scriptreplay
command:
script -t /tmp/mylog.out 2>/tmp/mylog.time; <do your work>; <CTRL-D>; scriptreplay /tmp/mylog.time /tmp/mylog.out


mans: echo,echo,echo,rm
command:
(echo CD_DA; for f in {01..99}; do echo "$f Hz">&2; sox -nt cdda -r44100 -c2 $f.cdda synth 30 sine $f; echo TRACK AUDIO; echo FILE \"$f.cdda\" 0; done) > cdrdao.toc && cdrdao write cdrdao.toc && rm ??.cdda cdrdao.toc


command:
bbcradio() { local s PS3="Select a station: ";select s in 1 1x 2 3 4 5 6 7 "Asian Network an" "Nations & Local lcl";do break;done;s=($s);mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${s[@]: -1}".asx";}


mans: sudo,awk,printf
command:
sudo zcat /var/log/auth.log.*.gz | awk '/Failed password/&&!/for invalid user/{a[$9]++}/Failed password for invalid user/{a["*" $11]++}END{for (i in a) printf "%6s\t%s\n", a[i], i|"sort -n"}'


mans: echo,sudo,tee,sudo,update-grub
command:
echo "GRUB_INIT_TUNE=\"1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2\"" | sudo tee -a /etc/default/grub > /dev/null && sudo update-grub


mans: alias,sort,head,awk,vim
command:
alias busy='my_file=$(find /usr/include -type f | sort -R | head -n 1); my_len=$(wc -l $my_file | awk "{print $1}"); let "r = $RANDOM % $my_len" 2>/dev/null; vim +$r $my_file'


mans: ssh
command:
ssh -f -L 5900:localhost:5900 your.ssh.server "x11vnc -safer -localhost -nopw -once -display :0"; vinagre localhost:5900


mans: alias,date
command:
alias dateh='date --help|sed -n "/^ *%%/,/^ *%Z/p"|while read l;do F=${l/% */}; date +%$F:"|'"'"'${F//%n/ }'"'"'|${l#* }";done|sed "s/\ *|\ */|/g" |column -s "|" -t'


mans: echo,wall,less,wall
command:
echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall,, " | espeak -v english -s 140


mans: echo,echo
command:
echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r   "; else v+="\e[2m $r   "; fi; else v+="     "; fi; done; echo -e "$v"; v=""; done


command:
/sbin/kexec -l /boot/$KERNEL --append="$KERNELPARAMTERS" --initrd=/boot/$INITRD; sync; /sbin/kexec -e


mans: df,umount,mkdir,sudo,mount
command:
(mountpoint -q "/media/mpdr1" && df /media/mpdr1/* > /dev/null 2>&1) || ((sudo umount "/media/mpdr1" > /dev/null 2>&1 || true) && (sudo mkdir "/media/mpdr1" > /dev/null 2>&1 || true) && sudo mount "/dev/sdd1" "/media/mpdr1")


mans: sudo,tcpdump,ip,awk,print,awk
command:
sudo tcpdump -i wlan0 -n ip | awk '{ print gensub(/(.*)\..*/,"\\1","g",$3), $4, gensub(/(.*)\..*/,"\\1","g",$5) }' | awk -F " > " '{print $1"\n"$2}'


mans: echo,top,ps2pdf
command:
echo "This text gets stamped on the top of the pdf pages." | enscript -B -f Courier-Bold16 -o- | ps2pdf - | pdftk input.pdf stamp - output output.pdf


mans: awk,print,printf
command:
awk 'BEGIN{FS=":"; print "digraph{"}{split($4, a, ","); for (i in a) printf "\"%s\" [shape=box]\n\"%s\" -> \"%s\"\n", $1, a[i], $1}END{print "}"}' /etc/group|display


command:
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif


mans: gzip
command:
for db in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $db | gzip > "/backups/mysqldump-$(hostname)-$db-$(date +%Y-%m-%d-%H.%M.%S).gz"; done


mans: find,rm
command:
find . -type f -print0|xargs -0 md5sum|sort|perl -ne 'chomp;$ph=$h;($h,$f)=split(/\s+/,$_,2);print "$f"."\x00" if ($h eq $ph)'|xargs -0 rm -v --


mans: cd,sqlite3,grep,awk,cd
command:
cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/null


mans: echo,convert
command:
echo -e "Some Text Line1\nSome Text Line 2" | convert -background none -density 196  -resample 72 -unsharp 0x.5 -font "Courier" text:- -trim +repage -bordercolor white -border 3  text.gif


command:
define(){ local y="$@";curl -sA"Opera" "http://www.google.com/search?q=define:${y// /+}"|grep -Po '(?<=<li>)[^<]+'|nl|perl -MHTML::Entities -pe 'decode_entities($_)' 2>/dev/null;}


mans: curl
command:
flight_status() { if [[ $# -eq 3 ]];then offset=$3; else offset=0; fi; curl "http://mobile.flightview.com/TrackByRoute.aspx?view=detail&al="$1"&fn="$2"&dpdat=$(date +%Y%m%d -d ${offset}day)" 2>/dev/null |html2text |grep ":"; }


command:
rename -v 's/.*[s,S](\d{2}).*[e,E](\d{2}).*\.avi/SHOWNAME\ S$1E$2.avi/' poorly.named.file.s01e01.avi


mans: echo,top,sudo
command:
tmpfile=$(mktemp) && echo -e 'startup_message off\nscreen -t top htop\nsplit\nfocus\nscreen -t nethogs nethogs wlan0\nsplit\nfocus\nscreen -t iotop iotop' > $tmpfile && sudo screen -c $tmpfile


mans: echo,echo
command:
PS1="\`if [ \$? = 0 ]; then echo \e[33\;40m\\\^\\\_\\\^\e[0m; else echo \e[36\;40m\\\-\e[0m\\\_\e[36\;40m\\\-\e[0m; fi\` \u \w:\h)"


mans: sudo,dd,mkswap,sudo,swapon
command:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000;sudo mkswap /swapfile; sudo swapon /swapfile


mans: mysql,awk,mysql
command:
mysql --database=dbname -B -N -e "SHOW TABLES"  | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --database=dbname &


mans: strace,perl
command:
strace -ff -e trace=file my_command 2>&1 | perl -ne 's/^[^"]+"(([^\\"]|\\[\\"nt])*)".*/$1/ && print'


mans: ln,cut
command:
for h in `find /proc/*/fd -ilname "/tmp/Flash*" 2>/dev/null`; do ln -s "$h" `readlink "$h" | cut -d' ' -f1`; done


mans: vimdiff
command:
vimdiff scp://root@server-foo.com//etc/snmp/snmpd.conf scp://root@server-bar.com//etc/snmp/snmpd.conf


mans: mount,ntfs-3g,grep,cut
command:
mount -t ntfs-3g -o ro,loop,uid=user,gid=group,umask=0007,fmask=0117,offset=0x$(hd -n 1000000  image.vdi | grep "eb 52 90 4e 54 46 53" | cut -c 1-8) image.vdi /mnt/vdi-ntfs


mans: cat,awk,uniq,sort,awk
command:
cat /var/log/secure.log | awk '{print substr($0,0,12)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i<$1 ; i++) {printf("*")};}'


mans: cat,md5sum,sed
command:
MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`


command:
qrencode -s 7 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Network name (SSID)" --title="Create WiFi QR");T:WPA;P:$(zenity --password --title="Wifi Password");;"


mans: ssh,tar,ssh,tar
command:
ssh root@host1 "cd /somedir/tocopy/ && tar -cf - ." | ssh root@host2 "cd /samedir/tocopyto/ && tar -xf -"


mans: echo
command:
for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r


mans: du,sort,awk,print
command:
du --max-depth=1 | sort -r -n | awk '{split("k m g",v); s=1; while($1>1024){$1/=1024; s++} print int($1)" "v[s]"\t"$2}'


mans: lsmod,awk,print
command:
lsmod | awk 'BEGIN{print "digraph{"}{split($4, a, ","); for (i in a) print $1, "->", a[i]}END{print "}"}'|display


mans: grep,tr,cut,echo,awk,sleep
command:
while [ /bin/true ]; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done


mans: echo,dialog
command:
j=0;while true; do let j=$j+1; for i in $(seq 0 20 100); do echo $i;sleep 1; done | dialog --gauge "Install part $j : `sed $(perl -e "print int rand(99999)")"q;d" /usr/share/dict/words`" 6 40;done


mans: zenity,awk,sort,awk,xargs
command:
zenity --list --width 500 --height 500 --column 'radio' --column 'url' --print-column 2 $(curl -s http://www.di.fm/ | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer


mans: echo
command:
for c in `seq 0 255`;do t=5;[[ $c -lt 108 ]]&&t=0;for i in `seq $t 5`;do echo -e "\e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d '[0-9]'`\e[0m";done;done


mans: convert
command:
convert -font -misc-fixed-*-*-*-*-*-*-*-*-*-*-*-* -fill black -draw "text 270,260 \" `cal` \"" testpic.jpg newtestpic.jpg


mans: ffmpeg
command:
read && ffmpeg -y -r 1 -t 3 -f video4linux2 -vframes 1 -s sxga -i /dev/video0 ~/webcam-$(date +%m_%d_%Y_%H_%M).jpeg


mans: echo
command:
hourglass(){ trap 'tput cnorm' 0 1 2 15 RETURN;local s=$(($SECONDS +$1));(tput civis;while (($SECONDS<$s));do for f in '|' '\' '-' '/';do echo -n "$f";sleep .2s;echo -n $'\b';done;done;);}


mans: history,awk,sort,head
command:
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes')


mans: echo,cut,echo
command:
ruler() { for s in '....^....|' '1234567890'; do w=${#s}; str=$( for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done ); str=$(echo $str | cut -c -$COLUMNS) ; echo $str; done; }


mans: curl
command:
curl -u twitter-username -d status="Hello World, Twitter!" -d source="cURL" http://twitter.com/statuses/update.xml


mans: echo,md5sum,sha1sum,sha224sum,sha256sum,sha384sum,sha512sum,gzip,strings,tr,tr,tr,rev,cut,history
command:
sitepass() { echo -n "$@" |  md5sum | sha1sum | sha224sum | sha256sum | sha384sum | sha512sum | gzip - | strings -n 1 | tr -d "[:space:]"  | tr -s '[:print:]' | tr '!-~' 'P-~!-O' | rev | cut -b 2-11; history -d $(($HISTCMD-1)); }


mans: diff,find,md5sum,sort,md5sum,sort
command:
diff <(ssh server01 'cd config; find . -type f -exec md5sum {} \;| sort -k 2') <(ssh server02 'cd config;find . -type f -exec md5sum {} \;| sort -k 2')


mans: awk,sleep
command:
while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done


mans: wget,cut
command:
t2s() { wget -q -U Mozilla -O $(tr ' ' _ <<< "$1"| cut -b 1-15).mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=$(tr ' ' + <<< "$1")"; }


mans: google,grep,sed,echo
command:
function google { Q="$@"; GOOG_URL='https://www.google.de/search?tbs=li:1&q='; AGENT="Mozilla/4.0"; stream=$(curl -A "$AGENT" -skLm 10 "${GOOG_URL}${Q//\ /+}" | grep -oP '\/url\?q=.+?&amp' | sed 's|/url?q=||; s|&amp||'); echo -e "${stream//\%/\x}"; }


mans: du,awk
command:
t=$(df|awk 'NR!=1{sum+=$2}END{print sum}');sudo du / --max-depth=1|sed '$d'|sort -rn -k1 | awk -v t=$t 'OFMT="%d" {M=64; for (a=0;a<$1;a++){if (a>c){c=a}}br=a/c;b=M*br;for(x=0;x<b;x++){printf "\033[1;31m" "|" "\033[0m"}print " "$2" "(a/t*100)"% total"}'


mans: printf,printf,cat,cat
command:
cls(){ printf "\33[2J";} or, if no printf, cat >cls;<ctrl-v><ctrl+[>[2J<enter><ctrl+d> cls(){ cat cls;}


mans: wget,sed
command:
down4me() { wget -qO - "http://www.downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g' ; }


mans: echo
command:
echo "?????, these are the umlauted vowels I sing to you. Oh, and sometimes ?, but I don't sing that one cause it doesn't rhyme."


mans: wget,grep,head,sed,sed
command:
pronounce(){ wget -qO- $(wget -qO- "http://dictionary.reference.com/browse/$@" | grep 'soundUrl' | head -n 1 | sed 's|.*soundUrl=\([^&]*\)&.*|\1|' | sed 's/%3A/:/g;s/%2F/\//g') | mpg123 -; }


command:
A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";


mans: echo,sleep,export
command:
sleeper(){ while `ps -p $1 &>/dev/null`; do echo -n "${2:-.}"; sleep ${3:-1}; done; }; export -f sleeper


mans: time
command:
URL="http://www.google.com";curl -L --w "$URL\nDNS %{time_namelookup}s  conn %{time_connect}s  time %{time_total}s\nSpeed %{speed_download}bps Size %{size_download}bytes\n" -o/dev/null -s $URL


mans: ssh,sleep,sleep
command:
while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;done


mans: ssh
command:
ssh -f -L3389:<RDP_HOST>:3389 <SSH_PROXY> "sleep 10" && rdesktop -T'<WINDOW_TITLE>' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost


mans: sed
command:
say(){ mplayer -user-agent Mozilla "http://translate.google.com/translate_tts?tl=en&q=$(echo $* | sed 's#\ #\+#g')" > /dev/null 2>&1 ;  }


mans: egrep
command:
egrep -i "^[0-9a-f]{4,} .*$*" $(locate CharName.pm) | while read h d; do /usr/bin/printf "\U$(printf "%08x" 0x$h)\tU+%s\t%s\n" $h "$d"; done


mans: curl
command:
curl -n --ssl-reqd --mail-from "<user@gmail.com>" --mail-rcpt "<user@server.tld>" --url smtps://smtp.gmail.com:465 -T file.txt


mans: tail
command:
url=http://www.youtube.com/watch?v=V5bYDhZBFLA; youtube-dl -b $url; mplayer $(ls ${url##*=}*| tail -n1) -ss 00:57 -endpos 10 -vo gif89a:fps=5:output=output.gif -vf scale=400:300 -nosound


mans: curl
command:
for x in `jot - 0 2400 25`; do curl "http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/$x"  ; done > commandlinefu.txt


mans: netstat,awk,sed,cut,sort,uniq,sort
command:
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | sed s/::ffff:// | cut -d: -f1 | sort | uniq -c | sort -n


mans: du,printf
command:
du -x --max-depth=1|sort -rn|awk -F / -v c=$COLUMNS 'NR==1{t=$1} NR>1{r=int($1/t*c+.5); b="\033[1;31m"; for (i=0; i<r; i++) b=b"#"; printf " %5.2f%% %s\033[0m %s\n", $1/t*100, b, $2}'|tac


mans: curl,python
command:
curl -s http://www.census.gov/popclock/data/population/world | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["world"]["population"]'


mans: rsync
command:
rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" user@<source>:<source_dir> <dest_dir>


mans: seq,sed,awk
command:
seq 9 | sed 'H;g' | awk -v RS='' '{for(i=1;i<=NF;i++)printf("%dx%d=%d%s", i, NR, i*NR, i==NR?"\n":"\t")}'


mans: md5sum,echo,sed,echo,cut,netcat
command:
IFS=$'\n' && for f in `find . -type f -exec md5sum "{}" \;`; do echo $f | sed -r 's/^[^ ]+/Checking:/'; echo $f | cut -f1 -d' ' | netcat hash.cymru.com 43 ; done


command:
multitail -l 'ssh machine1 "tail -f /var/log/apache2/error.log"' -l 'ssh machine2 "tail -f /var/log/apache2/error.log"'


mans: grep
command:
imgur(){ $*|convert label:@- png:-|curl -F "image=@-" -F "key=1913b4ac473c692372d108209958fd15" http://api.imgur.com/2/upload.xml|grep -Eo "<original>(.)*</original>" | grep -Eo "http://i.imgur.com/[^<]*";}


mans: cat,tr,tr,awk,cat,head
command:
cat WAR_AND_PEACE_By_LeoTolstoi.txt | tr -cs "[:alnum:]" "\n"| tr "[:lower:]" "[:upper:]" | awk '{h[$1]++}END{for (i in h){print h[i]" "i}}'|sort -nr | cat -n | head -n 30


mans: echo,sleep,echo
command:
MIN=1 && for i in $(seq $(($MIN*60)) -1 1); do echo -n "$i, "; sleep 1; done; echo -e "\n\nBOOOM! Time to start."


mans: gs
command:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf


mans: echo,sleep
command:
while [ 1 ]; do banner 'ze missiles, zey are coming! ' | while IFS="\n" read l; do echo "$l"; sleep 0.01; done; done


mans: cat,ls,readlink,grep,rm
command:
cat /var/lib/dpkg/info/*.list > /tmp/listin ; ls /proc/*/exe |xargs -l readlink | grep -xvFf /tmp/listin; rm /tmp/listin


mans: wget,egrep,xargs,wget
command:
wget -nv http://en.wikipedia.org/wiki/Linux -O- | egrep -o "http://[^[:space:]]*.jpg" | xargs -P 10 -r -n 1 wget -nv


mans: pgrep,find,echo
command:
pgrep -u `id -u` firefox-bin || find ~/.mozilla/firefox -name '*.sqlite'|(while read -e f; do echo 'vacuum;'|sqlite3 "$f" ; done)


mans: sed
command:
id="dMH0bHeiRNg";mplayer -fs http://youtube.com/get_video.php?video_id=$id\&t=$(curl -s http://www.youtube.com/watch?v=$id | sed -n 's/.*, "t": "\([^"]*\)", .*/\1/p')


command:
read -p "Which station? "; mplayer --reallyquiet -vo none -ao sdl http://somafm.com/startstream=${REPLY}.pls


mans: wget,awk
command:
wget -O - http://www.commandlinefu.com/commands/browse/rss 2>/dev/null | awk '/\s*<title/ {z=match($0, /CDATA\[([^\]]*)\]/, b);print b[1]} /\s*<description/ {c=match($0, /code>(.*)<\/code>/, d);print d[1]"\n"} '


mans: curl
command:
step1 ; step2 ; step3 ; step4 ; curl -o- --get 'https://stream.twitter.com/1/statuses/filter.json' --header "$oauth_header" --data "follow=$id"


command:
step4() { oauth_header="Authorization: OAuth oauth_consumer_key=\"$k1\", oauth_nonce=\"$once\", oauth_signature=\"$signature\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"$ts\", oauth_token=\"$k3\", oauth_version=\"1.0\"" ; }


command:
step2(){ b="GET&https%3A%2F%2Fstream.twitter.com%2F1%2Fstatuses%2Ffilter.json&follow%3D${id}%26oauth_consumer_key%3D${k1}%26oauth_nonce%3D${once}%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D${ts}%26oauth_token%3D${k3}%26oauth_version%3D1.0";}


mans: echo
command:
step3() { s=$(echo -n $b | openssl dgst -sha1 -hmac $hmac -binary | openssl base64); signature=`for((i=0;i<${#s};i++)); do case ${s:i:1} in +) e %2B;; /) e %2F;; =) e %3D;; *) e ${s:i:1};; esac ; done` ; } ; e() { echo -n $1; }


mans: cat,sleep,awk,printf
command:
while true; do cat /proc/net/dev; sleep 1; done | awk -v dc="date \"+%T\"" '/eth0/{i = $2 - oi; o = $10 - oo; oi = $2; oo = $10; dc|getline d; close(dc); if (a++) printf "%s %8.2f KiB/s in %8.2f KiB/s out\n", d, i/1024, o/1024}'


mans: sleep
command:
ontouchdo(){ while :; do a=$(stat -c%Y "$1"); [ "$b" != "$a" ] && b="$a" && sh -c "$2"; sleep 1; done }


mans: wc,grep,head,wc,tar,mkdir,tar
command:
atb() { l=$(tar tf $1); if [ $(echo "$l" | wc -l) -eq $(echo "$l" | grep $(echo "$l" | head -n1) | wc -l) ]; then tar xf $1; else mkdir ${1%.tar.gz} && tar xf $1 -C ${1%.tar.gz}; fi ;}


mans: alias
command:
alias alert='notify-send -i /usr/share/icons/gnome/32x32/apps/gnome-terminal.png "[$?] $(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/;\s*alert$//'\'')"'


command:
d="www.dafont.com/alpha.php?";for c in {a..z}; do l=`curl -s "${d}lettre=${c}"|sed -n 's/.*ge=\([0-9]\{2\}\).*/\1/p'`;for((p=1;p<=l;p++));do for u in `curl -s "${d}page=${p}&lettre=${c}"|egrep -o "http\S*.com/dl/\?f=\w*"`;do aria2c "${u}";done;done;done


mans: strace,grep,cut,sed,xxd
command:
strace -ff -e write=1,2 -s 1024 -p PID  2>&1 | grep "^ |" | cut -c11-60 | sed -e 's/ //g' | xxd -r -p


command:
rdesktop -a24 -uAdministrator -pPassword  -r clipboard:CLIPBOARD -r disk:share=~/share -z -g 1280x900 -0 $@ &


mans: lsof,awk,print
command:
lsof -p $(pidof firefox) | awk '/.mozilla/ { s = int($7/(2^20)); if(s>0) print (s)" MB -- "$9 | "sort -rn" }'


mans: curl,sed
command:
curl -s "http://www.geody.com/geoip.php?ip=$(curl -s icanhazip.com)" | sed '/^IP:/!d;s/<[^>][^>]*>//g'


mans: find,grep,sed
command:
sh -c 'S=askapache R=htaccess; find . -mount -type f|xargs -P5 -iFF grep -l -m1 "$S" FF|xargs -P5 -iFF sed -i -e "s%${S}%${R}%g" FF'


mans: find,xargs,perl,printf,tail
command:
find -type f -name "*.avi" -print0 | xargs -0  mplayer -vo dummy -ao dummy -identify 2>/dev/null | perl -nle '/ID_LENGTH=([0-9\.]+)/ && ($t +=$1) && printf "%02d:%02d:%02d\n",$t/3600,$t/60%60,$t%60' | tail -n 1


mans: curl
command:
curl http://www.commandlinefu.com/commands/by/<your username>/rss|gzip ->commandlinefu-contribs-backup-$(date +%Y-%m-%d-%H.%M.%S).rss.gz


command:
ldapsearch -LLL -H ldap://activedirectory.example.com:389 -b 'dc=example,dc=com' -D 'DOMAIN\Joe.Bloggs' -w 'p@ssw0rd' '(sAMAccountName=joe.bloggs)'


mans: awk,printf
command:
awk '/sshd/ && /Failed/ {gsub(/invalid user/,""); printf "%-12s %-16s %s-%s-%s\n", $9, $11, $1, $2, $3}' /var/log/auth.log


mans: sleep,print,echo
command:
while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; done


mans: curl,head,sleep
command:
while [ 1 ]; do curl -s -u username:password  http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;done


mans: tput,tput
command:
clear;while true;sleep 1;do for((a=1;a<=$(tput cols)/3;a++));do tput cup 0 $a;echo " " $(date);done;sleep 1;for((a;a>=1;a--));do tput cup 0 $a;echo $(date) " ";done;done


mans: python
command:
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < file.json > file.yaml


mans: grep,sed,echo
command:
Q="YOURSEARCH"; GOOG_URL="http://www.google.com/search?q="; AGENT="Mozilla/4.0"; stream=$(curl -A "$AGENT" -skLm 10 "${GOOG_URL}\"${Q/\ /+}\"" | grep -oP '\/url\?q=.+?&amp' | sed 's/\/url?q=//;s/&amp//'); echo -e "${stream//\%/\x}"


mans: echo,aplay
command:
echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay


command:
step1() { k1="Consumer key" ; k2="Consumer secret" ; k3="Access token" ; k4="Access token secret" ; once=$RANDOM ; ts=$(date +%s) ; hmac="$k2&$k4" ; id="19258798" ; }


mans: ssh,awk,print
command:
ssh vm-user@`VBoxManage guestproperty get "vm-name" "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $2 }'`


mans: alias,echo,sleep
command:
alias screensaver='for ((;;)); do echo -ne "\033[$((1+RANDOM%LINES));$((1+RANDOM%COLUMNS))H\033[$((RANDOM%2));3$((RANDOM%8))m$((RANDOM%10))"; sleep 0.1 ; done'


mans: ssh,cat
command:
mysqldump -q --skip-opt --force --log-error=dbname_error.log -uroot -pmysqlpassword dbname | ssh -C user@sshserver 'cd /path/to/backup/dir; cat > dbname.sql'


mans: cd,cd
command:
cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; }


mans: curl,grep
command:
curl http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2500:25] | grep -v _curl_ > comfu.txt


command:
mail -s "subject" user@todomain.com <emailbody.txt  -- -f customfrom@fromdomain.com -F 'From Display Name'


mans: convert,rm
command:
VBoxManage internalcommands converttoraw winxp.vdi winxp.raw && qemu-img convert -O vmdk winxp.raw winxp.vmdk && rm winxp.raw


mans: echo,echo,sleep
command:
echo $(date +%s) > start-time; URL=http://www.google.com; while true; do echo $(curl -L --w %{speed_download} -o/dev/null -s $URL) >> bps; sleep 10; done &


mans: dig,grep,sort
command:
timeDNS() { parallel -j0 --tag dig @{} "$*" ::: 208.67.222.222 208.67.220.220 198.153.192.1 198.153.194.1 156.154.70.1 156.154.71.1 8.8.8.8 8.8.4.4 | grep Query | sort -nk5; }


mans: timeout
command:
nik=clf$RANDOM;sr=irc.efnet.org;expect -c "set timeout -1;spawn nc $sr 6666;set send_human {.1 .2 1 .2 1};expect AUTH*\n ;send -h \"user $nik * * :$nik commandlinefu\nnick $nik\n\"; interact -o -re (PING.:)(.*\$) {send \"PONG :\$interact_out(2,string)\"}"


mans: sqlite3
command:
sqlite3 ~/.mozilla/firefox/*.[dD]efault/places.sqlite "SELECT strftime('%d.%m.%Y %H:%M:%S', visit_date/1000000, 'unixepoch', 'localtime'),url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id ORDER BY visit_date;"


mans: echo,echo
command:
server$ while true; do read -n30 ui; echo $ui |openssl enc -aes-256-ctr -a -k PaSSw; done | nc -l -p 8877 | while read so; do decoded_so=`echo "$so"| openssl enc -d -a -aes-256-ctr -k PaSSw`; echo -e "Incoming: $decoded_so"; done


command:
:e - reload file
:q - quit
:q! - quit without saving changes
:w - write file
:w {file} - write new file
:x - write file and exit


command:
k - up 
h - left
l - right
j - down
w - next start of word
W - next start of whitespace-delimited word
e - next end of word
E - next end of whitespace-delimited word
b - previous start of word
B - previous start of whitespace-delimited word
0 - start of line
$ - end of line
gg - go to first line in file
G - go to end of file
gk - move down one displayed line
gj - move up one displayed line


command:
a - append after the cursor
A - append at the end of the line
i - insert before the cursor
I - insert at the beginning of the line
o - create a new line under the cursor
O - create a new line above the cursor
R - enter insert mode but replace instead of inserting chars
:r {file} - insert from file


command:
u - undo
yy - yank (copy) a line
y{motion} - yank text that {motion} moves over
p - paste after cursor
P - paste before cursor
<Del> or x - delete a character
dd - delete a line
d{motion} - delete text that {motion} moves over


command:
:s/foo/bar/ - replace the first match of 'foo' with 'bar' on the current line only
:s/foo/bar/g - replace all matches (`g` flag) of 'foo' with 'bar' on the current line only
:%s/foo/bar/g - replace all matches of 'foo' with 'bar' in the entire file (`:%s`)
:%s/foo/bar/gc - ask to manually confirm (`c` flag) each replacement


command:
:e filename - edit another file
:split filename - split window and load another file
ctrl-w up arrow - move cursor up a window
ctrl-w ctrl-w - move cursor to another window (cycle)
ctrl-w_ - maximize current window
ctrl-w= - make all equal size
10 ctrl-w+ - increase window size by 10 lines
:vsplit file - vertical split
:sview file - same as split, but readonly
:hide - close current window
:only - keep only this window open
:ls - show current buffers
:b 2 - open buffer #2 in this window


command:
TAB - Indent
C-w - Cut
M-w - Copy
C-y - Paste ("yank")
C-SPACE - Begin selection
C-s - Search/Find
M-% (M-SHIFT-5) - Replace
C-x C-s - Save
C-x C-w - Save as
C-x C-f - Load/Open
C-x u - Undo
C-x h - Highlight all text
C-x d - Directory listing
C-g - Cancel a command
C-x C-+ - Font size bigger
C-x C-- - Font size smaller


command:
C-x 2 - Split screen vertically
C-u 5 C-x 2 - Split screen vertically with 5 row height
C-x 3 - Split screen horizontally
C-u 24 C-x 3 - Split screen horizontally with 24 column width
C-x 1 - Revert to single screen
C-x 0 - Hide the current screen
C-x o - Move to the next screen
C-x k - Kill the current buffer
C-x b - Select a buffer
C-x C-e - Run command in the scratch buffer


command:
C-b, C-f - Character-wise
M-b, M-f - Word-wise
C-p, C-n - Line-wise
M-a, M-e - Sentence-wise
M-{ , M-} - Paragraph-wise
C-M-a, C-M-e - Function-wise
C-a, C-e - Line beginning / end


command:
M-x eshell - Open a shell
M-x goto-line - Goto a line number
M-x toggle-word-wrap - Word wrap
M-x flyspell-mode - Spell checking
M-x linum-mode - Line numbers
M-x visual-line-mode - Toggle line wrap
M-x compile - Compile some code
M-x package-list-packages - List packages


command:
Ctrl+G - Show help menu
Ctrl+C - Show current line number and file information
Ctrl+W - Find a word or phrase. Hit Ctrl+R to move into replace mode. Alternatively hit Ctrl+T to go to a specific line


command:
← ↑ → → - Move the cursor
Ctrl+A - Move to beginning of line
Ctrl+E - Move to end of line
Ctrl+Y - Move down a page
Ctrl+V - Move up a page
Ctrl+_ - Move to a specific line
Ctrl+C - Find out what line the cursor is currently on


command:
Ctrl+X - Exit nano. You will be prompted to save your file if you haven't
Ctrl+O - Save a contents without exiting. Hit Ctrl+T to select an existing file
Ctrl+R - Read a text file. Hit Ctrl+T to select an existing file
Ctrl+T - When saving or reading a file, opens a browser that allows you to select a filename from a list of files and directories


command:
Ctrl+K - Cut a line into the clipboard. You can press this repeatedly to cut multiple lines
Ctrl+U - Uncut text. You can press this repeatedly to past multiple to past multiple time
BackSpace - Delete character currently in front of the cursor
Ctrl+D - Delete character currently under the cursor
Ctrl+J - Justify a paragraph of text


command:
Ctrl+f - Move forward a character
Ctrl+b - Move backward a character
Ctrl+p - Move to the previous line
Ctrl+n - Move to the next line
Ctrl+a - Move to the beginning of the current line
Ctrl+e - Move to the end of the current line
Ctrl+v - Move forward one page
Ctrl+y - Move backward one page


command:
Ctrl+g - View Pico’s online help
Ctrl+x - Exit Pico, saving the file
Ctrl+l - Refresh the display
Ctrl+w - Search for (where is) text
Ctrl+t - Spell check the text
Ctrl+j - Format (justify) the current paragraph


command:
Ctrl+d - Delete the character at the cursor position
Ctrl+^ - Begin selecting text at the cursor.*
Ctrl+k - Remove (cut) selected text or current line
Ctrl+u - Paste (uncut) last cut text at the cursor position
Ctrl+i - Insert a tab at the current cursor position
Ctrl+r - Insert (read in) a file at the cursor
Ctrl+o - Write (output) the buffer to a file, saving it


mans: rogue
command:
rogue\n\n
 ----------------\n
 |..............|\n
 |..............+\n
 |......@.......|\n
 |..............|\n
 -------+--------\n
        #\n
        #\n
        #\n
     ####\n
     ##       -------------\n
      #       |...........|\n
     #########+...........+\n
         #    -----+-------\n
         #         #\n
                 --+--------\n
                 |.........+\n
                 |.........|\n
                 |..%......|\n
                 |.........|\n
                 -----------\n
\n
Level: 1 Gold: 0 Hp: 12(12) Str: 16(16) Arm: 4 Exp: 1/0


mans: nudoku
command:
nudoku\n\n
┌─┬─┬─┬─┬─┬─┬─┬─┬─┐
│8│7│ │ │ │5│4│ │ │
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│5│2│4│ │ │ │1│8│7│
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│1│9│6│4│8│7│3│5│ │
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│2│5│7│9│3│4│6│1│8│
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│ │4│ │ │ │ │5│2│ │
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│ │ │9│2│ │1│7│ │ │
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│7│ │5│8│ │2│ │3│4│
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│ │3│ │ │9│6│8│ │1│
├─┼─┼─┼─┼─┼─┼─┼─┼─┤
│9│1│8│ │4│ │ │6│5│
└─┴─┴─┴─┴─┴─┴─┴─┴─┘


mans: 2048
command:
2048\n\n
Score: 60\n
   Hi: 60\n
-----------------------------\n
|   16 |    4 |    8 |    2 |\n
|    8 |    2 |    2 |      |\n
|    2 |      |      |      |\n
|      |      |      |    2 |\n
-----------------------------


mans: pacman4console
command:
pacman4console\n\n
  .......&....  ............\n
  .    .     .  .     .    . \n
  *    .     .  .     .    * \n
  .    .     .  .     .    . \n
  .    .     .  .     .    . \n
  .......................... \n
  .    .  .        .  .    . \n
  .    .  .        .  .    . \n
  ......  ....  ....  ...... \n
       .              .      \n
       .              .      \n
       .              .      \n
       .              .      \n
       .     &&       .      \n
       .        &     .      \n
       .              .      \n
       .              .      \n
       .              .      \n
  ............  ............ \n
  .    .     .  .     .    . \n
  .    .     .  .     .    . \n
  *..  C        .......  ..* \n
    .  .  .        .  .  .   \n
    .  .  .        .  .  .   \n
  ......  ....  ....  ...... \n
  .          .  .          . \n
  .......................... \n
\n
  C C C   \n
   Level: 1     Score: 8 \n


mans: nbmines
command:
nbmines\n\n
|\/|     Flags:0\n
|  |INES Mines:10\n
┌───────────────┐\n
│          1 . .│\n
│          1 . .│\n
│          1 2 2│\n
│               │\n
│  1 1 2 2 2 1  │\n
│  2 . 3 . . 2  │\n
│2 4 . . . . 3  │\n
│. . . . . . 2  │\n
└───────────────┘


mans: nbbattleship
command:
nbbattleship\n
 _\n
|_)  3: 6\n
|_)ATTLESHIP\n
┌───────────────┐┌──────────┐\n
│~ ~ ~ ~ ~ ~ ~ O││..........│\n
│~ ~ ~ ~ ~ ~ ~ ~││......~...│\n
│# ~ ~ ~ ~ ~ ~ ~││.~..~.....│\n
│~ ~ ~ ~ ~ X ~ ~││...~......│\n
│~ # # # # X ~ ~││..........│\n
│~ ~ ~ ~ ~ X O O││...~......│\n
│X # ~ ~ ~ X ~ ~││*.........│\n
│~ ~ ~ ~ ~ X ~ ~││*.........│\n
│# # # ~ ~ ~ ~ ~││*~........│\n
│~ ~ ~ ~ ~ ~ ~ ~││..........│\n
└───────────────┘└──────────┘


mans: nbcheckers
command:
nbcheckers\n
 .-.\n
|  '   8:10\n
'._,HECKERS \n
┌───────────────┐\n
│  O   O   .   .│\n
│O   O   O   .  │\n
│  O   .   O   .│\n
│.   O   .   .  │\n
│  .   .   .   O│\n
│O   O   .   .  │\n
│  O   O   O   O│\n
│O   .   O   O  │\n
└───────────────┘


mans: nbfifteen
command:
nbfifteen\n
.--\n
|__\n
|  IFTEEN\n
┌───────┐\n
│1 2 3 8│\n
│f 7   4│\n
│a e b c│\n
│9 5 6 d│\n
└───────┘


mans: nbmemoblocks
command:
nbmemoblocks\n
.  .      _\n
|\/|     |_)\n
|  |EMORY|_)LOCKS\n
┌────────────────┐\n
│................│\n
│................│\n
│......i..i......│\n
│...a...6........│\n
│.$...$..........│\n
│...............6│\n
│a...............│\n
│........,.......│\n
└────────────────┘


mans: nbpipes
command:
nbpipes\n\n
 _     ┌────────────────────┐\n
|_)    │└ ┼┼┘┘└┐┌└┐┘┌┐┘┐┼┘┘┌│\n
| IPES │└┐└┘┐└┘ ┌─────────┐┌│\n
       │┌┌ ┘└┌┐ │┌───┐    │┘│\n
Score: │┌┌ ┐ ┘└ ││   │ ┼┐ │└│\n
13     │└ ┌ ┌──<│└──┐│┐└┘ │└│\n
       │┘ ┌─┘   │   ││┐ ┘┐│┘│\n
    └  │└ │ ┌┐  │   ││┘┘┌┐│ │\n
    ┐  │─ │ ││  │   │└──┘└┘─│\n
    ┐  │┌ │ ││  │   │ ┘ ┐└└┐│\n
    ─  │┐ └┐││ ││   │ ┐ └┐┼┘│\n
    └  │┘ ┌┘││ ││   └┐ └┌ ┐┘│\n
       │┌ │ │└─┘│    │  ┐ ┌┐│\n
       │┐ │ └───┘    │ ┐└ ┐┌│\n
       │┼ └──────────┘  ┌ ┘┐│\n
       └────────────────────┘


mans: nbreversi
command:
nbreversi\n
 _\n
|_)  5:18\n
| \EVERSI \n
┌───────────────┐\n
│. X . X X X X X│\n
│. . X . O O . .│\n
│. X . X O . . .│\n
│. . X O X . . .│\n
│. . . X X O . .│\n
│. . X X X . . .│\n
│. . . . X . . .│\n
│. . . . X . . .│\n
└───────────────┘


mans: nbsos
command:
nbsos\n
 _  _  _\n
(_'| |(_'  9 vs 2\n
._):_:._)\n
┌───────────┐\n
│_ _ _ _ S _│\n
│_ S O S O _│\n
│S O S O S _│\n
│_ S O S O _│\n
│S O S O S _│\n
└───────────┘


mans: nbsudoku
command:
nbsudoku\n
 _\n
(_       Solved:40/81\n
 _)UDOKU Left  :41/81\n
┌─────┬─────┬─────┐\n
│5    │  7 6│9    │\n
│  8 7│1    │  4 5│\n
│  9 1│4    │  7 6│\n
├─────┼─────┼─────┤\n
│4    │  8 5│1    │\n
│  6 9│2    │  5 7│\n
│1    │  9 7│4    │\n
├─────┼─────┼─────┤\n
│7    │  2 8│5    │\n
│2    │  4 3│6    │\n
│  3 4│5    │  8 2│\n
└─────┴─────┴─────┘


mans: curl,sed
command:
curl -s https://api.github.com/users/<username>/repos?per_page=1000 |grep git_url |awk '{print $2}'| sed 's/"\(.*\)",/\1/'


mans: ffmpeg,grep
command:
ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r 30 -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -i :0.0 -acodec pcm_s16le output.wav -an -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mp4


mans: paste,while,read,mv
command:
paste -d: <(ls -1 *.mp4) <(ls -1 *.srt) | while read line; do movie="${line%%:*}"; subtitle="${line##*:}"; mv "${subtitle}" "${movie%.*}.srt"; done


mans: while,true,read,next,if,echo
command:
count="1" ; while true ; do read next ; if [[ "$next" = "$last" ]] ; then count=$(($count+1)) ; echo "$count" ; else count="1" ; echo $count ; fi ; last="$next" ; done


mans: curl,tr,grep,sed,bc
command:
username=matthewbauer; curl -s http://www.commandlinefu.com/commands/by/$username/json | tr '{' '\n' | grep -Eo ',"votes":"[0-9\-]+","' | grep -Eo '[0-9\-]+' | tr '\n' '+' | sed 's/+$/\n/' | bc


mans: grep,awk,uniq,xargs,apt-get
command:
grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq | xargs apt-get -y remove


command:
Up - CursorUp
Down - CursorDown
Right - CursorRight
Left - CursorLeft
ShiftUp - SelectUp
ShiftDown - SelectDown
ShiftLeft - SelectLeft
ShiftRight - SelectRight
AltLeft - WordLeft - (Mac)
AltRight - WordRight - (Mac)
AltUp - MoveLinesUp
AltDown - MoveLinesDown
CtrlShiftRight - SelectWordRight
CtrlShiftLeft - SelectWordLeft
AltLeft - StartOfTextToggle
AltRight - EndOfLine
AltShiftRight - SelectWordRight - (Mac)
AltShiftLeft - SelectWordLeft - (Mac)
CtrlLeft - StartOfText - (Mac)
CtrlRight - EndOfLine - (Mac)
AltShiftLeft - SelectToStartOfTextToggle
CtrlShiftLeft - SelectToStartOfTextToggle - (Mac)
ShiftHome - SelectToStartOfTextToggle
AltShiftRight - SelectToEndOfLine
CtrlShiftRight - SelectToEndOfLine - (Mac)
ShiftEnd - SelectToEndOfLine
CtrlUp - CursorStart
CtrlDown - CursorEnd
CtrlShiftUpSelectToStart
CtrlShiftDown - SelectToEnd
Alt-{ - ParagraphPrevious
Alt-} - ParagraphNext
Enter - InsertNewline
Ctrl-h - Backspace
Backspace - Backspace
Alt-CtrlH - DeleteWordLeft
Alt-Backspace - DeleteWordLeft
Tab - Autocomplete|IndentSelection|InsertTab
Backtab - OutdentSelection|OutdentLine
Ctrl-o - OpenFile
Ctrl-s - Save
Ctrl-f - Find
Alt-F - FindLiteral
Ctrl-n - FindNext
Ctrl-p - FindPrevious
Ctrl-z - Undo
Ctrl-y - Redo
Ctrl-c - CopyLine|Copy
Ctrl-x - Cut
Ctrl-k - CutLine
Ctrl-d - DuplicateLine
Ctrl-v - Paste
Ctrl-a - SelectAll
Ctrl-t - AddTab
Alt-, - PreviousTab
Alt-. - NextTab
Home - StartOfText
End - EndOfLine
CtrlHome - CursorStart
CtrlEnd - CursorEnd
PageUp - CursorPageUp
PageDown - CursorPageDown
CtrlPageUp - PreviousTab
CtrlPageDown - NextTab
Ctrl-g - ToggleHelp
Alt-g - ToggleKeyMenu
Ctrl-r - ToggleRuler
Ctrl-l - command-edit:goto - 
Delete - Delete
Ctrl-b - ShellMode
Ctrl-q - Quit
Ctrl-e - CommandMode
Ctrl-w - NextSplit
Ctrl-u - ToggleMacro
Ctrl-j - PlayMacro
Insert - ToggleOverwriteMode


command:
MouseWheelUp - ScrollUp
MouseWheelDown - ScrollDown
MouseLeft - MousePress
MouseMiddle - PastePrimary
Ctrl-MouseLeft - MouseMultiCursor
Alt-n - SpawnMultiCursor
AltShiftUp - SpawnMultiCursorUp
AltShiftDown - SpawnMultiCursorDown
Alt-m - SpawnMultiCursorSelect
Alt-p - RemoveMultiCursor
Alt-c - RemoveAllMultiCursors
Alt-x - SkipMultiCursor


mans: gnuchess
command:
gnuchess\n
\n
White (1) : Nf3\n
1. Nf3\n
\n
black  KQkq\n
\n
r n b q k b n r \n
p p p p p p p p \n
. . . . . . . . \n
. . . . . . . . \n
. . . . . . . . \n
. . . . . N . . \n
P P P P P P P P \n
R N B Q K B . R \n
 \n
Thinking...\n
\n
white  KQkq\n
\n
r n b q k b . r \n
p p p p p p p p \n
. . . . . n . . \n
. . . . . . . . \n
. . . . . . . . \n
. . . . . N . . \n
P P P P P P P P \n
R N B Q K B . R \n
 \n
My move is : Nf6\n
White (2) : 


# BasicGroup

description:
type partial command, kill this command, check something you forgot, yank the command, resume typing.


description:
A fun thing to do with ram is actually open it up and take a peek. This command will show you all the string (plain text) values in ram


description:
Given a file path, unplug the USB device on which the file is located (the file must be on an USB device !)


description:
Silently ensures that a FS is mounted on the given mount point (checks if it's OK, otherwise unmount, create dir and mount)


description:
sniff network traffic on a given interface and displays the IP addresses of the machines communicating with the current host (one IP per line)


description:
DELETE all those duplicate files but one based on md5 hash comparision in the current directory tree


description:
Remove executable bit from all files in the current directory recursively, excluding other directories


description:
Move all images in a directory into a directory hierarchy based on year, month and day based on exif information


description:
Typing the current date ( or any string ) via a shortcut as if the keys had been actually typed with the hardware keyboard in any application.


description:
Create an SSH SOCKS proxy server on localhost:8000 that will re-start itself if something breaks the connection temporarily


description:
Execute a command, convert output to .png file, upload file to imgur.com, then returning the address of the .png.


description:
VIM: Replace a string with an incrementing number between marks 'a and 'b (eg, convert string ZZZZ to 1, 2, 3, ...)


description:
Find recursively, from current directory down, files and directories whose names contain single or multiple whitespaces and replace each such occurrence with a single underscore.


description:
Get the total length of time in hours:minutes:seconds (HH:MM:SS) of all video (or audio) in the current dir (and below)


description:
!* Tells that you want all of the *arguments* from the previous command to be repeated in the current command


# CommandSection

title: OPTIONS
content:
<p><b>-h</b>, <b>--help</b></p> <p>show this help message and exit</p> <p><b>-d</b>, <b>--doctests_only</b></p> <p>Fix up doctests only</p> <p><b>-f</b> FIX, <b>--fix</b>=<i>FIX</i></p> <p>Each FIX specifies a transformation; default: all</p> <p><b>-j</b> PROCESSES, <b>--processes</b>=<i>PROCESSES</i></p> <p>Run 2to3 concurrently</p> <p><b>-x</b> NOFIX, <b>--nofix</b>=<i>NOFIX</i></p> <p>Prevent a transformation from being run</p> <p><b>-l</b>, <b>--list-fixes</b></p> <p>List available transformations</p> <p><b>-p</b>, <b>--print-function</b></p> <p>Modify the grammar so that print() is a function</p> <p><b>-v</b>, <b>--verbose</b></p> <p>More verbose logging</p> <p><b>--no-diffs</b></p> <p>Don&rsquo;t show diffs of the refactoring</p> <p><b>-w</b>, <b>--write</b></p> <p>Write back modified files</p> <p><b>-n</b>, <b>--nobackups</b></p> <p>Don&rsquo;t write backups for modified files</p>


title: TLDR
content:
<b>Install the latest stable version of a formula or cask</b>`brew install [formula|cask]`<br><b>List all installed formulae and casks</b>`brew list`<br><b>Upgrade an installed formula or cask (if none is given, all installed formulae/casks are upgraded)</b>`brew upgrade [formula|cask]`<br><b>Fetch the newest version of Homebrew and of all formulae and casks from the Homebrew source repository</b>`brew update`<br><b>Show formulae and casks that have a more recent version available</b>`brew outdated`<br><b>Search for available formulae (i.e. packages) and casks (i.e. native macOS .app packages)</b>`brew search [text]`<br><b>Display information about a formula or a cask (version, installation path, dependencies, etc.)</b>`brew info [formula|cask]`<br><b>Check the local Homebrew installation for potential problems</b>`brew doctor`


title: TLDR
content:
<b>Remove a user</b>`sudo userdel [username]`<br><b>Remove a user in other root directory</b>`sudo userdel [[-R|--root]] [path/to/other_root] [username]`<br><b>Remove a user along with the home directory and mail spool</b>`sudo userdel [[-r|--remove]] [username]`


title: TLDR
content:
<b>Encode a file</b>`base32 [path/to/file]`<br><b>Wrap encoded output at a specific width (0 disables wrapping)</b>`base32 [[-w|--wrap]] [0|76|...] [path/to/file]`<br><b>Decode a file</b>`base32 [[-d|--decode]] [path/to/file]`<br><b>Encode from stdin</b>`[command] | base32`<br><b>Decode from stdin</b>`[command] | base32 [[-d|--decode]]`


title: TLDR
content:
<b>Check whether the adb server process is running and start it</b>`adb start-server`<br><b>Terminate the adb server process</b>`adb kill-server`<br><b>Start a remote shell in the target emulator/device instance</b>`adb shell`<br><b>Push an Android application to an emulator/device</b>`adb install -r [path/to/file.apk]`<br><b>Copy a file/directory from the target device</b>`adb pull [path/to/device_file_or_directory] [path/to/local_destination_directory]`<br><b>Copy a file/directory to the target device</b>`adb push [path/to/local_file_or_directory] [path/to/device_destination_directory]`<br><b>List all connected devices</b>`adb devices`<br><b>Specify which device to send commands to if there are multiple devices</b>`adb -s [device_ID] [shell]`


title: TLDR
content:
<b>Display the default question dialog</b>`zenity --question`<br><b>Display an info dialog displaying the text "Hello!"</b>`zenity --info --text="[Hello!]"`<br><b>Display a name/password form and output the data separated by ";"</b>`zenity --forms --add-entry="[Name]" --add-password="[Password]" --separator="[;]"`<br><b>Display a file selection form in which the user can only select directories</b>`zenity --file-selection --directory`<br><b>Display a progress bar which updates its message every second and show a progress percent</b>`[(echo "#1"; sleep 1; echo "50"; echo "#2"; sleep 1; echo "100")] | zenity --progress`


title: TLDR
content:
<b>Dump the /var/log/wtmp file to stdout as plain text</b>`utmpdump [/var/log/wtmp]`<br><b>Load a previously dumped file into /var/log/wtmp</b>`utmpdump [[-r|--reverse]] [dumpfile] > [/var/log/wtmp]`


title: TLDR
content:
<b>Display the current state of the system (known screens, resolutions, ...)</b>`xrandr [[-q|--query]]`<br><b>Disable disconnected outputs and enable connected ones with default settings</b>`xrandr --auto`<br><b>Change the resolution and update frequency of DisplayPort 1 to 1920x1080, 60Hz</b>`xrandr --output DP1 --mode 1920x1080 [[-r|--rate]] 60`<br><b>Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1</b>`xrandr --output HDMI2 --mode 1280x1024 --right-of DP1`<br><b>Disable the VGA1 output</b>`xrandr --output VGA1 --off`<br><b>Set the brightness for LVDS1 to 50%</b>`xrandr --output LVDS1 --brightness 0.5`<br><b>Display the current state of any X server</b>`xrandr [[-d|--display]] :[0] [[-q|--query]]`


title: TLDR
content:
<b>[a]dd a file or directory to a new or existing archive</b>`7z a [path/to/archive.7z] [path/to/file_or_directory]`<br><b>Encrypt an existing archive (including filenames)</b>`7z a [path/to/encrypted.7z] -p[password] -mhe=on [path/to/archive.7z]`<br><b>E[x]tract an archive preserving the original directory structure</b>`7z x [path/to/archive.7z]`<br><b>E[x]tract an archive to a specific directory</b>`7z x [path/to/archive.7z] -o[path/to/output]`<br><b>E[x]tract an archive to stdout</b>`7z x [path/to/archive.7z] -so`<br><b>[a]rchive using a specific archive type</b>`7z a -t[7z|bzip2|gzip|lzip|tar|zip] [path/to/archive] [path/to/file_or_directory]`<br><b>[l]ist the contents of an archive</b>`7z l [path/to/archive.7z]`<br><b>Set the level of compression (higher means more compression, but slower)</b>`7z a [path/to/archive.7z] -mx=[0|1|3|5|7|9] [path/to/file_or_directory]`


title: TLDR
content:
<b>Change a username</b>`sudo usermod [[-l|--login]] [new_username] [username]`<br><b>Change a user ID</b>`sudo usermod [[-u|--uid]] [id] [username]`<br><b>Change a user shell</b>`sudo usermod [[-s|--shell]] [path/to/shell] [username]`<br><b>Add a user to supplementary groups (mind the lack of whitespace)</b>`sudo usermod [[-aG|--append --groups]] [group1,group2,...] [username]`<br><b>Remove a user from specific groups</b>`sudo usermod [[-rG|--remove --groups]] [group1,group2,...] [username]`<br><b>Change a user home directory</b>`sudo usermod [[-m|--move-home]] [[-d|--home]] [path/to/new_home] [username]`<br><b>Lock an account</b>`sudo usermod [[-L|--lock]] [username]`<br><b>Unlock an account</b>`sudo usermod [[-U|--unlock]] [username]`


title: TLDR
content:
<b>Add a new apt repository</b>`add-apt-repository [repository_spec]`<br><b>Remove an apt repository</b>`add-apt-repository [[-r|--remove]] [repository_spec]`<br><b>Update the package cache after adding a repository</b>`add-apt-repository --update [repository_spec]`<br><b>Allow source packages to be downloaded from the repository</b>`add-apt-repository [[-s|--enable-source]] [repository_spec]`


title: TLDR
content:
<b>Execute 100 HTTP GET requests to a given URL</b>`ab -n 100 [url]`<br><b>Execute 100 HTTP GET requests, in concurrent batches of 10, to a URL</b>`ab -n 100 -c 10 [url]`<br><b>Execute 100 HTTP POST requests to a URL, using a JSON payload from a file</b>`ab -n 100 -T [application/json] -p [path/to/file.json] [url]`<br><b>Use HTTP [k]eep-Alive, i.e. perform multiple requests within one HTTP session</b>`ab -k [url]`<br><b>Set the maximum number of seconds ([t]imeout) to spend for benchmarking (30 by default)</b>`ab -t [60] [url]`<br><b>Write the results to a CSV file</b>`ab -e [path/to/file.csv]`


title: TLDR
content:
<b>List all aliases</b>`alias`<br><b>Create a generic alias</b>`alias [word]="[command]"`<br><b>View the command associated to a given alias</b>`alias [word]`<br><b>Remove an aliased command</b>`unalias [word]`<br><b>Turn rm into an interactive command</b>`alias [rm]="[rm --interactive]"`<br><b>Create la as a shortcut for ls --all</b>`alias [la]="[ls --all]"`


title: TLDR
content:
<b>Create random passwords (default password length is 8)</b>`apg`<br><b>Create a password with at least 1 symbol (S), 1 number (N), 1 uppercase (C), 1 lowercase (L)</b>`apg -M SNCL`<br><b>Create a password with 16 characters</b>`apg -m [16]`<br><b>Create a password with maximum length of 16</b>`apg -x [16]`<br><b>Create a password that doesn't appear in a dictionary (the dictionary file has to be provided)</b>`apg -r [path/to/dictionary_file]`


title: TLDR
content:
<b>Update the list of available packages and versions (recommended before running other apt commands)</b>`sudo apt update`<br><b>Search packages by name or description</b>`apt search [package]`<br><b>Search packages by name only (supports wildcards like *)</b>`apt list [package]`<br><b>Show detailed information about a package</b>`apt show [package]`<br><b>Install a package, or update it to the latest version</b>`sudo apt install [package]`<br><b>Remove a package (use purge instead to also remove configuration files)</b>`sudo apt remove [package]`<br><b>Upgrade all installed packages to their latest versions</b>`sudo apt upgrade`<br><b>List all installed packages</b>`apt list [[-i|--installed]]`


title: TLDR
content:
<b>Search for a package in your current sources</b>`apt-cache search [query]`<br><b>Show information about a package</b>`apt-cache show [package]`<br><b>Show whether a package is installed and up to date</b>`apt-cache policy [package]`<br><b>Show dependencies for a package</b>`apt-cache depends [package]`<br><b>Show packages that depend on a particular package</b>`apt-cache rdepends [package]`


title: TLDR
content:
<b>Update the list of available packages and versions (it's recommended to run this before other apt-get commands)</b>`sudo apt-get update`<br><b>Install a package, or update it to the latest available version</b>`sudo apt-get install [package]`<br><b>Remove a package</b>`sudo apt-get remove [package]`<br><b>Remove a package and its configuration files</b>`sudo apt-get purge [package]`<br><b>Upgrade all installed packages to their newest available versions</b>`sudo apt-get upgrade`<br><b>Clean the local repository - removing package files (.deb) from interrupted downloads that can no longer be downloaded</b>`apt-get autoclean`<br><b>Remove all packages that are no longer needed</b>`sudo apt-get autoremove`<br><b>Upgrade installed packages (like upgrade), but remove obsolete packages and install additional packages to meet new dependencies</b>`sudo apt-get dist-upgrade`


title: TLDR
content:
<b>List trusted keys</b>`apt-key list`<br><b>Add a key to the trusted keystore</b>`apt-key add [public_key_file.asc]`<br><b>Delete a key from the trusted keystore</b>`apt-key del [key_id]`<br><b>Add a remote key to the trusted keystore</b>`wget [[-qO|--quiet --output-document]] - [https://host.tld/filename.key] | apt-key add -`<br><b>Add a key from keyserver with only key ID</b>`apt-key adv --keyserver [pgp.mit.edu] --recv [KEYID]`


title: TLDR
content:
<b>Print current time, uptime, number of logged-in users and other information</b>`uptime`<br><b>Show only the amount of time the system has been booted for</b>`uptime [[-p|--pretty]]`<br><b>Print the date and time the system booted up at</b>`uptime [[-s|--since]]`<br><b>Display version</b>`uptime [[-V|--version]]`


title: TLDR
content:
<b>Show current host name</b>`hostname`<br><b>Show the network address of the host name</b>`hostname [[-i|--ip-address]]`<br><b>Show the FQDN (Fully Qualified Domain Name)</b>`hostname [[-f|--fqdn]]`<br><b>Set current host name</b>`hostname [new_hostname]`


title: TLDR
content:
<b>Turn up the master volume by 10%</b>`amixer -D pulse sset Master [10%+]`<br><b>Turn down the master volume by 10%</b>`amixer -D pulse sset Master [10%-]`


title: TLDR
content:
<b>Start the Apache daemon. Throw a message if it is already running</b>`sudo apache2ctl start`<br><b>Stop the Apache daemon</b>`sudo apache2ctl stop`<br><b>Restart the Apache daemon</b>`sudo apache2ctl restart`<br><b>Test syntax of the configuration file</b>`sudo apache2ctl -t`<br><b>List loaded modules</b>`sudo apache2ctl -M`


title: TLDR
content:
<b>Ping a host by ARP request packets</b>`arping [host_ip]`<br><b>Ping a host on a specific [I]nterface</b>`arping -I [interface] [host_ip]`<br><b>Ping a host and [f]inish after the first reply</b>`arping -f [host_ip]`<br><b>Ping a host a specific number ([c]ount) of times</b>`arping -c [count] [host_ip]`<br><b>Broadcast ARP request packets to update neighbours' ARP caches ([U]nsolicited ARP mode)</b>`arping -U [ip_to_broadcast]`<br><b>[D]etect duplicated IP addresses in the network by sending ARP requests with a 3 second timeout</b>`arping -D -w [3] [ip_to_check]`


title: TLDR
content:
<b>Spell check a single file</b>`aspell check [path/to/file]`<br><b>List misspelled words from stdin</b>`cat [path/to/file] | aspell list`<br><b>Show available dictionary languages</b>`aspell dicts`<br><b>Run aspell with a different language (takes two-letter ISO 639 language code)</b>`aspell --lang [cs]`<br><b>List misspelled words from stdin and ignore words from personal word list</b>`cat [path/to/file] | aspell --personal [personal-word-list.pws] list`


title: TLDR
content:
<b>Create commands interactively and execute them in 5 minutes (press <Ctrl d> when done)</b>`at now + 5 minutes`<br><b>Create commands interactively and execute them at a specific time</b>`at [hh:mm]`<br><b>Execute a command from stdin at 10:00 AM today</b>`echo "[command]" | at 1000`<br><b>Execute commands from a given file next Tuesday</b>`at -f [path/to/file] 9:30 PM Tue`<br><b>List all queued jobs for the current user (same as atq)</b>`at -l`<br><b>View a specied job</b>`at -c [job_number]`


title: TLDR
content:
<b>Search for a keyword using a regex</b>`apropos [regex]`<br><b>Search without restricting the output to the terminal width (long output)</b>`apropos [[-l|--long]] [regex]`<br><b>Search for pages that match all the regex given</b>`apropos [regex_1] [[-a|--and]] [regex_2] [[-a|--and]] [regex_3]`


title: TLDR
content:
<b>Scan the current local network</b>`arp-scan [[-l|--localnet]]`<br><b>Scan an IP network with a custom bitmask</b>`arp-scan [192.168.1.1]/[24]`<br><b>Scan an IP network within a custom range</b>`arp-scan [127.0.0.0]-[127.0.0.31]`<br><b>Scan an IP network with a custom net mask</b>`arp-scan [10.0.0.0]:[255.255.255.0]`


title: TLDR
content:
<b>Download a URL to a file</b>`axel [url]`<br><b>Download and specify an output file</b>`axel [url] [[-o|--output]] [path/to/file]`<br><b>Download with a specific number connections</b>`axel [[-n|--num-connections]] [connections_num] [url]`<br><b>Search for mirrors</b>`axel [[-S|--search]] [mirrors_num] [url]`<br><b>Limit download speed (bytes per second)</b>`axel [[-s|--max-speed]] [speed] [url]`


title: TLDR
content:
<b>Start an interactive shell session</b>`bash`<br><b>Start an interactive shell session without loading startup configs</b>`bash --norc`<br><b>Execute specific [c]ommands</b>`bash -c "[echo 'bash is executed']"`<br><b>Execute a specific script</b>`bash [path/to/script.sh]`<br><b>E[x]ecute a specific script, printing each command before executing it</b>`bash -x [path/to/script.sh]`<br><b>Execute a specific script and stop at the first [e]rror</b>`bash -e [path/to/script.sh]`<br><b>Execute specific commands from stdin</b>`[echo "echo 'bash is executed'"] | bash`<br><b>Start a [r]estricted shell session</b>`bash -r`


title: TLDR
content:
<b>Calculate the BLAKE2 checksum for one or more files</b>`b2sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of BLAKE2 checksums to a file</b>`b2sum [path/to/file1 path/to/file2 ...] > [path/to/file.b2]`<br><b>Calculate a BLAKE2 checksum from stdin</b>`[command] | b2sum`<br><b>Read a file of BLAKE2 checksums and filenames and verify all files have matching checksums</b>`b2sum [[-c|--check]] [path/to/file.b2]`<br><b>Only show a message for missing files or when verification fails</b>`b2sum [[-c|--check]] --quiet [path/to/file.b2]`<br><b>Only show a message when verification fails, ignoring missing files</b>`b2sum --ignore-missing [[-c|--check]] --quiet [path/to/file.b2]`<br><b>Check a known BLAKE2 checksum of a file</b>`echo [known_blake2_checksum_of_the_file] [path/to/file] | b2sum [[-c|--check]]`


title: TLDR
content:
<b>Play a beep</b>`beep`<br><b>Play a beep that repeats</b>`beep -r [repetitions]`<br><b>Play a beep at a specified frequency (Hz) and duration (milliseconds)</b>`beep -f [frequency] -l [duration]`<br><b>Play each new frequency and duration as a distinct beep</b>`beep -f [frequency] -l [duration] [[-n|--new]] -f [frequency] -l [duration]`<br><b>Play the C major scale</b>`beep -f [262] [[-n|--new]] -f [294] [[-n|--new]] -f [330] [[-n|--new]] -f [349] [[-n|--new]] -f [392] [[-n|--new]] -f [440] [[-n|--new]] -f [494] [[-n|--new]] -f [523]`


title: TLDR
content:
<b>Encode a file</b>`base64 [path/to/file]`<br><b>Wrap encoded output at a specific width (0 disables wrapping)</b>`base64 [[-w|--wrap]] [0|76|...] [path/to/file]`<br><b>Decode a file</b>`base64 [[-d|--decode]] [path/to/file]`<br><b>Encode from stdin</b>`[command] | base64`<br><b>Decode from stdin</b>`[command] | base64 [[-d|--decode]]`


title: TLDR
content:
<b>Execute commands from stdin (press <Ctrl d> when done)</b>`batch`<br><b>Execute a command from stdin</b>`echo "[./make_db_backup.sh]" | batch`


title: TLDR
content:
<b>Install all gems defined in the Gemfile expected in the working directory</b>`bundle install`<br><b>Execute a command in the context of the current bundle</b>`bundle exec [command] [arguments]`<br><b>Update all gems by the rules defined in the Gemfile and regenerate Gemfile.lock</b>`bundle update`<br><b>Update one or more specific gem(s) defined in the Gemfile</b>`bundle update [gem_name1] [gem_name2]`<br><b>Update one or more specific gems(s) defined in the Gemfile but only to the next patch version</b>`bundle update --patch [gem_name1] [gem_name2]`<br><b>Update all gems within the given group in the Gemfile</b>`bundle update --group [development]`<br><b>List installed gems in the Gemfile with newer versions available</b>`bundle outdated`<br><b>Create a new gem skeleton</b>`bundle gem [gem_name]`


title: TLDR
content:
<b>Compress a file</b>`bzip2 [path/to/file_to_compress]`<br><b>Decompress a file</b>`bzip2 [[-d|--decompress]] [path/to/compressed_file.bz2]`<br><b>Decompress a file to stdout</b>`bzip2 [[-dc|--decompress --stdout]] [path/to/compressed_file.bz2]`<br><b>Test the integrity of each file inside the archive file</b>`bzip2 [[-t|--test]] [path/to/compressed_file.bz2]`<br><b>Show the compression ratio for each file processed with detailed information</b>`bzip2 [[-v|--verbose]] [path/to/compressed_files.bz2]`<br><b>Decompress a file overwriting existing files</b>`bzip2 [[-f|--force]] [path/to/compressed_file.bz2]`<br><b>Display help</b>`bzip2 [[-h|--help]]`


title: TLDR
content:
<b>Search a disk for bad blocks by using a non-destructive read-only test</b>`sudo badblocks [/dev/sdX]`<br><b>Search an unmounted disk for bad blocks with a [n]on-destructive read-write test</b>`sudo badblocks -n [/dev/sdX]`<br><b>Search an unmounted disk for bad blocks with a destructive [w]rite test</b>`sudo badblocks -w [/dev/sdX]`<br><b>Use the destructive [w]rite test and [s]how [v]erbose progress</b>`sudo badblocks -svw [/dev/sdX]`<br><b>In destructive mode, [o]utput found blocks to a file</b>`sudo badblocks -o [path/to/file] -w [/dev/sdX]`<br><b>Use the destructive mode with improved speed using 4K [b]lock size and 64K block [c]ount</b>`sudo badblocks -w -b [4096] -c [65536] [/dev/sdX]`


title: TLDR
content:
<b>List all partitions</b>`sudo blkid`<br><b>List all partitions in a table, including current mountpoints</b>`sudo blkid [[-o|--output]] list`<br><b>Get the UUID of the filesystem on a partition</b>`sudo blkid [[-s|--match-tag]] UUID [[-o|--output]] value [/dev/sdXY]`


title: TLDR
content:
<b>Display a calendar for the current month</b>`cal`<br><b>Display a calendar for a specific year</b>`cal [year]`<br><b>Display a calendar for a specific month and year</b>`cal [month] [year]`


title: TLDR
content:
<b>Start an interactive session</b>`bc`<br><b>Start an interactive session with the standard math library enabled</b>`bc [[-i|--interactive]] [[-l|--mathlib]]`<br><b>Calculate an expression</b>`echo '[5 / 3]' | bc`<br><b>Execute a script</b>`bc [path/to/script.bc]`<br><b>Calculate an expression with the specified scale</b>`echo 'scale = [10]; [5 / 3]' | bc`<br><b>Calculate a sine/cosine/arctangent/natural logarithm/exponential function using mathlib</b>`echo '[s|c|a|l|e]([1])' | bc [[-l|--mathlib]]`<br><b>Execute an inline factorial script</b>`echo "define factorial(n) { if (n <= 1) return 1; return n*factorial(n-1); }; factorial([10])" | bc`


title: TLDR
content:
<b>Show last 10 lines in a file</b>`tail [path/to/file]`<br><b>Show last 10 lines of multiple files</b>`tail [path/to/file1 path/to/file2 ...]`<br><b>Show last count lines in file</b>`tail [[-n|--lines]] [count] [path/to/file]`<br><b>Print a file from a specific line number</b>`tail [[-n|--lines]] +[count] [path/to/file]`<br><b>Print a specific count of bytes from the end of a given file</b>`tail [[-c|--bytes]] [count] [path/to/file]`<br><b>Print the last lines of a given file and keep reading it until <Ctrl c></b>`tail [[-f|--follow]] [path/to/file]`<br><b>Keep reading file until <Ctrl c>, even if the file is inaccessible</b>`tail [[-F|--retry --follow]] [path/to/file]`<br><b>Show last count lines in a file and refresh every seconds seconds</b>`tail [[-n|--lines]] [count] [[-s|--sleep-interval]] [seconds] [[-f|--follow]] [path/to/file]`


title: TLDR
content:
<b>Create a new volume group called vg1 using the /dev/sda1 device</b>`vgcreate [vg1] [/dev/sda1]`<br><b>Create a new volume group called vg1 using multiple devices</b>`vgcreate [vg1] [/dev/sda1] [/dev/sdb1] [/dev/sdc1]`


title: TLDR
content:
<b>Make a file or directory [i]mmutable to changes and deletion, even by superuser</b>`chattr +i [path/to/file_or_directory]`<br><b>Make a file or directory mutable</b>`chattr -i [path/to/file_or_directory]`<br><b>[R]ecursively make an entire directory and contents immutable</b>`chattr -R +i [path/to/directory]`<br><b>Mark a directory and its files to be interpreted in a case-insensitive manner (case-[F]olding)</b>`chattr +F [path/to/directory]`<br><b>Set a file to only allow [a]ppending</b>`chattr +a [path/to/file]`


title: TLDR
content:
<b>List password information for the user</b>`chage [[-l|--list]] [username]`<br><b>Enable password expiration in 10 days</b>`sudo chage [[-M|--maxdays]] [10] [username]`<br><b>Disable password expiration</b>`sudo chage [[-M|--maxdays]] [-1] [username]`<br><b>Set account expiration date</b>`sudo chage [[-E|--expiredate]] [YYYY-MM-DD] [username]`<br><b>Force user to change password on next log in</b>`sudo chage [[-d|--lastday]] [0] [username]`<br><b>Re-enable an account</b>`sudo chage [[-E|--expiredate]] -1 [username]`


title: TLDR
content:
<b>Go to the specified directory</b>`cd [path/to/directory]`<br><b>Go up to the parent of the current directory</b>`cd ..`<br><b>Go to the home directory of the current user</b>`cd`<br><b>Go to the home directory of the specified user</b>`cd ~[username]`<br><b>Go to the previously chosen directory</b>`cd -`<br><b>Go to the root directory</b>`cd /`


title: TLDR
content:
<b>View security context of a file</b>`ls [[-lZ|-l --context]] [path/to/file]`<br><b>Change the security context of a target file, using a reference file</b>`chcon --reference [reference_file] [target_file]`<br><b>Change the full SELinux security context of a file</b>`chcon [user]:[role]:[type]:[range/level] [filename]`<br><b>Change only the user part of SELinux security context</b>`chcon [[-u|--user]] [user] [filename]`<br><b>Change only the role part of SELinux security context</b>`chcon [[-r|--role]] [role] [filename]`<br><b>Change only the type part of SELinux security context</b>`chcon [[-t|--type]] [type] [filename]`<br><b>Change only the range/level part of SELinux security context</b>`chcon [[-l|--range]] [range/level] [filename]`


title: TLDR
content:
<b>Update a user's "Name" field in the output of finger</b>`chfn [[-f|--full-name]] [new_display_name] [username]`<br><b>Update a user's "Office Room Number" field for the output of finger</b>`chfn [[-o|--office]] [new_office_room_number] [username]`<br><b>Update a user's "Office Phone Number" field for the output of finger</b>`chfn [[-p|--office-phone]] [new_office_telephone_number] [username]`<br><b>Update a user's "Home Phone Number" field for the output of finger</b>`chfn [[-h|--home-phone]] [new_home_telephone_number] [username]`


title: TLDR
content:
<b>Open a specific URL or file</b>`chromium [https://example.com|path/to/file.html]`<br><b>Open in incognito mode</b>`chromium --incognito [example.com]`<br><b>Open in a new window</b>`chromium --new-window [example.com]`<br><b>Open in application mode (without toolbars, URL bar, buttons, etc.)</b>`chromium --app=[https://example.com]`<br><b>Use a proxy server</b>`chromium --proxy-server="[socks5://hostname:66]" [example.com]`<br><b>Open with a custom profile directory</b>`chromium --user-data-dir=[path/to/directory]`<br><b>Open without CORS validation (useful to test an API)</b>`chromium --user-data-dir=[path/to/directory] --disable-web-security`<br><b>Open with a DevTools window for each tab opened</b>`chromium --auto-open-devtools-for-tabs`


title: TLDR
content:
<b>Change the owner group of a file/directory</b>`chgrp [group] [path/to/file_or_directory]`<br><b>Recursively change the owner group of a directory and its contents</b>`chgrp [[-R|--recursive]] [group] [path/to/directory]`<br><b>Change the owner group of a symbolic link</b>`chgrp [[-h|--no-dereference]] [group] [path/to/symlink]`<br><b>Change the owner group of a file/directory to match a reference file</b>`chgrp --reference [path/to/reference_file] [path/to/file_or_directory]`


title: TLDR
content:
<b>Print a file to the console in rainbow colors</b>`lolcat [path/to/file]`<br><b>Print the result of a text-producing command in rainbow colors</b>`[fortune] | lolcat`<br><b>Print a file to the console with animated rainbow colors</b>`lolcat [[-a|--animate]] [path/to/file]`<br><b>Print a file to the console with 24-bit (truecolor) rainbow colors</b>`lolcat [[-t|--truecolor]] [path/to/file]`


title: TLDR
content:
<b>Disable one or more CPUs by their IDs</b>`chcpu [[-d|--disable]] [1,3]`<br><b>Enable one or more ranges of CPUs by their IDs</b>`chcpu [[-e|--enable]] [1-3,5-7]`


title: TLDR
content:
<b>Compile multiple source files into an executable</b>`clang [path/to/source1.c path/to/source2.c ...] [[-o|--output]] [path/to/output_executable]`<br><b>Activate output of all errors and warnings</b>`clang [path/to/source.c] -Wall [[-o|--output]] [output_executable]`<br><b>Show common warnings, debug symbols in output, and optimize without affecting debugging</b>`clang [path/to/source.c] -Wall [[-g|--debug]] -Og [[-o|--output]] [path/to/output_executable]`<br><b>Include libraries from a different path</b>`clang [path/to/source.c] [[-o|--output]] [path/to/output_executable] -I[path/to/header] -L[path/to/library] -l[library_name]`<br><b>Compile source code into LLVM Intermediate Representation (IR)</b>`clang [[-S|--assemble]] -emit-llvm [path/to/source.c] [[-o|--output]] [path/to/output.ll]`<br><b>Compile source code into an object file without linking</b>`clang [[-c|--compile]] [path/to/source.c]`<br><b>Optimize the compiled program for performance</b>`clang [path/to/source.c] -O[1|2|3|fast] [[-o|--output]] [path/to/output_executable]`<br><b>Display version</b>`clang --version`


title: TLDR
content:
<b>Clear the screen</b>`clear`<br><b>Clear the screen but keep the terminal's scrollback buffer (equivalent to pressing <Ctrl l> in Bash)</b>`clear -x`<br><b>Indicate the type of terminal to clean (defaults to the value of the environment variable TERM)</b>`clear -T [type_of_terminal]`<br><b>Display the version of ncurses used by clear</b>`clear -V`


title: TLDR
content:
<b>Start a REPL (interactive shell)</b>`julia`<br><b>Execute a Julia program and exit</b>`julia [program.jl]`<br><b>Execute a Julia program that takes arguments</b>`julia [program.jl] [arguments]`<br><b>Evaluate a string containing Julia code</b>`julia [[-e|--eval]] '[julia_code]'`<br><b>Evaluate a string of Julia code, passing arguments to it</b>`julia [[-e|--eval]] '[for x in ARGS; println(x); end]' [arguments]`<br><b>Evaluate an expression and print the result</b>`julia [[-E|--print]] '[(1 - cos(pi/4))/2]'`<br><b>Start Julia in multithreaded mode, using n threads</b>`julia [[-t|--threads]] [n]`


title: TLDR
content:
<b>Launch with default, built-in config</b>`conky`<br><b>Create a new default config</b>`conky [[-C|--print-config]] > ~/.conkyrc`<br><b>Launch Conky with a given configuration file</b>`conky [[-c|--config]] [path/to/config]`<br><b>Start in the background (daemonize)</b>`conky [[-d|--daemonize]]`<br><b>Align Conky on the desktop</b>`conky [[-a|--alignment]] [top|bottom|middle]_[left|right|middle]`<br><b>Pause for 5 seconds at startup before launching</b>`conky [[-p|--pause]] [5]`


title: TLDR
content:
<b>Output char and line number of the first difference between two files</b>`cmp [path/to/file1] [path/to/file2]`<br><b>Output info of the first difference: char, line number, bytes, and values</b>`cmp [[-b|--print-bytes]] [path/to/file1] [path/to/file2]`<br><b>Output the byte numbers and values of every difference</b>`cmp [[-l|--verbose]] [path/to/file1] [path/to/file2]`<br><b>Compare files but output nothing, yield only the exit status</b>`cmp [[-s|--quiet]] [path/to/file1] [path/to/file2]`


title: TLDR
content:
<b>Copy a file to another location</b>`cp [path/to/source_file.ext] [path/to/target_file.ext]`<br><b>Copy a file into another directory, keeping the filename</b>`cp [path/to/source_file.ext] [path/to/target_parent_directory]`<br><b>Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it)</b>`cp [[-r|--recursive]] [path/to/source_directory] [path/to/target_directory]`<br><b>Copy a directory recursively, in verbose mode (shows files as they are copied)</b>`cp [[-vr|--verbose --recursive]] [path/to/source_directory] [path/to/target_directory]`<br><b>Copy multiple files at once to a directory</b>`cp [[-t|--target-directory]] [path/to/destination_directory] [path/to/file1 path/to/file2 ...]`<br><b>Copy all files with a specific extension to another location, in interactive mode (prompts user before overwriting)</b>`cp [[-i|--interactive]] [*.ext] [path/to/target_directory]`<br><b>Follow symbolic links before copying</b>`cp [[-L|--dereference]] [link] [path/to/target_directory]`<br><b>Use the full path of source files, creating any missing intermediate directories when copying</b>`cp --parents [source/path/to/file] [path/to/target_file]`


title: TLDR
content:
<b>Print an ASCII cow saying "hello, world"</b>`cowsay "[hello, world]"`<br><b>Print an ASCII cow saying text from stdin</b>`echo "[hello, world]" | cowsay`<br><b>List all available art types</b>`cowsay -l`<br><b>Print the specified ASCII art saying "hello, world"</b>`cowsay -f [art] "[hello, world]"`<br><b>Print a dead thinking ASCII cow</b>`cowthink -d "[I'm just a cow, not a great thinker...]"`<br><b>Print an ASCII cow with custom eyes saying "hello, world"</b>`cowsay -e [characters] "[hello, world]"`


title: TLDR
content:
<b>Give the [u]ser who owns a file the right to e[x]ecute it</b>`chmod u+x [path/to/file]`<br><b>Give the [u]ser rights to [r]ead and [w]rite to a file/directory</b>`chmod u+rw [path/to/file_or_directory]`<br><b>Remove e[x]ecutable rights from the [g]roup</b>`chmod g-x [path/to/file]`<br><b>Give [a]ll users rights to [r]ead and e[x]ecute</b>`chmod a+rx [path/to/file]`<br><b>Give [o]thers (not in the file owner's group) the same rights as the [g]roup</b>`chmod o=g [path/to/file]`<br><b>Remove all rights from [o]thers</b>`chmod o= [path/to/file]`<br><b>Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite</b>`chmod [[-R|--recursive]] g+w,o+w [path/to/directory]`<br><b>Recursively give [a]ll users [r]ead permissions to files. Also give e[X]ecute permissions to files that have at least one execution permission and to all sub-directories</b>`chmod [[-R|--recursive]] a+rX [path/to/directory]`


title: TLDR
content:
<b>Start an interactive shell session</b>`zsh`<br><b>Execute specific [c]ommands</b>`zsh -c "[echo Hello world]"`<br><b>Execute a specific script</b>`zsh [path/to/script.zsh]`<br><b>Check a specific script for syntax errors without executing it</b>`zsh --no-exec [path/to/script.zsh]`<br><b>Execute specific commands from stdin</b>`[echo Hello world] | zsh`<br><b>Execute a specific script, printing each command in the script before executing it</b>`zsh --xtrace [path/to/script.zsh]`<br><b>Start an interactive shell session in verbose mode, printing each command before executing it</b>`zsh --verbose`<br><b>Execute a specific command inside zsh with disabled glob patterns</b>`noglob [command]`


title: TLDR
content:
<b>Start calculating, defaulting to all CPU cores and 1 second refresh interval</b>`sudo cpufreq-aperf`<br><b>Start calculating for CPU 1 only</b>`sudo cpufreq-aperf [[-c|--cpu]] [1]`<br><b>Start calculating with a 3 second refresh interval for all CPU cores</b>`sudo cpufreq-aperf [[-i|--interval]] [3]`<br><b>Calculate only once</b>`sudo cpufreq-aperf [[-o|--once]]`


title: TLDR
content:
<b>Show CPU frequency information for all CPUs</b>`cpufreq-info`<br><b>Show CPU frequency information for the specified CPU</b>`cpufreq-info [[-c|--cpu]] [cpu_number]`<br><b>Show the allowed minimum and maximum CPU frequency</b>`cpufreq-info [[-l|--hwlimits]]`<br><b>Show the current minimum and maximum CPU frequency and policy in table format</b>`cpufreq-info [[-o|--proc]]`<br><b>Show available CPU frequency policies</b>`cpufreq-info [[-g|--governors]]`<br><b>Show current CPU work frequency in a human-readable format, according to the cpufreq kernel module</b>`cpufreq-info [[-f|--freq]] [[-m|--human]]`<br><b>Show current CPU work frequency in a human-readable format, by reading it from hardware (only available to root)</b>`sudo cpufreq-info [[-w|--hwfreq]] [[-m|--human]]`


title: TLDR
content:
<b>Set the CPU frequency policy of CPU 1 to "userspace"</b>`sudo cpufreq-set [[-c|--cpu]] [1] [[-g|--governor]] [userspace]`<br><b>Set the current minimum CPU frequency of CPU 1</b>`sudo cpufreq-set [[-c|--cpu]] [1] [[-d|--min]] [min_frequency]`<br><b>Set the current maximum CPU frequency of CPU 1</b>`sudo cpufreq-set [[-c|--cpu]] [1] [[-u|--max]] [max_frequency]`<br><b>Set the current work frequency of CPU 1</b>`sudo cpufreq-set [[-c|--cpu]] [1] [[-f|--freq]] [work_frequency]`


title: TLDR
content:
<b>Set a specific login shell for the current user interactively</b>`chsh`<br><b>List available shells</b>`chsh [[-l|--list-shells]]`<br><b>Set a specific login shell for the current user</b>`chsh [[-s|--shell]] [path/to/shell]`<br><b>Set a login shell for a specific user</b>`sudo chsh [[-s|--shell]] [path/to/shell] [username]`


title: TLDR
content:
<b>Remove first column of stdin</b>`colrm [1 1]`<br><b>Remove from 3rd column till the end of each line</b>`colrm [3]`<br><b>Remove from the 3rd column till the 5th column of each line</b>`colrm [3 5]`


title: TLDR
content:
<b>Resume the most recently suspended job and run it in the background</b>`bg`<br><b>Resume a specific job and run it in the background (run jobs to find the job number)</b>`bg %[job_number]`


title: TLDR
content:
<b>Take a list of file names from stdin and add them onto an archive (copy-[o]ut) in cpio's binary forma</b>`echo "[path/to/file1 path/to/file2 ...]" | cpio [[-o|--create]] > [archive.cpio]`<br><b>Copy all files and directories in a directory and add them onto an archive (copy-[o]ut), in verbose mode</b>`find [path/to/directory] | cpio [[-ov|--create --verbose]] > [archive.cpio]`<br><b>Pick all files from an archive (copy-[i]n), generating directories where needed, in verbose mode</b>`cpio < [archive.cpio] [[-idv|--extract --make-directories --verbose]]`


title: TLDR
content:
<b>Split a file at lines 5 and 23</b>`csplit [path/to/file] 5 23`<br><b>Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5)</b>`csplit [path/to/file] 5 {*}`<br><b>Split a file every 5 lines, ignoring exact-division error</b>`csplit [[-k|--keep-files]] [path/to/file] 5 {*}`<br><b>Split a file at line 5 and use a custom prefix for the output files</b>`csplit [path/to/file] 5 [[-f|--prefix]] [prefix]`<br><b>Split a file at a line matching a regex</b>`csplit [path/to/file] /[regex]/`


title: TLDR
content:
<b>Start an interactive shell session</b>`dash`<br><b>Execute specific [c]ommands</b>`dash -c "[echo 'dash is executed']"`<br><b>Execute a specific script</b>`dash [path/to/script.sh]`<br><b>Check a specific script for syntax errors</b>`dash -n [path/to/script.sh]`<br><b>Execute a specific script while printing each command before executing it</b>`dash -x [path/to/script.sh]`<br><b>Execute a specific script and stop at the first [e]rror</b>`dash -e [path/to/script.sh]`<br><b>Execute specific commands from stdin</b>`[echo "echo 'dash is executed'"] | dash`


title: TLDR
content:
<b>Make an HTTP GET request and dump the contents in stdout</b>`curl [https://example.com]`<br><b>Make an HTTP GET request, follow any 3xx redirects, and dump the reply headers and contents to stdout</b>`curl [[-L|--location]] [[-D|--dump-header]] - [https://example.com]`<br><b>Download a file, saving the output under the filename indicated by the URL</b>`curl [[-O|--remote-name]] [https://example.com/filename.zip]`<br><b>Send form-encoded data (POST request of type application/x-www-form-urlencoded). Use --data @file_name or --data @'-' to read from stdin</b>`curl [[-X|--request]] POST [[-d|--data]] '[name=bob]' [http://example.com/form]`<br><b>Send a request with an extra header, using a custom HTTP method and over a proxy (such as BurpSuite), ignoring insecure self-signed certificates</b>`curl [[-k|--insecure]] [[-x|--proxy]] [http://127.0.0.1:8080] [[-H|--header]] '[Authorization: Bearer token]' [[-X|--request]] [GET|PUT|POST|DELETE|PATCH|...] [https://example.com]`<br><b>Send data in JSON format, specifying the appropriate Content-Type header</b>`curl [[-d|--data]] '[{"name":"bob"]}' [[-H|--header]] '[Content-Type: application/json]' [http://example.com/users/1234]`<br><b>Pass client certificate and private key for the request, skipping certificate validation</b>`curl [[-E|--cert]] [client.pem] --key [key.pem] [[-k|--insecure]] [https://example.com]`<br><b>Resolve a hostname to a custom IP address, with verbose output (similar to editing the /etc/hosts file for custom DNS resolution)</b>`curl [[-v|--verbose]] --resolve [example.com]:[80]:[127.0.0.1] [http://example.com]`


title: TLDR
content:
<b>Print a specific [c]haracter/[f]ield range of each line</b>`[command] | cut --[characters|fields] [1|1,10|1-10|1-|-10]`<br><b>Print a field range of each line with a specific delimiter</b>`[command] | cut [[-d|--delimiter]] "[delimiter]" [[-f|--fields]] [1|1,10|1-10|1-|-10]`<br><b>Print a character range of each line of the specific file</b>`cut [[-c|--characters]] [1] [path/to/file]`<br><b>Print specific fields of NUL terminated lines (e.g. as in find . -print0) instead of newlines</b>`[command] | cut [[-z|--zero-terminated]] [[-f|--fields]] [1]`


title: TLDR
content:
<b>Display the current date using the default locale's format</b>`date +%c`<br><b>Display the current date in UTC, using the ISO 8601 format</b>`date [[-u|--utc]] +%Y-%m-%dT%H:%M:%S%Z`<br><b>Display the current date as a Unix timestamp (seconds since the Unix epoch)</b>`date +%s`<br><b>Convert a date specified as a Unix timestamp to the default format</b>`date [[-d|--date]] @[1473305798]`<br><b>Convert a given date to the Unix timestamp format</b>`date [[-d|--date]] "[2018-09-01 00:00]" +%s [[-u|--utc]]`<br><b>Display the current date using the RFC-3339 format (YYYY-MM-DD hh:mm:ss TZ)</b>`date --rfc-3339 s`<br><b>Set the current date using the format MMDDhhmmYYYY.ss (YYYY and .ss are optional)</b>`date [093023592021.59]`<br><b>Display the current ISO week number</b>`date +%V`


title: TLDR
content:
<b>Run the daemon with a configuration file</b>`dbus-daemon --config-file [path/to/file]`<br><b>Run the daemon with the standard per-login-session message bus configuration</b>`dbus-daemon --session`<br><b>Run the daemon with the standard systemwide message bus configuration</b>`dbus-daemon --system`<br><b>Set the address to listen on and override the configuration value for it</b>`dbus-daemon --address [address]`<br><b>Output the process ID to stdout</b>`dbus-daemon --print-pid`<br><b>Force the message bus to write to the system log for messages</b>`dbus-daemon --syslog`


title: TLDR
content:
<b>Start an interactive session</b>`dc`<br><b>Execute a script</b>`dc [path/to/script.dc]`<br><b>Calculate an expression with the specified scale</b>`dc [[-e|--expression]] '[10] k [5 3 /] p'`<br><b>Calculate 4 times 5 (4 5 *), subtract 17 (17 -), and [p]rint the output</b>`dc [[-e|--expression]] '4 5 * 17 - p'`<br><b>Specify the number of decimal places to 7 (7 k), calculate 5 divided by -3 (5 _3 /) and [p]rint</b>`dc [[-e|--expression]] '7 k 5 _3 / p'`<br><b>Calculate the golden ratio, phi: set number of decimal places to 100 (100 k), square root of 5 (5 v) plus 1 (1 +), divided by 2 (2 /), and [p]rint result</b>`dc [[-e|--expression]] '100 k 5 v 1 + 2 / p'`


title: TLDR
content:
<b>Make a bootable USB drive from an isohybrid file (such as archlinux-xxx.iso) and show the progress</b>`dd if=[path/to/file.iso] of=[/dev/usb_drive] status=progress`<br><b>Clone a drive to another drive with 4 MiB block size and flush writes before the command terminates</b>`dd bs=4194304 conv=fsync if=[/dev/source_drive] of=[/dev/dest_drive]`<br><b>Generate a file with a specific number of random bytes by using kernel random driver</b>`dd bs=[100] count=[1] if=/dev/urandom of=[path/to/random_file]`<br><b>Benchmark the sequential write performance of a disk</b>`dd bs=[1024] count=[1000000] if=/dev/zero of=[path/to/file_1GB]`<br><b>Create a system backup, save it into an IMG file (can be restored later by swapping if and of), and show the progress</b>`dd if=[/dev/drive_device] of=[path/to/file.img] status=progress`


title: TLDR
content:
<b>Display all filesystems and their disk usage (using 512-byte units)</b>`df`<br><b>Display the filesystem containing the specified file or directory</b>`df [path/to/file_or_directory]`<br><b>Use [k]ibibyte (1024 byte) units when showing size figures</b>`df -k`<br><b>Display information in a portable way</b>`df -P`


title: TLDR
content:
<b>Display changes in a histogram</b>`diff [path/to/file1] [path/to/file2] | diffstat`<br><b>Display inserted, deleted and modified changes as a table</b>`diff [path/to/file1] [path/to/file2] | diffstat -t`


title: TLDR
content:
<b>Remove a user</b>`sudo deluser [username]`<br><b>Remove a user and their home directory</b>`sudo deluser --remove-home [username]`<br><b>Remove a user and their home, but backup their files into a .tar.gz file in the specified directory</b>`sudo deluser --backup-to [path/to/backup_directory] --remove-home [username]`<br><b>Remove a user, and all files owned by them</b>`sudo deluser --remove-all-files [username]`


title: TLDR
content:
<b>Render a PNG image with a filename based on the input filename and output format (uppercase -O)</b>`dot -T [png] -O [path/to/input.gv]`<br><b>Render a SVG image with the specified output filename (lowercase -o)</b>`dot -T [svg] -o [path/to/image.svg] [path/to/input.gv]`<br><b>Render the output in PS, PDF, SVG, Fig, PNG, GIF, JPEG, JSON, or DOT format</b>`dot -T [format] -O [path/to/input.gv]`<br><b>Render a GIF image using stdin and stdout</b>`echo "[digraph {this -> that} ]" | dot -T [gif] > [path/to/image.gif]`<br><b>Display help</b>`dot -?`


title: TLDR
content:
<b>Compare files</b>`diff3 [path/to/file1] [path/to/file2] [path/to/file3]`<br><b>Show all changes, outlining conflicts</b>`diff3 [[-A|--show-all]] [path/to/file1] [path/to/file2] [path/to/file3]`


title: TLDR
content:
<b>Output commands to set LS_COLOR using default colors</b>`dircolors`<br><b>Display each filetype with the color they would appear in ls</b>`dircolors --print-ls-colors`<br><b>Output commands to set LS_COLOR using colors from a file</b>`dircolors [path/to/file]`<br><b>Output commands for Bourne shell</b>`dircolors [[-b|--bourne-shell]]`<br><b>Output commands for C shell</b>`dircolors [[-c|--c-shell]]`<br><b>View the default colors for file types and extensions</b>`dircolors [[-p|--print-database]]`


title: TLDR
content:
<b>Compare files (lists changes to turn old_file into new_file)</b>`diff [old_file] [new_file]`<br><b>Compare files, ignoring white spaces</b>`diff [[-w|--ignore-all-space]] [old_file] [new_file]`<br><b>Compare files, showing the differences side by side</b>`diff [[-y|--side-by-side]] [old_file] [new_file]`<br><b>Compare files, showing the differences in unified format (as used by git diff)</b>`diff [[-u|--unified]] [old_file] [new_file]`<br><b>Compare directories recursively (shows names for differing files/directories as well as changes made to files)</b>`diff [[-r|--recursive]] [old_directory] [new_directory]`<br><b>Compare directories, only showing the names of files that differ</b>`diff [[-r|--recursive]] [[-q|--brief]] [old_directory] [new_directory]`<br><b>Create a patch file for Git from the differences of two text files, treating nonexistent files as empty</b>`diff [[-a|--text]] [[-u|--unified]] [[-N|--new-file]] [old_file] [new_file] > [diff.patch]`<br><b>Compare files, showing output in color and try hard to find smaller set of changes</b>`diff [[-d|--minimal]] --color=always [old_file] [new_file]`


title: TLDR
content:
<b>Calculate the parent directory of a given path</b>`dirname [path/to/file_or_directory]`<br><b>Calculate the parent directory of multiple paths</b>`dirname [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Delimit output with a NUL character instead of a newline (useful when combining with xargs)</b>`dirname [[-z|--zero]] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`


title: TLDR
content:
<b>Install a package</b>`sudo dpkg [[-i|--install]] [path/to/file.deb]`<br><b>Remove a package</b>`sudo dpkg [[-r|--remove]] [package]`<br><b>List installed packages</b>`dpkg [[-l|--list]] [pattern]`<br><b>List a package's contents</b>`dpkg [[-L|--listfiles]] [package]`<br><b>List contents of a local package file</b>`dpkg [[-c|--contents]] [path/to/file.deb]`<br><b>Find out which package owns a file</b>`dpkg [[-S|--search]] [path/to/file]`<br><b>Purge an installed or already removed package, including configuration</b>`sudo dpkg [[-P|--purge]] [package]`


title: TLDR
content:
<b>Backup a directory via FTPS to a remote machine, encrypting it with a password</b>`FTP_PASSWORD=[ftp_login_password] PASSPHRASE=[encryption_password] duplicity [path/to/source_directory] [ftps://user@hostname/path/to/target_directory]/`<br><b>Backup a directory to Amazon S3, doing a full backup every month</b>`duplicity --full-if-older-than [1M] s3://[bucket_name[/prefix]]`<br><b>Delete versions older than 1 year from a backup stored on a WebDAV share</b>`FTP_PASSWORD=[webdav_login_password] duplicity remove-older-than [1Y] --force [webdav[s]://user@hostname[:port]/some_directory]`<br><b>List the available backups</b>`duplicity collection-status "file://[absolute/path/to/backup_directory]"`<br><b>List the files in a backup stored on a remote machine, via SSH</b>`duplicity list-current-files [[-t|--time]] [YYYY-MM-DD] scp://[user@hostname]/[path/to/backup_directory]`<br><b>Restore a subdirectory from a GnuPG-encrypted local backup to a given location</b>`PASSPHRASE=[gpg_key_password] duplicity restore --encrypt-key [gpg_key_id] --path-to-restore [relative/path/restoredirectory] file://[absolute/path/to/backup_directory] [path/to/directory_to_restore_to]`


title: TLDR
content:
<b>Show all DMI table contents</b>`sudo dmidecode`<br><b>Show the BIOS version</b>`sudo dmidecode [[-s|--string]] bios-version`<br><b>Show the system's serial number</b>`sudo dmidecode [[-s|--string]] system-serial-number`<br><b>Show BIOS information</b>`sudo dmidecode [[-t|--type]] bios`<br><b>Show CPU information</b>`sudo dmidecode [[-t|--type]] processor`<br><b>Show memory information</b>`sudo dmidecode [[-t|--type]] memory`


title: TLDR
content:
<b>Show kernel messages</b>`sudo dmesg`<br><b>Show kernel error messages</b>`sudo dmesg [[-l|--level]] err`<br><b>Show kernel messages and keep [w]aiting for new ones, similar to tail --follow (available in kernels 3.5.0 and newer)</b>`sudo dmesg [[-w|--follow]]`<br><b>Show how much physical memory is available on this system</b>`sudo dmesg | grep [[-i|--ignore-case]] memory`<br><b>Show kernel messages 1 page at a time</b>`sudo dmesg | less`<br><b>Show kernel messages with a timestamp (available in kernels 3.5.0 and newer)</b>`sudo dmesg [[-T|--ctime]]`<br><b>Show kernel messages in human-readable form (available in kernels 3.5.0 and newer)</b>`sudo dmesg [[-H|--human]]`<br><b>Colorize output (available in kernels 3.5.0 and newer)</b>`sudo dmesg [[-L|--color]]`


title: TLDR
content:
<b>Print a text message. Note: Quotes are optional</b>`echo "[Hello World]"`<br><b>Print a message with environment variables</b>`echo "[My path is $PATH]"`<br><b>Print a message without the trailing newline</b>`echo -n "[Hello World]"`<br><b>Append a message to the file</b>`echo "[Hello World]" >> [file.txt]`<br><b>Enable interpretation of backslash escapes (special characters)</b>`echo -e "[Column 1\tColumn 2]"`<br><b>Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are echo %errorlevel% and $lastexitcode respectively)</b>`echo $?`<br><b>Pass text to another program through stdin</b>`echo "[Hello World]" | [program]`


title: TLDR
content:
<b>Display the default device</b>`eject [[-d|--default]]`<br><b>Eject the default device</b>`eject`<br><b>Eject a specific device (the default order is cd-rom, scsi, floppy and tape)</b>`eject [/dev/cdrom]`<br><b>Toggle whether a device's tray is open or closed</b>`eject [[-T|--traytoggle]] [/dev/cdrom]`<br><b>Eject a cd drive</b>`eject [[-r|--cdrom]] [/dev/cdrom]`<br><b>Eject a floppy drive</b>`eject [[-f|--floppy]] [/mnt/floppy]`<br><b>Eject a tape drive</b>`eject [[-q|--tape]] [/mnt/tape]`<br><b>Set whether the physical eject button is [i]gnored (on prevents ejecting)</b>`eject [[-i|--manualeject]] [on|off]`


title: TLDR
content:
<b>Start ELinks</b>`elinks`<br><b>Quit elinks</b>`<Ctrl c>`<br><b>Dump output of webpage to console, colorizing the text with ANSI control codes</b>`elinks -dump -dump-color-mode [1] [url]`


title: TLDR
content:
<b>Start Emacs and open a file</b>`emacs [path/to/file]`<br><b>Open a file at a specified line number</b>`emacs +[line_number] [path/to/file]`<br><b>Run an Emacs Lisp file as a script</b>`emacs --script [path/to/file.el]`<br><b>Start Emacs in console mode (without an X window)</b>`emacs [[-nw|--no-window-system]]`<br><b>Start an Emacs server in the background (accessible via emacsclient)</b>`emacs --daemon`<br><b>Stop a running Emacs server and all its instances, asking for confirmation on unsaved files</b>`emacsclient --eval '(save-buffers-kill-emacs)'`<br><b>Save a file in Emacs</b>`<Ctrl x><Ctrl s>`<br><b>Quit Emacs</b>`<Ctrl x><Ctrl c>`


title: TLDR
content:
<b>Edit action can be used to view any file on default mailcap explorer</b>`edit [filename]`<br><b>With run-mailcap</b>`run-mailcap --action=edit [filename]`


title: TLDR
content:
<b>Compose action can be used to compose any existing file or new on default mailcap edit tool</b>`compose [filename]`<br><b>With run-mailcap</b>`run-mailcap --action=compose [filename]`


title: TLDR
content:
<b>Check filesystem /dev/sdXN, reporting any damaged blocks</b>`sudo fsck [/dev/sdXN]`<br><b>Check filesystem /dev/sdXN, reporting any damaged blocks and interactively letting the user choose to repair each one</b>`sudo fsck -r [/dev/sdXN]`<br><b>Check filesystem /dev/sdXN, reporting any damaged blocks and [a]utomatically repairing them</b>`sudo fsck -a [/dev/sdXN]`


title: TLDR
content:
<b>Call echo with the "foo" argument</b>`eval "[echo foo]"`<br><b>Set a variable in the current shell</b>`eval "[foo=bar]"`


title: TLDR
content:
<b>Speak a phrase aloud</b>`espeak "I like to ride my bike."`<br><b>Speak a file aloud</b>`espeak -f [path/to/file]`<br><b>Save output to a WAV audio file, rather than speaking it directly</b>`espeak -w [filename.wav] "It's GNU plus Linux"`<br><b>Use a different voice</b>`espeak -v [voice]`


title: TLDR
content:
<b>Convert tabs in each file to spaces, writing to stdout</b>`expand [path/to/file]`<br><b>Convert tabs to spaces, reading from stdin</b>`expand`<br><b>Do not convert tabs after non blanks</b>`expand [[-i|--initial]] [path/to/file]`<br><b>Have tabs a certain number of characters apart, not 8</b>`expand [[-t|--tabs]] [number] [path/to/file]`<br><b>Use a comma separated list of explicit tab positions</b>`expand [[-t|--tabs]] [1,4,6]`


title: TLDR
content:
<b>Replace environment variables in stdin and output to stdout</b>`echo '[$HOME]' | envsubst`<br><b>Replace environment variables in an input file and output to stdout</b>`envsubst < [path/to/input_file]`<br><b>Replace environment variables in an input file and output to a file</b>`envsubst < [path/to/input_file] > [path/to/output_file]`<br><b>Replace environment variables in an input file from a space-separated list</b>`envsubst < [path/to/input_file] '[$USER $SHELL $HOME]'`


title: TLDR
content:
<b>Show the environment</b>`env`<br><b>Run a program. Often used in scripts after the shebang (#!) for looking up the path to the program</b>`env [program]`<br><b>Clear the environment and run a program</b>`env [[-i|--ignore-environment]] [program]`<br><b>Remove variable from the environment and run a program</b>`env [[-u|--unset]] [variable] [program]`<br><b>Set a variable and run a program</b>`env [variable]=[value] [program]`<br><b>Set one or more variables and run a program</b>`env [variable1=value variable2=value variable3=value ...] [program]`<br><b>Run a program under a different name</b>`env [[-a|--argv0]] [custom_name] [program]`


title: TLDR
content:
<b>Set an environment variable</b>`export [VARIABLE]=[value]`<br><b>Append a pathname to the environment variable PATH</b>`export PATH=$PATH:[path/to/append]`


title: TLDR
content:
<b>Change the owner user of a file/directory</b>`sudo chown [user] [path/to/file_or_directory]`<br><b>Change the owner user and group of a file/directory</b>`sudo chown [user]:[group] [path/to/file_or_directory]`<br><b>Change the owner user and group to both have the name user</b>`sudo chown [user]: [path/to/file_or_directory]`<br><b>Recursively change the owner of a directory and its contents</b>`sudo chown [[-R|--recursive]] [user] [path/to/directory]`<br><b>Change the owner of a symbolic link</b>`sudo chown [[-h|--no-dereference]] [user] [path/to/symlink]`<br><b>Change the owner of a file/directory to match a reference file</b>`sudo chown --reference [path/to/reference_file] [path/to/file_or_directory]`


title: TLDR
content:
<b>Execute a specific command using the current environment variables</b>`exec [command -with -flags]`


title: TLDR
content:
<b>Initialize a LUKS volume with a passphrase (overwrites all data on the partition)</b>`cryptsetup luksFormat [/dev/sdXY]`<br><b>Open a LUKS volume and create a decrypted mapping at /dev/mapper/mapping_name</b>`cryptsetup open [/dev/sdXY] [mapping_name]`<br><b>Display information about a mapping</b>`cryptsetup status [mapping_name]`<br><b>Remove an existing mapping</b>`cryptsetup close [mapping_name]`<br><b>Change a LUKS volume's passphrase</b>`cryptsetup luksChangeKey [/dev/sdXY]`


title: TLDR
content:
<b>Get the label of a FAT32 partition</b>`fatlabel [/dev/sda1]`<br><b>Set the label of a FAT32 partition</b>`fatlabel [/dev/sdc3] "[new_label]"`


title: TLDR
content:
<b>Run command as new root directory</b>`sudo chroot [path/to/new_root] [command]`<br><b>Use a specific user and group</b>`sudo chroot --userspec [username_or_id:group_name_or_id]`


title: TLDR
content:
<b>Launch the vim tutor using the given language</b>`vimtutor [en|fr|de|...]`<br><b>Exit the tutor</b>`<Esc><:>q<Enter>`


title: TLDR
content:
<b>Get the length of a specific string</b>`expr length "[string]"`<br><b>Get the substring of a string with a specific length</b>`expr substr "[string]" [from] [length]`<br><b>Match a specific substring against an anchored pattern</b>`expr match "[string]" '[pattern]'`<br><b>Get the first char position from a specific set in a string</b>`expr index "[string]" "[chars]"`<br><b>Calculate a specific mathematic expression</b>`expr [expression1] [+|-|*|/|%] [expression2]`<br><b>Get the first expression if its value is non-zero and not null otherwise get the second one</b>`expr [expression1] \| [expression2]`<br><b>Get the first expression if both expressions are non-zero and not null otherwise get zero</b>`expr [expression1] \& [expression2]`


title: TLDR
content:
<b>Return a list of installed fonts</b>`fc-list`<br><b>Return a list of installed fonts with given name</b>`fc-list | grep '[DejaVu Serif]'`<br><b>Return the number of installed fonts</b>`fc-list | wc [[-l|--lines]]`<br><b>Return a list of installed fonts that support the language based on its locale code</b>`fc-list :lang=[jp]`<br><b>Return a list of installed fonts that contain the glyph specified by its Unicode code-point</b>`fc-list :charset=[f303]`


title: TLDR
content:
<b>Open the last command in the default system editor and run it after editing</b>`fc`<br><b>Specify an editor to open with</b>`fc -e '[emacs]'`<br><b>List recent commands from history</b>`fc -l`<br><b>List recent commands in reverse order</b>`fc -l -r`<br><b>Edit and run a command from history</b>`fc [number]`<br><b>Edit commands in a given interval and run them</b>`fc '[416]' '[420]'`<br><b>Display help</b>`fc --help`


title: TLDR
content:
<b>Brute-force a password with a length of 4 to 8 characters, and contains only alphanumeric characters (order matters)</b>`fcrackzip [[-b|--brute-force]] [[-l|--length]] 4-8 [[-c|--charset]] aA1 [archive]`<br><b>Brute-force a password in verbose mode with a length of 3 characters that only contains lowercase characters, $ and %</b>`fcrackzip [[-v|--verbose]] [[-b|--brute-force]] [[-l|--length]] 3 [[-c|--charset]] a:$% [archive]`<br><b>Brute-force a password that contains only lowercase and special characters</b>`fcrackzip [[-b|--brute-force]] [[-l|--length]] 4 [[-c|--charset]] a! [archive]`<br><b>Brute-force a password containing only digits, starting from the password 12345</b>`fcrackzip [[-b|--brute-force]] [[-l|--length]] 5 [[-c|--charset]] 1 [[-p|--init-password]] 12345 [archive]`<br><b>Crack a password using a wordlist</b>`fcrackzip [[-u|--use-unzip]] [[-D|--dictionary]] [[-p|--init-password]] [wordlist] [archive]`<br><b>Benchmark cracking performance</b>`fcrackzip [[-B|--benchmark]]`


title: TLDR
content:
<b>Extract the sound from a video and save it as MP3</b>`ffmpeg -i [path/to/video.mp4] -vn [path/to/sound.mp3]`<br><b>Transcode a FLAC file to Red Book CD format (44100kHz, 16bit)</b>`ffmpeg -i [path/to/input_audio.flac] -ar 44100 -sample_fmt s16 [path/to/output_audio.wav]`<br><b>Save a video as GIF, scaling the height to 1000px and setting framerate to 15</b>`ffmpeg -i [path/to/video.mp4] [[-vf|-filter:v]] 'scale=-1:[1000]' -r [15] [path/to/output.gif]`<br><b>Combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF</b>`ffmpeg -i [path/to/frame_%d.jpg] -f image2 [video.mpg|video.gif]`<br><b>Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end)</b>`ffmpeg -i [path/to/input_video.mp4] -ss [mm:ss] -to [mm2:ss2] [[-c|-codec]] copy [path/to/output_video.mp4]`<br><b>Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23</b>`ffmpeg -i [path/to/input_video].avi [[-c|-codec]]:a aac -b:a 128k [[-c|-codec]]:v libx264 -crf 23 [path/to/output_video].mp4`<br><b>Remux MKV video to MP4 without re-encoding audio or video streams</b>`ffmpeg -i [path/to/input_video].mkv [[-c|-codec]] copy [path/to/output_video].mp4`<br><b>Convert MP4 video to VP9 codec. For the best quality, use a CRF value (recommended range 15-35) and -b:v MUST be 0</b>`ffmpeg -i [path/to/input_video].mp4 [[-c|-codec]]:v libvpx-vp9 -crf [30] -b:v 0 [[-c|-codec]]:a libopus -vbr on -threads [number_of_threads] [path/to/output_video].webm`


title: TLDR
content:
<b>Display default information about a font</b>`fc-pattern [[-d|--default]] '[DejaVu Serif]'`<br><b>Display configuration information about a font</b>`fc-pattern [[-c|--config]] '[DejaVu Serif]'`


title: TLDR
content:
<b>Launch Firefox and open a web page</b>`firefox [https://www.duckduckgo.com]`<br><b>Open a new window</b>`firefox --new-window [https://www.duckduckgo.com]`<br><b>Open a private (incognito) window</b>`firefox --private-window`<br><b>Search for "wikipedia" using the default search engine</b>`firefox --search "[wikipedia]"`<br><b>Launch Firefox in safe mode, with all extensions disabled</b>`firefox --safe-mode`<br><b>Take a screenshot of a web page in headless mode</b>`firefox --headless --screenshot [path/to/output_file.png] [https://example.com/]`<br><b>Use a specific profile to allow multiple separate instances of Firefox to run at once</b>`firefox --profile [path/to/directory] [https://example.com/]`<br><b>Set Firefox as the default browser</b>`firefox --setDefaultBrowser`


title: TLDR
content:
<b>List partitions</b>`sudo fdisk [[-l|--list]]`<br><b>Start the interactive partition manipulator</b>`sudo fdisk [/dev/sdX]`<br><b>Open a help [m]enu</b>`<m>`<br><b>View the [p]artition table</b>`<p>`<br><b>Create a [n]ew partition</b>`<n>`<br><b>Select a partition to [d]elete</b>`<d>`<br><b>[w]rite the changes made</b>`<w>`<br><b>Discard the changes made and [q]uit</b>`<q>`


title: TLDR
content:
<b>Generate an analyzer from a Lex file, storing it to the file lex.yy.c</b>`flex [analyzer.l]`<br><b>Write analyzer to stdout</b>`flex [[-t|--stdout]] [analyzer.l]`<br><b>Specify the output file</b>`flex [analyzer.l] [[-o|--outfile]] [analyzer.c]`<br><b>Generate a batch scanner instead of an interactive scanner</b>`flex [[-B|--batch]] [analyzer.l]`<br><b>Compile a C file generated by Lex</b>`cc [path/to/lex.yy.c] -o [executable]`


title: TLDR
content:
<b>Print a quotation</b>`fortune`<br><b>Print an offensive quotation</b>`fortune -o`<br><b>Print a long quotation</b>`fortune -l`<br><b>Print a short quotation</b>`fortune -s`<br><b>List the available quotation database files</b>`fortune -f`<br><b>Print a quotation from one of the database files listed by fortune -f</b>`fortune [path/to/file]`


title: TLDR
content:
<b>Encode a WAV file to FLAC (this will create a FLAC file in the same location as the WAV file)</b>`flac [path/to/file.wav]`<br><b>Encode a WAV file to FLAC, specifying the output file</b>`flac [[-o|--output-name]] [path/to/output.flac] [path/to/file.wav]`<br><b>Decode a FLAC file to WAV, specifying the output file</b>`flac [[-d|--decode]] [[-o|--output-name]] [path/to/output.wav] [path/to/file.flac]`<br><b>Test a FLAC file for the correct encoding</b>`flac [[-t|--test]] [path/to/file.flac]`


title: TLDR
content:
<b>Reserve a file taking up 700 MiB of disk space</b>`fallocate [[-l|--length]] [700M] [path/to/file]`<br><b>Shrink an already allocated file by 200 MiB</b>`fallocate [[-c|--collapse-range]] [[-l|--length]] [200M] [path/to/file]`<br><b>Shrink 20 MB of space after 100 MiB in a file</b>`fallocate [[-c|--collapse-range]] [[-o|--offset]] [100M] [[-l|--length]] [20M] [path/to/file]`


title: TLDR
content:
<b>Bring most recently suspended or running background job to foreground</b>`fg`<br><b>Bring a specific job to foreground (run jobs to find the job number)</b>`fg %[job_number]`


title: TLDR
content:
<b>Wrap each line to default width (80 characters)</b>`fold [path/to/file]`<br><b>Wrap each line to width "30"</b>`fold -w30 [path/to/file]`<br><b>Wrap each line to width "5" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped)</b>`fold -w5 -s [path/to/file]`


title: TLDR
content:
<b>Launch a VNC Server on next available display</b>`vncserver`<br><b>Launch a VNC Server with specific screen geometry</b>`vncserver --geometry [width]x[height]`<br><b>Kill an instance of VNC Server running on a specific display</b>`vncserver --kill :[display_number]`


title: TLDR
content:
<b>Display the prime-factorization of a number</b>`factor [number]`<br><b>Take the input from stdin if no argument is specified</b>`echo [number] | factor`


title: TLDR
content:
<b>List all mounted filesystems</b>`findmnt`<br><b>Search for a device</b>`findmnt [/dev/sdb1]`<br><b>Search for a mountpoint</b>`findmnt [/]`<br><b>Find filesystems in specific type</b>`findmnt [[-t|--types]] [ext4,virtiofs,btrfs,...]`<br><b>Find filesystems with specific label</b>`findmnt LABEL=[BigStorage]`<br><b>Check mount table content in detail and verify /etc/fstab</b>`findmnt [[-x|--verify]] --verbose`


title: TLDR
content:
<b>Open a URL</b>`w3m [https://example.com]`<br><b>Open a URL in monochrome mode</b>`w3m [https://example.com] -M`<br><b>Open a URL without mouse support</b>`w3m [https://example.com] -no-mouse`<br><b>Open a new browser tab</b>`<Shift t>`<br><b>Display your browser history</b>`<Ctrl h>`<br><b>Quit w3m</b>`<q><y>`


title: TLDR
content:
<b>Reformat a file</b>`fmt [path/to/file]`<br><b>Reformat a file producing output lines of (at most) n characters</b>`fmt [[-w|--width]] [n] [path/to/file]`<br><b>Reformat a file without joining lines shorter than the given width together</b>`fmt [[-s|--split-only]] [path/to/file]`<br><b>Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs)</b>`fmt [[-u|--uniform-spacing]] [path/to/file]`


title: TLDR
content:
<b>Display system memory</b>`free`<br><b>Display memory in Bytes/KB/MB/GB</b>`free -[b|k|m|g]`<br><b>Display memory in human-readable units</b>`free [[-h|--human]]`<br><b>Refresh the output every 2 seconds</b>`free [[-s|--seconds]] 2`


title: TLDR
content:
<b>Connect to an FTP server</b>`ftp [ftp.example.com]`<br><b>Connect to an FTP server specifying its IP address and port</b>`ftp [ip_address] [port]`<br><b>Switch to binary transfer mode (graphics, compressed files, etc)</b>`binary`<br><b>Transfer multiple files without prompting for confirmation on every file</b>`prompt off`<br><b>Download multiple files (glob expression)</b>`mget [*.png]`<br><b>Upload multiple files (glob expression)</b>`mput [*.zip]`<br><b>Delete multiple files on the remote server</b>`mdelete [*.txt]`<br><b>Rename a file on the remote server</b>`rename [original_filename] [new_filename]`


title: TLDR
content:
<b>Debug an executable</b>`gdb [path/to/executable]`<br><b>Attach a process to gdb</b>`gdb [[-p|--pid]] [procID]`<br><b>Debug with a core file</b>`gdb [[-c|--core]] [path/to/core] [path/to/executable]`<br><b>Execute given GDB commands upon start</b>`gdb [[-ex|--eval-command]] "[commands]" [path/to/executable]`<br><b>Start gdb and pass arguments to the executable</b>`gdb --args [path/to/executable] [argument1 argument2 ...]`<br><b>Skip debuginfod and pagination prompts and then print the backtrace</b>`gdb [[-c|--core]] [path/to/core] [path/to/executable] -iex 'set debuginfod enabled on' -iex 'set pagination off' -ex bt`


title: TLDR
content:
<b>Find which processes are accessing a file or directory</b>`fuser [path/to/file_or_directory]`<br><b>Show more fields (USER, PID, ACCESS and COMMAND)</b>`fuser [[-v|--verbose]] [path/to/file_or_directory]`<br><b>Identify processes using a TCP socket</b>`fuser [[-n|--namespace]] tcp [port]`<br><b>Kill all processes accessing a file or directory (sends the SIGKILL signal)</b>`fuser [[-k|--kill]] [path/to/file_or_directory]`<br><b>Find which processes are accessing the filesystem containing a specific file or directory</b>`fuser [[-m|--mount]] [path/to/file_or_directory]`<br><b>Kill all processes with a TCP connection on a specific port</b>`fuser [[-k|--kill]] [port]/tcp`


title: TLDR
content:
<b>Compile a source code file into an executable binary</b>`g++ [path/to/source1.cpp path/to/source2.cpp ...] [[-o|--output]] [path/to/output_executable]`<br><b>Activate output of all errors and warnings</b>`g++ [path/to/source.cpp] -Wall [[-o|--output]] [path/to/output_executable]`<br><b>Show common warnings, debug symbols in output, and optimize without affecting debugging</b>`g++ [path/to/source.cpp] -Wall [[-g|--debug]] -Og [[-o|--output]] [path/to/output_executable]`<br><b>Choose a language standard to compile for (C++98/C++11/C++14/C++17)</b>`g++ [path/to/source.cpp] -std=[c++98|c++11|c++14|c++17] [[-o|--output]] [path/to/output_executable]`<br><b>Include libraries located at a different path than the source file</b>`g++ [path/to/source.cpp] [[-o|--output]] [path/to/output_executable] -I[path/to/header] -L[path/to/library] -l[library_name]`<br><b>Compile and link multiple source code files into an executable binary</b>`g++ [[-c|--compile]] [path/to/source1.cpp path/to/source2.cpp ...] && g++ [[-o|--output]] [path/to/output_executable] [path/to/source1.o path/to/source2.o ...]`<br><b>Optimize the compiled program for performance</b>`g++ [path/to/source.cpp] -O[1|2|3|fast] [[-o|--output]] [path/to/output_executable]`<br><b>Display version</b>`g++ --version`


title: TLDR
content:
<b>Launch a VNC client which connects to a host on a given display</b>`vncviewer [host]:[display_number]`<br><b>Launch in full-screen mode</b>`vncviewer -FullScreen [host]:[display_number]`<br><b>Launch a VNC client with a specific screen geometry</b>`vncviewer --geometry [width]x[height] [host]:[display_number]`<br><b>Launch a VNC client which connects to a host on a given port</b>`vncviewer [host]::[port]`


title: TLDR
content:
<b>Open two files and show the differences</b>`vimdiff [path/to/file1] [path/to/file2]`<br><b>Move the cursor to the window on the left|right</b>`<Ctrl w>[<h>|<l>]`<br><b>Jump to the previous difference</b>`<[><c>`<br><b>Jump to the next difference</b>`<]><c>`<br><b>Copy the highlighted difference from the other window to the current window</b>`<d><o>`<br><b>Copy the highlighted difference from the current window to the other window</b>`<d><p>`<br><b>Update all highlights and folds</b>`<:>diffupdate`<br><b>Toggle the highlighted code fold</b>`<z><a>`


title: TLDR
content:
<b>Compile multiple source files into an executable</b>`gcc [path/to/source1.c path/to/source2.c ...] [[-o|--output]] [path/to/output_executable]`<br><b>Activate output of all errors and warnings</b>`gcc [path/to/source.c] -Wall [[-o|--output]] [output_executable]`<br><b>Show common warnings, debug symbols in output, and optimize without affecting debugging</b>`gcc [path/to/source.c] -Wall [[-g|--debug]] -Og [[-o|--output]] [path/to/output_executable]`<br><b>Include libraries from a different path</b>`gcc [path/to/source.c] [[-o|--output]] [path/to/output_executable] -I[path/to/header] -L[path/to/library] -l[library_name]`<br><b>Compile source code into Assembler instructions</b>`gcc [[-S|--assemble]] [path/to/source.c]`<br><b>Compile source code into an object file without linking</b>`gcc [[-c|--compile]] [path/to/source.c]`<br><b>Optimize the compiled program for performance</b>`gcc [path/to/source.c] -O[1|2|3|fast] [[-o|--output]] [path/to/output_executable]`<br><b>Display version</b>`gcc --version`


title: TLDR
content:
<b>Trim unused blocks on all mounted partitions that support it</b>`sudo fstrim [[-a|--all]]`<br><b>Trim unused blocks on a specified partition</b>`sudo fstrim [/]`<br><b>Display statistics after trimming</b>`sudo fstrim [[-v|--verbose]] [/]`


title: TLDR
content:
<b>Display information about all users who are currently logged in</b>`w`<br><b>Display information about a specific user</b>`w [username]`<br><b>Display logged-in user information without a header</b>`w [[-h|--no-header]]`<br><b>Display information without including the login, JCPU and PCPU columns</b>`w [[-s|--short]]`


title: TLDR
content:
<b>Wait for a process to finish given its process ID (PID) and return its exit status</b>`wait [pid]`<br><b>Wait for all processes known to the invoking shell to finish</b>`wait`<br><b>Wait for a job to finish (run jobs to find the job number)</b>`wait %[job_number]`<br><b>Display help</b>`wait --help`


title: TLDR
content:
<b>Search for remote gem(s) and show all available versions</b>`gem search [regex] [[-a|--all]]`<br><b>Install the latest version of a gem</b>`gem install [gem_name]`<br><b>Install a specific version of a gem</b>`gem install [gem_name] [[-v|--version]] [1.0.0]`<br><b>Install the latest matching (SemVer) version of a gem</b>`gem install [gem_name] [[-v|--version]] '~> [1.0]'`<br><b>Update a gem</b>`gem update [gem_name]`<br><b>List all local gems</b>`gem list`<br><b>Uninstall a gem</b>`gem uninstall [gem_name]`<br><b>Uninstall a specific version of a gem</b>`gem uninstall [gem_name] [[-v|--version]] [1.0.0]`


title: TLDR
content:
<b>Send a message</b>`wall [message]`<br><b>Send a message to users that belong to a specific group</b>`wall [[-g|--group]] [group_name] [message]`<br><b>Send a message from a file</b>`wall [file]`<br><b>Send a message with timeout (default 300)</b>`wall [[-t|--timeout]] [seconds] [file]`


title: TLDR
content:
<b>Download the contents of a URL to a file (named "foo" in this case)</b>`wget [https://example.com/foo]`<br><b>Download the contents of a URL to a file (named "bar" in this case)</b>`wget [[-O|--output-document]] [bar] [https://example.com/foo]`<br><b>Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.)</b>`wget [[-pkw|--page-requisites --convert-links --wait]] 3 [https://example.com/some_page.html]`<br><b>Download all listed files within a directory and its sub-directories (does not download embedded page elements)</b>`wget [[-mnp|--mirror --no-parent]] [https://example.com/some_path/]`<br><b>Limit the download speed and the number of connection retries</b>`wget --limit-rate [300k] [[-t|--tries]] [100] [https://example.com/some_path/]`<br><b>Download a file from an HTTP server using Basic Auth (also works for FTP)</b>`wget --user [username] --password [password] [https://example.com]`<br><b>Continue an incomplete download</b>`wget [[-c|--continue]] [https://example.com]`<br><b>Download all URLs stored in a text file to a specific directory</b>`wget [[-P|--directory-prefix]] [path/to/directory] [[-i|--input-file]] [path/to/URLs.txt]`


title: TLDR
content:
<b>Repeatedly run a command and show the result</b>`watch [command]`<br><b>Re-run a command every 60 seconds</b>`watch [[-n|--interval]] 60 [command]`<br><b>Monitor disk space, highlighting differences as they appear</b>`watch [[-d|--differences]] df`<br><b>Repeatedly run a pipeline and show the result</b>`watch "[command1] | [command2] | [command3]"`<br><b>Exit watch if the visible output changes</b>`watch [[-g|--chgexit]] [lsblk]`<br><b>Interpret terminal control characters</b>`watch [[-c|--color]] [ls --color=always]`


title: TLDR
content:
<b>Locate binary, source and man pages for SSH</b>`whereis [ssh]`<br><b>Locate binary and man pages for ls</b>`whereis -bm [ls]`<br><b>Locate source of gcc and man pages for Git</b>`whereis -s [gcc] -m [git]`<br><b>Locate binaries for gcc in /usr/bin/ only</b>`whereis -b -B [/usr/bin/] -f [gcc]`<br><b>Locate unusual binaries (those that have more or less than one binary on the system)</b>`whereis -u *`<br><b>Locate binaries that have unusual manual entries (binaries that have more or less than one manual installed)</b>`whereis -u -m *`


title: TLDR
content:
<b>Display optical drives available to wodim</b>`wodim --devices`<br><b>Record ("burn") an audio-only disc</b>`wodim dev=[/dev/optical_drive] -audio [track*.cdaudio]`<br><b>Burn a file to a disc, ejecting the disc once done (some recorders require this)</b>`wodim -eject dev=[/dev/optical_drive] -data [file.iso]`<br><b>Burn a file to the disc in an optical drive, potentially writing to multiple discs in succession</b>`wodim -tao dev=[/dev/optical_drive] -data [file.iso]`


title: TLDR
content:
<b>Search the PATH environment variable and display the location of any matching executables</b>`which [executable]`<br><b>If there are multiple executables which match, display all</b>`which [[-a|--all]] [executable]`


title: TLDR
content:
<b>Edit the sudoers file</b>`sudo visudo`<br><b>Check the sudoers file for errors</b>`sudo visudo [[-c|--check]]`<br><b>Edit the sudoers file using a specific editor</b>`sudo EDITOR=[editor] visudo`<br><b>Display version information</b>`visudo [[-V|--version]]`


title: TLDR
content:
<b>Connect with a defined configuration file</b>`sudo vpnc [config_file]`<br><b>Terminate the previously created connection</b>`sudo vpnc-disconnect`


title: TLDR
content:
<b>Count all lines in a file</b>`wc [[-l|--lines]] [path/to/file]`<br><b>Count all words in a file</b>`wc [[-w|--words]] [path/to/file]`<br><b>Count all bytes in a file</b>`wc [[-c|--bytes]] [path/to/file]`<br><b>Count all characters in a file (taking multi-byte characters into account)</b>`wc [[-m|--chars]] [path/to/file]`<br><b>Count all lines, words and bytes from stdin</b>`[find .] | wc`<br><b>Count the length of the longest line in number of characters</b>`wc [[-L|--max-line-length]] [path/to/file]`


title: TLDR
content:
<b>Display a description from a man page</b>`whatis [command]`<br><b>Don't cut the description off at the end of the line</b>`whatis --long [command]`<br><b>Display descriptions for all commands matching a glob</b>`whatis --wildcard [net*]`<br><b>Search man page descriptions with a regex</b>`whatis --regex '[wish[0-9]\.[0-9]]'`<br><b>Display descriptions in a specific language</b>`whatis --locale=[en] [command]`


title: SYNOPSIS
content:
<p><b>gimp</b> [-h] [--help] [--help-all] [--help-gtk] [-v] [--version] [--license] [--verbose] [-n] [--new-instance] [-a] [--as-new] [-i] [--no-interface] [-d] [--no-data] [-f] [--no-fonts] [-s] [--no-splash] [--no-shm] [--no-cpu-accel] [--display <i>display</i>] [--session <i>&lt;name&gt;</i>] [-g] [--gimprc <i>&lt;gimprc&gt;</i>] [--system-gimprc <i>&lt;gimprc&gt;</i>] [--dump-gimprc<i>] [--console-messages] [--debug-handlers] [--stack-trace-mode &lt;mode&gt;] [--pdb-compat-mode &lt;mode&gt;] [--batch-interpreter &lt;procedure&gt;] [-b] [--batch &lt;command&gt;] [filename] ...</i></p>


title: DESCRIPTION
content:
<p>GIMP is the <i>GNU Image Manipulation Program</i>. It is used to edit and manipulate images. It can load and save a variety of image formats and can be used to convert between formats.</p> <p>GIMP can also be used as a paint program. It features a set of drawing and painting tools such as airbrush, clone, pencil, and paint brush. Painting and drawing tools can be applied to an image with a variety of paint modes. It also offers an extensive array of selection tools like rectangle, ellipse, fuzzy select, bezier select, intelligent scissors, and select by color.</p> <p>GIMP offers a variety of plug-ins that perform a variety of image manipulations. Examples include bumpmap, edge detect, gaussian blur, and many others. In addition, GIMP has several scripting extension which allow for advanced non-interactive processing and creation of images.</p> <p>GIMP ships with a second binary called <i>gimp-console</i>. This binary is a console-only version and behaves as if <i>gimp</i> was called with the --no-interface command-line option.</p> <p>On platforms with the D-Bus message bus system, GIMP will by default check if an instance is already running in this user session. If it detects that, it will pass all filenames given on the command-line to the already running GIMP instance and quit.</p>


title: OPTIONS
content:
<p>GIMP accepts the following options: <b><br> -h, --help</b></p> <p>Show GIMP command-line options.</p> <p><b>--help-all</b></p> <p>Show all command-line options.</p> <p><b>--help-gtk</b></p> <p>Show GTK+ command-line options.</p> <p><b>--help-gegl</b></p> <p>Show GEGL command-line options.</p> <p><b>-v, --version</b></p> <p>Output version information and exit. When combined with the --verbose option, version information about libraries used by GIMP is shown as well.</p> <p><b>--license</b></p> <p>Output license information and exit.</p> <p><b>--verbose</b></p> <p>Be verbose and create information on standard output.</p> <p><b>-n, --new-instance</b></p> <p>Do not attempt to reuse an already running GIMP instance. Always start a new one.</p> <p><b>-a, --as-new</b></p> <p>Open filenames passed on the command-line as new images, don&rsquo;t set the filename on them.</p> <p><b>-i, --no-interface</b></p> <p>Run without a user interface.</p> <p><b>-d, --no-data</b></p> <p>Do not load patterns, gradients, palettes, or brushes. Often useful in non-interactive situations where startup time is to be minimized.</p> <p><b>-f, --no-fonts</b></p> <p>Do not load any fonts. No text functionality will be available if this option is used.</p> <p><b>--display</b> <i>display</i></p> <p>Use the designated X display.</p> <p><b>-s, --no-splash</b></p> <p>Do not show the splash screen.</p> <p><b>--no-shm</b></p> <p>Do not use shared memory between GIMP and its plug-ins. Instead of using shared memory, GIMP will send the data via pipe. This will result in slower performance than using shared memory.</p> <p><b>--no-cpu-accel</b></p> <p>Do not use CPU accelerations such as MMX or SSE even if GIMP detects that your CPU provides this functionality.</p> <p><b>--session</b> <i>&lt;name&gt;</i></p> <p>Use a different sessionrc for this GIMP session. The given session name is appended to the default sessionrc filename.</p> <p><b>-g, --gimprc</b> <i>&lt;gimprc&gt;</i></p> <p>Use an alternative gimprc instead of the default one. Useful in cases where plug-in paths or machine specs may be different.</p> <p><b>--system-gimprc</b> <i>&lt;gimprc&gt;</i></p> <p>Use an alternate system gimprc file.</p> <p><b>--dump-gimprc</b></p> <p>Output a gimprc file with default settings.</p> <p><b>--debug-handlers</b></p> <p>Enable debugging signal handlers.</p> <p><b>-c, --console-messages</b></p> <p>Do not popup dialog boxes on errors or warnings. Print the messages on the console instead.</p> <p><b>--stack-trace-mode</b> <i>{never|query|always}</i></p> <p>If a stack-trace should be generated in case of fatal signals.</p> <p><b>--pdb-compat-mode</b> <i>{off|on|warn}</i></p> <p>If the PDB should provide aliases for deprecated functions.</p> <p><b>--batch-interpreter</b> <i>&lt;procedure&gt;</i></p> <p>Specifies the procedure to use to process batch events. The default is to let Script-Fu evaluate the commands.</p> <p><b>-b, --batch</b> <i>&lt;command&gt;</i></p> <p>Execute <i>&lt;command&gt;</i> non-interactively. This option may appear multiple times. The <i>&lt;command&gt;</i> is passed to the batch interpreter. When <i>&lt;command&gt;</i> is <b>-</b> the commands are read from standard input.</p>


title: ENVIRONMENT
content:
<p>GIMP respects a number of environment variables.</p> <p><b>DISPLAY</b></p> <p>to get the default host and display number.</p> <p><b>GIMP2_DIRECTORY</b></p> <p>to get the name of the personal GIMP directory. If unset .gimp-2.8 is used. If this is an absolute path, it is used as is. If it is a relative path, it is taken to be a subdirectory of the home directory.</p> <p><b>GIMP2_DATADIR</b></p> <p>to get the base location for data files such as brushes and patterns. If unset ${datarootdir}/gimp/2.0 is used.</p> <p><b>GIMP2_LOCALEDIR</b></p> <p>to get the base location for translations. If unset ${datarootdir}/locale is used.</p> <p><b>GIMP2_PLUGINDIR</b></p> <p>to get the base location for plug-ins and modules. If unset ${exec_prefix}/lib/gimp/2.0 is used.</p> <p><b>GIMP2_SYSCONFDIR</b></p> <p>to get the location of configuration files. If unset /etc/gimp/2.0 is used.</p> <p>On Linux GIMP can be compiled with support for binary relocatibility. This will cause data, plug-ins and configuration files to be searched relative to the location of the gimp executable file unless overridden by the environment variables mentioned above.</p>


title: FILES
content:
<p>GIMP&rsquo;s data files are stored in ${datarootdir}/gimp/2.0, where ${datarootdir} is set on install, but is typically /usr/share. GIMP&rsquo;s system-wide configuration files are stored in /etc/gimp/2.0, where ${prefix} is typically /usr.</p> <p>Most GIMP configuration is read in from the user&rsquo;s init file, <b>$HOME</b>/.gimp-2.8/gimprc. The system wide equivalent is in /etc/gimprc. The system wide file is parsed first and the user gimprc can override the system settings. /etc/gimprc_user is the default gimprc placed in users&rsquo; home directories the first time GIMP is run.</p> <p><b>$HOME</b>/.gimp-2.8/devicerc - holds settings for input devices together with the tool, colors, brush, pattern and gradient associated to that device.</p> <p><b>$HOME</b>/.gimp-2.8/gtkrc - users set of GIMP-specific GTK+ config settings. Options such as widget color and fonts sizes can be set here.</p> <p>/etc/gimp/2.0/gtkrc - system wide default set of GIMP-specific GTK+ config settings.</p> <p><b>$HOME</b>/.gimp-2.8/menurc - user&rsquo;s set of keybindings.</p> <p><b>$HOME</b>/.gimp-2.8/parasiterc - Stores all persistent GIMP parasites. This file will be rewritten every time you quit GIMP.</p> <p><b>$HOME</b>/.gimp-2.8/sessionrc - This file takes session-specific info (that is info, you want to keep between two GIMP sessions). You are not supposed to edit it manually, but of course you can do. This file will be entirely rewritten every time you quit GIMP. If this file isn&rsquo;t found, defaults are used.</p> <p><b>$HOME</b>/.gimp-2.8/templaterc - Image templates are kept in this file. New images can conveniently created from these templates. If this file isn&rsquo;t found, defaults are used.</p> <p>/etc/gimp/2.0/unitrc - default user unit database. It contains the unit definitions for centimeters, meters, feet, yards, typographic points and typographic picas and is placed in users home directories the first time GIMP is ran. If this file isn&rsquo;t found, defaults are used.</p> <p><b>$HOME</b>/.gimp-2.8/unitrc - This file contains your user unit database. You can modify this list with the unit editor. You are not supposed to edit it manually, but of course you can do. This file will be entirely rewritten every time you quit GIMP.</p> <p><b>$HOME</b>/.gimp-2.8/plug-ins - location of user installed plug-ins.</p> <p><b>$HOME</b>/.gimp-2.8/pluginrc - plug-in initialization values are stored here. This file is parsed on startup and regenerated if need be.</p> <p><b>$HOME</b>/.gimp-2.8/modules - location of user installed modules.</p> <p><b>$HOME</b>/.gimp-2.8/tmp - default location that GIMP uses as temporary space.</p> <p>${datarootdir}/gimp/2.0/brushes - system wide brush files.</p> <p><b>$HOME</b>/.gimp-2.8/brushes - user created and installed brush files. These files are in the .gbr, .gih or .vbr file formats.</p> <p><b>$HOME</b>/.gimp-2.8/curves - Curve profiles and presets as saved from the Curves tool.</p> <p><b>$HOME</b>/.gimp-2.8/gimpressionist - Presets and user created brushes and papers are stored here.</p> <p><b>$HOME</b>/.gimp-2.8/levels - Level profiles and presets as saved from the Levels tool.</p> <p>${datarootdir}/gimp/2.0/palettes - the system wide palette files.</p> <p><b>$HOME</b>/.gimp-2.8/palettes - user created and modified palette files. This files are in the .gpl format.</p> <p>${datarootdir}/gimp/2.0/patterns - basic set of patterns for use in GIMP.</p> <p><b>$HOME</b>/.gimp-2.8/patterns - user created and installed gimp pattern files. This files are in the .pat format.</p> <p>${datarootdir}/gimp/2.0/gradients - standard system wide set of gradient files.</p> <p><b>$HOME</b>/.gimp-2.8/gradients - user created and installed gradient files.</p> <p>${datarootdir}/gimp/2.0/scripts - system wide directory of scripts used in Script-Fu and other scripting extensions.</p> <p><b>$HOME</b>/.gimp-2.8/scripts - user created and installed scripts.</p> <p>${datarootdir}/gimp/2.0/gflares - system wide directory used by the gflare plug-in.</p> <p><b>$HOME</b>/.gimp-2.8/gflares - user created and installed gflare files.</p> <p>${datarootdir}/gimp/2.0/gfig - system wide directory used by the gfig plug-in.</p> <p><b>$HOME</b>/.gimp-2.8/gfig - user created and installed gfig files.</p> <p>${datarootdir}/gimp/2.0/images/gimp-splash.png - the default image used for the GIMP splash screen.</p> <p>${datarootdir}/gimp/2.0/images/gimp-logo.png - image used in the GIMP about dialog.</p> <p>${datarootdir}/gimp/2.0/tips/gimp-tips.xml - tips as displayed in the &quot;Tip of the Day&quot; dialog box.</p>


title: SPLASH IMAGES
content:
<p>GIMP comes with a default image for the splash screen but it allows system administrators and users to customize the splash screen by providing other images. The image to be used with the splash screen is chosen as follows:</p> <p>1.</p> <p>GIMP tries to load a random splash screen from the directory <b>$HOME</b>/.gimp-2.8/splashes.</p> <p>2.</p> <p>It then falls back to using <b>$HOME</b>/.gimp-2.8/gimp-splash.png.</p> <p>3.</p> <p>If the user didn&rsquo;t install any custom splash images, a random image is picked from ${datarootdir}/gimp/2.0/splashes.</p> <p>4.</p> <p>As a last resort, GIMP uses the default splash image located at ${datarootdir}/gimp/2.0/images/gimp-splash.png.</p>


title: SUGGESTIONS AND BUG REPORTS
content:
<p>Any bugs found should be reported to the online bug-tracking system available on the web at http://bugzilla.gnome.org/. Before reporting bugs, please check to see if the bug has already been reported.</p> <p>When reporting GIMP bugs, it is important to include a reliable way to reproduce the bug, version number of GIMP (and probably GTK+), OS name and version, and any relevant hardware specs. If a bug is causing a crash, it is very useful if a stack trace can be provided. And of course, patches to rectify the bug are even better.</p>


title: OTHER INFO
content:
<p>The canonical place to find GIMP info is at http://www.gimp.org/. Here you can find links to just about many other GIMP sites, tutorials, data sets, mailing list archives, and more.</p> <p>There is also a GIMP User Manual available at http://docs.gimp.org/ that goes into much more detail about the interactive use of GIMP.</p> <p>The latest versions of GIMP and the GTK+ libs are always available at ftp://ftp.gimp.org/.</p>


title: AUTHORS
content:
<p>Spencer Kimball, Peter Mattis and the GIMP Development Team.</p> <p>With patches, fixes, plug-ins, extensions, scripts, translations, documentation and more from lots and lots of people all over the world.</p>


title: TLDR
content:
<b>Create a hard link from a new file to an existing file</b>`link [path/to/existing_file] [path/to/new_file]`


title: TLDR
content:
<b>Add a file to the index</b>`git add [path/to/file]`<br><b>Add all files (tracked and untracked)</b>`git add [[-A|--all]]`<br><b>Add all files recursively starting from the current folder</b>`git add .`<br><b>Only add already tracked files</b>`git add [[-u|--update]]`<br><b>Also add ignored files</b>`git add [[-f|--force]]`<br><b>Interactively stage parts of files</b>`git add [[-p|--patch]]`<br><b>Interactively stage parts of a given file</b>`git add [[-p|--patch]] [path/to/file]`<br><b>Interactively stage a file</b>`git add [[-i|--interactive]]`


title: TLDR
content:
<b>Apply and commit changes following a local patch file</b>`git am [path/to/file.patch]`<br><b>Apply and commit changes following a remote patch file</b>`curl [[-L|--location]] [https://example.com/file.patch] | git apply`<br><b>Abort the process of applying a patch file</b>`git am --abort`<br><b>Apply as much of a patch file as possible, saving failed hunks to reject files</b>`git am --reject [path/to/file.patch]`


title: TLDR
content:
<b>Start a bisect session on a commit range bounded by a known buggy commit, and a known clean (typically older) one</b>`git bisect start [bad_commit] [good_commit]`<br><b>For each commit that git bisect selects, mark it as "bad" or "good" after testing it for the issue</b>`git bisect [good|bad]`<br><b>End the bisect session and return to the previous branch</b>`git bisect reset`<br><b>Skip a commit during a bisect (e.g. one that fails the tests due to a different issue)</b>`git bisect skip`<br><b>Start a bisect session considering only commits that modify a specific file or directory</b>`git bisect start [bad_commit] [good_commit] -- [path/to/file_or_directory]`<br><b>Automate the bisect process using a test script that exits with 0 for "good" and non-zero for "bad"</b>`git bisect run [path/to/test_script] [optional_script_arguments]`<br><b>Display a log of what has been done so far</b>`git bisect log`<br><b>Show remaining candidate commits to be checked</b>`git bisect visualize`


title: TLDR
content:
<b>Print file with author name and commit hash on each line</b>`git blame [path/to/file]`<br><b>Print file with author email and commit hash on each line</b>`git blame [[-e|--show-email]] [path/to/file]`<br><b>Print file with author name and commit hash on each line at a specific commit</b>`git blame [commit] [path/to/file]`<br><b>Print file with author name and commit hash on each line before a specific commit</b>`git blame [commit]~ [path/to/file]`<br><b>Jump to the parent of a specific commit and track a specific text and 10 of its following lines</b>`git blame -L '/[text]/',+10 [a82812aa]^ [path/to/file]`<br><b>Print author name and commit hash information for a specific line range</b>`git blame -L [start_line],[end_line] [path/to/file]`<br><b>Ignore whitespaces and line moves</b>`git blame -w -C -C -C [path/to/file]`


title: TLDR
content:
<b>List all branches (local and remote; the current branch is highlighted by *)</b>`git branch [[-a|--all]]`<br><b>List which branches include a specific Git commit in their history</b>`git branch [[-a|--all]] --contains [commit_hash]`<br><b>Show the name of the current branch</b>`git branch --show-current`<br><b>Create new branch based on the current commit</b>`git branch [branch_name]`<br><b>Create new branch based on a specific commit</b>`git branch [branch_name] [commit_hash]`<br><b>Rename a branch (you must switch to a different branch before doing this)</b>`git branch [[-m|--move]] [old_branch_name] [new_branch_name]`<br><b>Delete a local branch (you must switch to a different branch before doing this)</b>`git branch [[-d|--delete]] [branch_name]`<br><b>Delete a remote branch</b>`git push [remote_name] [[-d|--delete]] [remote_branch_name]`


title: TLDR
content:
<b>Check whether a file or directory is ignored</b>`git check-ignore [path/to/file_or_directory]`<br><b>Check whether multiple files or directories are ignored</b>`git check-ignore [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Use pathnames, one per line, from stdin</b>`git < [path/to/file_list] check-ignore --stdin`<br><b>Do not check the index (used to debug why paths were tracked and not ignored)</b>`git check-ignore --no-index [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Include details about the matching pattern for each path</b>`git check-ignore [[-v|--verbose]] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`


title: TLDR
content:
<b>Create and switch to a new branch</b>`git checkout -b [branch_name]`<br><b>Create and switch to a new branch based on a specific reference (branch, remote/branch, tag are examples of valid references)</b>`git checkout -b [branch_name] [reference]`<br><b>Switch to an existing local branch</b>`git checkout [branch_name]`<br><b>Switch to the previously checked out branch</b>`git checkout -`<br><b>Switch to an existing remote branch</b>`git checkout [[-t|--track]] [remote_name]/[branch_name]`<br><b>Discard all unstaged changes in the current directory (see git reset for more undo-like commands)</b>`git checkout .`<br><b>Discard unstaged changes to a given file</b>`git checkout [path/to/file]`<br><b>Replace a file in the current directory with the version of it committed in a given branch</b>`git checkout [branch_name] -- [path/to/file]`


title: TLDR
content:
<b>Apply a commit to the current branch</b>`git cherry-pick [commit]`<br><b>Apply a range of commits to the current branch (see also: git rebase --onto)</b>`git cherry-pick [start_commit]~..[end_commit]`<br><b>Apply multiple (non-sequential) commits to the current branch</b>`git cherry-pick [commit1 commit2 ...]`<br><b>Add the changes of a commit to the working directory, without creating a commit</b>`git cherry-pick [[-n|--no-commit]] [commit]`


title: TLDR
content:
<b>Delete untracked files</b>`git clean`<br><b>Interactively delete untracked files</b>`git clean [[-i|--interactive]]`<br><b>Show which files would be deleted without actually deleting them</b>`git clean [[-n|--dry-run]]`<br><b>Forcefully delete untracked files</b>`git clean [[-f|--force]]`<br><b>Forcefully delete untracked [d]irectories</b>`git clean [[-f|--force]] -d`<br><b>Delete untracked files, including e[x]cluded files (files ignored in .gitignore and .git/info/exclude)</b>`git clean -x`


title: TLDR
content:
<b>Clone an existing repository into a new directory (the default directory is the repository name)</b>`git clone [remote_repository_location] [path/to/directory]`<br><b>Clone an existing repository and its submodules</b>`git clone --recursive [remote_repository_location]`<br><b>Clone only the .git directory of an existing repository</b>`git clone [[-n|--no-checkout]] [remote_repository_location]`<br><b>Clone a local repository</b>`git clone [[-l|--local]] [path/to/local_repository]`<br><b>Clone quietly</b>`git clone [[-q|--quiet]] [remote_repository_location]`<br><b>Clone an existing repository only fetching the 10 most recent commits on the default branch (useful to save time)</b>`git clone --depth 10 [remote_repository_location]`<br><b>Clone an existing repository only fetching a specific branch</b>`git clone [[-b|--branch]] [name] --single-branch [remote_repository_location]`<br><b>Clone an existing repository using a specific SSH command</b>`git clone [[-c|--config]] core.sshCommand="[ssh -i path/to/private_ssh_key]" [remote_repository_location]`


title: TLDR
content:
<b>Commit staged files to the repository with a message</b>`git commit [[-m|--message]] "[message]"`<br><b>Commit staged files with a message read from a file</b>`git commit [[-F|--file]] [path/to/commit_message_file]`<br><b>Auto stage all modified and deleted files and commit with a message</b>`git commit [[-a|--all]] [[-m|--message]] "[message]"`<br><b>Commit staged files and sign them with the specified GPG key (or the one defined in the configuration file if no argument is specified)</b>`git commit [[-S|--gpg-sign]] [key_id] [[-m|--message]] "[message]"`<br><b>Update the last commit by adding the currently staged changes, changing the commit's hash</b>`git commit --amend`<br><b>Commit only specific (already staged) files</b>`git commit [path/to/file1 path/to/file2 ...]`<br><b>Create a commit, even if there are no staged files</b>`git commit [[-m|--message]] "[message]" --allow-empty`


title: TLDR
content:
<b>Globally set your name or email (this information is required to commit to a repository and will be included in all commits)</b>`git config --global [user.name|user.email] "[Your Name|email@example.com]"`<br><b>List local, global or system configuration entries and show their file location</b>`git config [[-l|--list]] --[local|global|system] --show-origin`<br><b>Set the global value of a given configuration entry (in this case an alias)</b>`git config --global [alias.unstage] "reset HEAD --"`<br><b>Get the value of a given configuration entry</b>`git config [alias.unstage]`<br><b>Use an alias</b>`git [unstage]`<br><b>Revert a global configuration entry to its default value</b>`git config --global --unset [alias.unstage]`<br><b>Edit the local Git configuration (.git/config) in the default editor</b>`git config [[-e|--edit]]`<br><b>Edit the global Git configuration (~/.gitconfig by default or $XDG_CONFIG_HOME/git/config if such a file exists) in the default editor</b>`git config --global [[-e|--edit]]`


title: TLDR
content:
<b>Show unstaged changes</b>`git diff`<br><b>Show all uncommitted changes (including staged ones)</b>`git diff HEAD`<br><b>Show only staged (added, but not yet committed) changes</b>`git diff --staged`<br><b>Show changes from all commits since a given date/time (a date expression, e.g. "1 week 2 days" or an ISO date)</b>`git diff 'HEAD@[{3 months|weeks|days|hours|seconds ago]}'`<br><b>Show diff statistics, like files changed, histogram, and total line insertions/deletions</b>`git diff --stat [commit]`<br><b>Output a summary of file creations, renames and mode changes since a given commit</b>`git diff --summary [commit]`<br><b>Compare a single file between two branches or commits</b>`git diff [branch_1]..[branch_2] [path/to/file]`<br><b>Compare different files from the current branch to another branch</b>`git diff [other_branch]:[path/to/file2] [path/to/file1]`


title: TLDR
content:
<b>Fetch the latest changes from the default remote upstream repository (if set)</b>`git fetch`<br><b>Fetch new branches from a specific remote upstream repository</b>`git fetch [remote_name]`<br><b>Fetch the latest changes from all remote upstream repositories</b>`git fetch --all`<br><b>Also fetch tags from the remote upstream repository</b>`git fetch [[-t|--tags]]`<br><b>Delete local references to remote branches that have been deleted upstream</b>`git fetch [[-p|--prune]]`<br><b>Deepen current shallow branch by 2 commits</b>`git fetch --deepen 2`<br><b>Update the main branch without switching to it (equivalent to git pull)</b>`git fetch [origin] main:main`


title: TLDR
content:
<b>Create an auto-named .patch file for all the unpushed commits</b>`git format-patch [origin]`<br><b>Write a .patch file for all the commits between 2 revisions to stdout</b>`git format-patch [revision_1]..[revision_2]`<br><b>Write a .patch file for the n latest commits</b>`git format-patch -[n]`


title: TLDR
content:
<b>Optimise the repository</b>`git gc`<br><b>Aggressively optimise, takes more time</b>`git gc --aggressive`<br><b>Do not prune loose objects (prunes by default)</b>`git gc --no-prune`<br><b>Suppress all output</b>`git gc --quiet`<br><b>Display help</b>`git gc --help`


title: TLDR
content:
<b>Search for a string in tracked files</b>`git grep [search_string]`<br><b>Search for a string in files matching a pattern in tracked files</b>`git grep [search_string] -- [file_glob_pattern]`<br><b>Search for a string in tracked files, including submodules</b>`git grep --recurse-submodules [search_string]`<br><b>Search for a string at a specific point in history</b>`git grep [search_string] [HEAD~2]`<br><b>Search for a string across all branches</b>`git grep [search_string] $(git rev-list --all)`


title: TLDR
content:
<b>Initialize a new local repository</b>`git init`<br><b>Initialize a repository with the specified name for the initial branch</b>`git init [[-b|--initial-branch]] [branch_name]`<br><b>Initialize a repository using SHA256 for object hashes (requires Git version 2.29+)</b>`git init --object-format sha256`<br><b>Initialize a barebones repository, suitable for use as a remote over SSH</b>`git init --bare`


title: TLDR
content:
<b>Show the sequence of commits starting from the current one, in reverse chronological order of the Git repository in the current working directory</b>`git log`<br><b>Show the history of a particular file or directory, including differences</b>`git log [[-p|--patch]] [path/to/file_or_directory]`<br><b>Show an overview of which file(s) changed in each commit</b>`git log --stat`<br><b>Show a graph of commits in the current branch using only the first line of each commit message</b>`git log --oneline --graph`<br><b>Show a graph of all commits, tags and branches in the entire repo</b>`git log --oneline --decorate --all --graph`<br><b>Show only commits with messages that include a specific string, ignoring case</b>`git log [[-i|--regexp-ignore-case]] --grep [search_string]`<br><b>Show the last n number of commits from a certain author</b>`git log [[-n|--max-count]] [n] --author "[author]"`<br><b>Show commits between two dates (yyyy-mm-dd)</b>`git log --before "[2017-01-29]" --after "[2017-01-17]"`


title: TLDR
content:
<b>Merge a branch into your current branch</b>`git merge [branch_name]`<br><b>Edit the merge message</b>`git merge [[-e|--edit]] [branch_name]`<br><b>Merge a branch and create a merge commit</b>`git merge --no-ff [branch_name]`<br><b>Abort a merge in case of conflicts</b>`git merge --abort`<br><b>Merge using a specific strategy</b>`git merge [[-s|--strategy]] [strategy] [[-X|--strategy-option]] [strategy_option] [branch_name]`


title: TLDR
content:
<b>Move a file inside the repo and add the movement to the next commit</b>`git mv [path/to/file] [path/to/destination]`<br><b>Rename a file or directory and add the renaming to the next commit</b>`git mv [path/to/file_or_directory] [path/to/destination]`<br><b>Overwrite the file or directory in the target path if it exists</b>`git mv [[-f|--force]] [path/to/file_or_directory] [path/to/destination]`


title: TLDR
content:
<b>Download changes from default remote repository and merge it</b>`git pull`<br><b>Download changes from default remote repository and use fast-forward</b>`git pull [[-r|--rebase]]`<br><b>Download changes from given remote repository and branch, then merge them into HEAD</b>`git pull [remote_name] [branch]`


title: TLDR
content:
<b>Send local changes in the current branch to its default remote counterpart</b>`git push`<br><b>Send changes from a specific local branch to its remote counterpart</b>`git push [remote_name] [local_branch]`<br><b>Send changes from a specific local branch to its remote counterpart, and set the remote one as the default push/pull target of the local one</b>`git push [[-u|--set-upstream]] [remote_name] [local_branch]`<br><b>Send changes from a specific local branch to a specific remote branch</b>`git push [remote_name] [local_branch]:[remote_branch]`<br><b>Send changes on all local branches to their counterparts in a given remote repository</b>`git push --all [remote_name]`<br><b>Delete a branch in a remote repository</b>`git push [remote_name] [[-d|--delete]] [remote_branch]`<br><b>Remove remote branches that don't have a local counterpart</b>`git push --prune [remote_name]`<br><b>Publish tags that aren't yet in the remote repository</b>`git push --tags`


title: TLDR
content:
<b>Rebase the current branch on top of another specified branch</b>`git rebase [new_base_branch]`<br><b>Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified</b>`git rebase [[-i|--interactive]] [target_base_branch_or_commit_hash]`<br><b>Continue a rebase that was interrupted by a merge failure, after editing conflicting files</b>`git rebase --continue`<br><b>Continue a rebase that was paused due to merge conflicts, by skipping the conflicted commit</b>`git rebase --skip`<br><b>Abort a rebase in progress (e.g. if it is interrupted by a merge conflict)</b>`git rebase --abort`<br><b>Move part of the current branch onto a new base, providing the old base to start from</b>`git rebase --onto [new_base] [old_base]`<br><b>Reapply the last 5 commits in-place, stopping to allow them to be reordered, omitted, combined or modified</b>`git rebase [[-i|--interactive]] [HEAD~5]`<br><b>Auto-resolve any conflicts by favoring the working branch version (theirs keyword has reversed meaning in this case)</b>`git rebase [[-X|--strategy-option]] theirs [branch_name]`


title: TLDR
content:
<b>Show the reflog for HEAD</b>`git reflog`<br><b>Show the reflog for a given branch</b>`git reflog [branch_name]`<br><b>Show only the 5 latest entries in the reflog</b>`git reflog [[-n|--max-count]] 5`


title: TLDR
content:
<b>List existing remotes with their names and URLs</b>`git remote [[-v|--verbose]]`<br><b>Show information about a remote</b>`git remote show [remote_name]`<br><b>Add a remote</b>`git remote add [remote_name] [remote_url]`<br><b>Change the URL of a remote (use --add to keep the existing URL)</b>`git remote set-url [remote_name] [new_url]`<br><b>Show the URL of a remote</b>`git remote get-url [remote_name]`<br><b>Remove a remote</b>`git remote remove [remote_name]`<br><b>Rename a remote</b>`git remote rename [old_name] [new_name]`


title: TLDR
content:
<b>Unstage everything</b>`git reset`<br><b>Unstage specific file(s)</b>`git reset [path/to/file1 path/to/file2 ...]`<br><b>Interactively unstage portions of a file</b>`git reset [[-p|--patch]] [path/to/file]`<br><b>Undo the last commit, keeping its changes (and any further uncommitted changes) in the filesystem</b>`git reset HEAD~`<br><b>Undo the last two commits, adding their changes to the index, i.e. staged for commit</b>`git reset --soft HEAD~2`<br><b>Discard any uncommitted changes, staged or not (for only unstaged changes, use git checkout)</b>`git reset --hard`<br><b>Reset the repository to a given commit, discarding committed, staged and uncommitted changes since then</b>`git reset --hard [commit]`


title: TLDR
content:
<b>Restore an unstaged file to the staged version</b>`git restore [path/to/file]`<br><b>Restore an unstaged file to the version of a specific commit</b>`git restore [[-s|--source]] [commit] [path/to/file]`<br><b>Discard all unstaged changes to tracked files</b>`git restore :/`<br><b>Unstage a file</b>`git restore [[-S|--staged]] [path/to/file]`<br><b>Unstage all files</b>`git restore [[-S|--staged]] :/`<br><b>Discard all changes to files, both staged and unstaged</b>`git restore [[-W|--worktree]] [[-S|--staged]] :/`<br><b>Interactively select sections of files to restore</b>`git restore [[-p|--patch]]`


title: TLDR
content:
<b>Revert the most recent commit</b>`git revert [HEAD]`<br><b>Revert the 5th last commit</b>`git revert HEAD~[4]`<br><b>Revert a specific commit</b>`git revert [0c01a9]`<br><b>Revert multiple commits</b>`git revert [branch_name~5..branch_name~2]`<br><b>Don't create new commits, just change the working tree</b>`git revert [[-n|--no-commit]] [0c01a9..9a1743]`<br><b>Cancel a Git revert after a merge conflict</b>`git revert --abort`


title: TLDR
content:
<b>Remove file from repository index and filesystem</b>`git rm [path/to/file]`<br><b>Remove directory</b>`git rm -r [path/to/directory]`<br><b>Remove file from repository index but keep it untouched locally</b>`git rm --cached [path/to/file]`


title: TLDR
content:
<b>Display the file access control list</b>`getfacl [path/to/file_or_directory]`<br><b>Display the file access control list with numeric user and group IDs</b>`getfacl [[-n|--numeric]] [path/to/file_or_directory]`<br><b>Display the file access control list with tabular output format</b>`getfacl [[-t|--tabular]] [path/to/file_or_directory]`


title: TLDR
content:
<b>View a summary of all the commits made, grouped alphabetically by author name</b>`git shortlog`<br><b>View a summary of all the commits made, sorted by the number of commits made</b>`git shortlog [[-n|--numbered]]`<br><b>View a summary of all the commits made, grouped by the committer identities (name and email)</b>`git shortlog [[-c|--committer]]`<br><b>View a summary of the last 5 commits (i.e. specify a revision range)</b>`git shortlog HEAD~5..HEAD`<br><b>View all users, emails and the number of commits in the current branch</b>`git shortlog [[-s|--summary]] [[-n|--numbered]] [[-e|--email]]`<br><b>View all users, emails and the number of commits in all branches</b>`git shortlog [[-s|--summary]] [[-n|--numbered]] [[-e|--email]] --all`


title: TLDR
content:
<b>Show information about the latest commit (hash, message, changes, and other metadata)</b>`git show`<br><b>Show information about a specific commit, tag, or branch (such as HEAD for the latest commit)</b>`git show [commit|tag|branch]`<br><b>Show only the list of added, renamed or deleted files</b>`git show --summary [commit]`<br><b>Show information about the 3rd commit from the HEAD of a branch</b>`git show [branch]~[3]`<br><b>Show a commit's message in a single line, suppressing the diff output</b>`git show --oneline [[-s|--no-patch]] [commit]`<br><b>Show only statistics (added/removed characters) about the changed files</b>`git show --stat [commit]`<br><b>Show a simplified list of all files changed in a commit (modified, added, and deleted)</b>`git show --name-only [commit]`<br><b>Show the contents of a file as it was at a given revision (e.g. branch, tag or commit)</b>`git show [revision]:[path/to/file]`


title: TLDR
content:
<b>Stash current changes with a message, except new (untracked) files</b>`git stash push [[-m|--message]] [stash_message]`<br><b>Stash current changes, including new untracked files</b>`git stash [[-u|--include-untracked]]`<br><b>Interactively select parts of changed files for stashing</b>`git stash [[-p|--patch]]`<br><b>List all stashes (shows stash name, related branch and message)</b>`git stash list`<br><b>Show the changes as a patch between the stash (default is stash@{0}) and the commit back when stash entry was first created</b>`git stash show [[-p|--patch]] [stash@{0]}`<br><b>Apply a stash (default is the latest, named stash@{0})</b>`git stash apply [optional_stash_name_or_commit]`<br><b>Drop or apply a stash (default is stash@{0}) and remove it from the stash list if applying doesn't cause conflicts</b>`git stash pop [optional_stash_name]`<br><b>Drop all stashes</b>`git stash clear`


title: TLDR
content:
<b>Show changed files which are not yet added for commit</b>`git status`<br><b>Give output in short format</b>`git status [[-s|--short]]`<br><b>Show verbose information on changes in both the staging area and working directory</b>`git status [[-vv|--verbose --verbose]]`<br><b>Show the branch and tracking info</b>`git status [[-b|--branch]]`<br><b>Show output in short format along with branch info</b>`git status [[-sb|--short --branch]]`<br><b>Show the number of entries currently stashed away</b>`git status --show-stash`<br><b>Don't show untracked files in the output</b>`git status [[-uno|--untracked-files=no]]`


title: TLDR
content:
<b>Clone an SVN repository</b>`git svn clone [https://example.com/subversion_repo] [local_directory]`<br><b>Clone an SVN repository starting at a given revision number</b>`git svn clone [[-r|--revision]] [1234]:HEAD [https://svn.example.net/subversion/repo] [local_directory]`<br><b>Update local clone from the remote SVN repository</b>`git svn rebase`<br><b>Fetch updates from the remote SVN repository without changing the Git HEAD</b>`git svn fetch`<br><b>Commit back to the SVN repository</b>`git svn commit`


title: TLDR
content:
<b>Switch to an existing branch</b>`git switch [branch_name]`<br><b>Create a new branch and switch to it</b>`git switch [[-c|--create]] [branch_name]`<br><b>Create a new branch based on an existing commit and switch to it</b>`git switch [[-c|--create]] [branch_name] [commit]`<br><b>Switch to the previous branch</b>`git switch -`<br><b>Switch to a branch and update all submodules to match</b>`git switch --recurse-submodules [branch_name]`<br><b>Switch to a branch and automatically merge the current branch and any uncommitted changes into it</b>`git switch [[-m|--merge]] [branch_name]`<br><b>Switch to a tag</b>`git switch [[-d|--detach]] [tag]`


title: TLDR
content:
<b>List all tags</b>`git tag`<br><b>Create a tag with the given name pointing to the current commit</b>`git tag [tag_name]`<br><b>Create a tag with the given name pointing to a given commit</b>`git tag [tag_name] [commit]`<br><b>Create an annotated tag with the given message</b>`git tag [tag_name] [[-m|--message]] [tag_message]`<br><b>Delete the tag with the given name</b>`git tag [[-d|--delete]] [tag_name]`<br><b>Get updated tags from remote</b>`git fetch [[-t|--tags]]`<br><b>Push a tag to remote</b>`git push origin tag [tag_name]`<br><b>List all tags which contain a given commit (HEAD if not specified)</b>`git tag --contains [commit]`


title: TLDR
content:
<b>Get list of all groups</b>`getent group`<br><b>See the members of a group</b>`getent group [group_name]`<br><b>Get list of all services</b>`getent services`<br><b>Find a username by UID</b>`getent passwd 1000`<br><b>Perform a reverse DNS lookup</b>`getent hosts [host]`


title: TLDR
content:
<b>Create an empty Git repository</b>`git init`<br><b>Clone a remote Git repository from the internet</b>`git clone [https://example.com/repo.git]`<br><b>View the status of the local repository</b>`git status`<br><b>Stage all changes for a commit</b>`git add [[-A|--all]]`<br><b>Commit changes to version history</b>`git commit [[-m|--message]] [message_text]`<br><b>Push local commits to a remote repository</b>`git push`<br><b>Pull any changes made to a remote</b>`git pull`<br><b>Reset everything the way it was in the latest commit</b>`git reset --hard; git clean [[-f|--force]]`


title: TLDR
content:
<b>Run in terminal</b>`glances`<br><b>Run in web server mode to show results in browser</b>`glances [[-w|--webserver]]`<br><b>Run in server mode to allow connections from other Glances clients</b>`glances [[-s|--server]]`<br><b>Connect to a Glances server</b>`glances [[-c|--client]] [hostname]`<br><b>Require a password in (web) server mode</b>`glances [[-s|--server]] --password`<br><b>Exit Glances</b>`<q>`<br><b>Display help</b>`glances [[-h|--help]]`


title: TLDR
content:
<b>Show the repository browser for the current Git repository</b>`gitk`<br><b>Show repository browser for a specific file or directory</b>`gitk [path/to/file_or_directory]`<br><b>Show commits made since 1 week ago</b>`gitk --since="[1 week ago]"`<br><b>Show commits older than 1/1/2016</b>`gitk --until="[1/1/2015]"`<br><b>Show at most 100 changes in all branches</b>`gitk --max-count=100 --all`


title: TLDR
content:
<b>Compile resources referenced in file.gresource.xml to a .gresource binary</b>`glib-compile-resources [file.gresource.xml]`<br><b>Compile resources referenced in file.gresource.xml to a C source file</b>`glib-compile-resources --generate-source [file.gresource.xml]`<br><b>Compile resources in file.gresource.xml to a chosen target file, with .c, .h or .gresource extension</b>`glib-compile-resources --generate --target=[file.ext] [file.gresource.xml]`<br><b>Print a list of resource files referenced in file.gresource.xml</b>`glib-compile-resources --generate-dependencies [file.gresource.xml]`


title: TLDR
content:
<b>Create a GPG public and private key interactively</b>`gpg [[--full-gen-key|--full-generate-key]]`<br><b>List all keys from the public keyring</b>`gpg [[-k|--list-keys]]`<br><b>Sign doc.txt without encryption (writes output to doc.txt.asc)</b>`gpg --clearsign [doc.txt]`<br><b>Encrypt and sign doc.txt for alice@example.com and bob@example.com (output to doc.txt.gpg)</b>`gpg [[-es|--encrypt --sign]] [[-r|--recipient]] [alice@example.com] [[-r|--recipient]] [bob@example.com] [doc.txt]`<br><b>Encrypt doc.txt with only a passphrase (output to doc.txt.gpg)</b>`gpg [[-c|--symmetric]] [doc.txt]`<br><b>Decrypt doc.txt.gpg (output to stdout)</b>`gpg [[-d|--decrypt]] [doc.txt.gpg]`<br><b>Import a public key</b>`gpg --import [public.gpg]`<br><b>Export the public/private key for alice@example.com (output to stdout)</b>`gpg [--export|--export-secret-keys] [[-a|--armor]] [alice@example.com]`


title: TLDR
content:
<b>Encrypt a directory into archive.gpg using a passphrase</b>`gpg-zip [[-c|--symmetric]] [[-o|--output]] [archive.gpg] [path/to/directory]`<br><b>Decrypt archive.gpg into a directory of the same name</b>`gpg-zip [[-d|--decrypt]] [path/to/archive.gpg]`<br><b>List the contents of the encrypted archive.gpg</b>`gpg-zip --list-archive [path/to/archive.gpg]`


title: TLDR
content:
<b>Define group administrators</b>`sudo gpasswd [[-A|--administrators]] [user1,user2] [group]`<br><b>Set the list of group members</b>`sudo gpasswd [[-M|--members]] [user1,user2] [group]`<br><b>Create a password for the named group</b>`gpasswd [group]`<br><b>Add a user to the named group</b>`gpasswd [[-a|--add]] [user] [group]`<br><b>Remove a user from the named group</b>`gpasswd [[-d|--delete]] [user] [group]`


title: TLDR
content:
<b>Search for a pattern within a file</b>`grep "[search_pattern]" [path/to/file1 path/to/file2 ...]`<br><b>Search for an exact string (disables regexes)</b>`grep [[-F|--fixed-strings]] "[exact_string]" [path/to/file]`<br><b>Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files</b>`grep [[-rnI|--recursive --line-number --binary-files=without-match]] "[search_pattern]" [path/to/directory]`<br><b>Use extended regexes (supports ?, +, {}, (), and |), in case-insensitive mode</b>`grep [[-Ei|--extended-regexp --ignore-case]] "[search_pattern]" [path/to/file]`<br><b>Print 3 lines of [C]ontext around, [B]efore or [A]fter each match</b>`grep [--context|--before-context|--after-context] 3 "[search_pattern]" [path/to/file]`<br><b>Print file name and line number for each match with color output</b>`grep [[-Hn|--with-filename --line-number]] --color=always "[search_pattern]" [path/to/file]`<br><b>Search for lines matching a pattern, printing only the matched text</b>`grep [[-o|--only-matching]] "[search_pattern]" [path/to/file]`<br><b>Search stdin for lines that do not match a pattern</b>`cat [path/to/file] | grep [[-v|--invert-match]] "[search_pattern]"`


title: TLDR
content:
<b>Start a REPL session either with the project or standalone</b>`boot repl`<br><b>Build a single uberjar</b>`boot jar`<br><b>Generate scaffolding for a new project based on a template</b>`boot --dependencies boot/new new --template [template_name] --name [project_name]`<br><b>Build for development (if using the boot/new template)</b>`boot dev`<br><b>Build for production (if using the boot/new template)</b>`boot prod`<br><b>Display help for a specific task</b>`boot [task] --help`


title: TLDR
content:
<b>Create a new group</b>`sudo groupadd [group_name]`<br><b>Create a new system group</b>`sudo groupadd [[-r|--system]] [group_name]`<br><b>Create a new group with the specific groupid</b>`sudo groupadd [[-g|--gid]] [id] [group_name]`


title: TLDR
content:
<b>Print group memberships for the current user</b>`groups`<br><b>Print group memberships for a list of users</b>`groups [username1 username2 ...]`


title: TLDR
content:
<b>Change the group name</b>`sudo groupmod [[-n|--new-name]] [new_group] [group_name]`<br><b>Change the group ID</b>`sudo groupmod [[-g|--gid]] [new_id] [group_name]`


title: TLDR
content:
<b>To view a file</b>`gs -dQUIET -dBATCH [file.pdf]`<br><b>Reduce PDF file size to 150 dpi images for reading on a e-book device</b>`gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile=[output.pdf] [input.pdf]`<br><b>Convert PDF file (pages 1 through 3) to an image with 150 dpi resolution</b>`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -dFirstPage=[1] -dLastPage=[3] -sOutputFile=[output_%d.jpg] [input.pdf]`<br><b>Extract pages from a PDF file</b>`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=[output.pdf] [input.pdf]`<br><b>Merge PDF files</b>`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=[output.pdf] [input1.pdf] [input2.pdf]`<br><b>Convert from PostScript file to PDF file</b>`gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=[output.pdf] [input.ps]`


title: TLDR
content:
<b>Start a REPL (interactive shell)</b>`guile`<br><b>Execute the script in a given Scheme file</b>`guile [script.scm]`<br><b>Execute a Scheme expression</b>`guile -c "[expression]"`<br><b>Listen on a port or a Unix domain socket (the default is port 37146) for remote REPL connections</b>`guile --listen=[port_or_socket]`


title: TLDR
content:
<b>Extract a file from an archive, replacing the original file if it exists</b>`gunzip [archive.tar.gz]`<br><b>Extract a file to a target destination</b>`gunzip [[-c|--stdout]] [archive.tar.gz] > [archive.tar]`<br><b>Extract a file and keep the archive file</b>`gunzip [[-k|--keep]] [archive.tar.gz]`<br><b>List the contents of a compressed file</b>`gunzip [[-l|--list]] [file.txt.gz]`<br><b>Decompress an archive from stdin</b>`cat [path/to/archive.gz] | gunzip`


title: TLDR
content:
<b>Compress executable</b>`upx [path/to/file]`<br><b>Decompress executable</b>`upx -d [path/to/file]`<br><b>Display help</b>`upx --help`


title: TLDR
content:
<b>[a]rchive a file or directory</b>`7za a [path/to/archive.7z] [path/to/file_or_directory]`<br><b>Encrypt an existing archive (including file names)</b>`7za a [path/to/encrypted.7z] -p[password] -mhe=[on] [path/to/archive.7z]`<br><b>E[x]tract an archive preserving the original directory structure</b>`7za x [path/to/archive.7z]`<br><b>E[x]tract an archive to a specific directory</b>`7za x [path/to/archive.7z] -o[path/to/output]`<br><b>E[x]tract an archive to stdout</b>`7za x [path/to/archive.7z] -so`<br><b>[a]rchive using a specific archive type</b>`7za a -t[7z|bzip2|gzip|lzip|tar|...] [path/to/archive.7z] [path/to/file_or_directory]`<br><b>[l]ist the contents of an archive</b>`7za l [path/to/archive.7z]`<br><b>Set the level of compression (higher means more compression, but slower)</b>`7za a [path/to/archive.7z] -mx=[0|1|3|5|7|9] [path/to/file_or_directory]`


title: TLDR
content:
<b>Lookup A, AAAA, and MX records of a domain</b>`host [domain]`<br><b>Lookup a field (CNAME, TXT, ...) of a domain</b>`host -t [field] [domain]`<br><b>Reverse lookup an IP</b>`host [ip_address]`<br><b>Specify an alternate DNS server to query</b>`host [domain] [8.8.8.8]`


title: TLDR
content:
<b>Print the hexadecimal representation of a file, replacing duplicate lines by *</b>`hexdump [path/to/file]`<br><b>Display the input offset in hexadecimal and its ASCII representation in two columns</b>`hexdump -C [path/to/file]`<br><b>Display the hexadecimal representation of a file, but interpret only a specific number of bytes of the input</b>`hexdump -C -n [number_of_bytes] [path/to/file]`<br><b>Verbose - no suppression by * on duplicate lines</b>`hexdump -v [path/to/file]`<br><b>Format output using printf-like format string</b>`hexdump -e '[element_format .. end_format]' [path/to/file]`


title: TLDR
content:
<b>Compress a file, replacing it with a gzip archive</b>`gzip [path/to/file]`<br><b>Decompress a file, replacing it with the original uncompressed version</b>`gzip [[-d|--decompress]] [path/to/file.gz]`<br><b>Compress a file, keeping the original file</b>`gzip [[-k|--keep]] [path/to/file]`<br><b>Compress a file, specifying the output filename</b>`gzip [[-c|--stdout]] [path/to/file] > [path/to/compressed_file.gz]`<br><b>Decompress a gzip archive specifying the output filename</b>`gzip [[-cd|--stdout --decompress]] [path/to/file.gz] > [path/to/uncompressed_file]`<br><b>Specify the compression level. 1 is the fastest (low compression), 9 is the slowest (high compression), 6 is the default</b>`gzip -[1..9] [[-c|--stdout]] [path/to/file] > [path/to/compressed_file.gz]`<br><b>Display the name and reduction percentage for each file compressed or decompressed</b>`gzip [[-vd|--verbose --decompress]] [path/to/file.gz]`


title: TLDR
content:
<b>Create/overwrite htpasswd file</b>`htpasswd -c [path/to/file] [username]`<br><b>Add user to htpasswd file or update existing user</b>`htpasswd [path/to/file] [username]`<br><b>Add user to htpasswd file in batch mode without an interactive password prompt (for script usage)</b>`htpasswd -b [path/to/file] [username] [password]`<br><b>Delete user from htpasswd file</b>`htpasswd -D [path/to/file] [username]`<br><b>Verify user password</b>`htpasswd -v [path/to/file] [username]`<br><b>Display a string with username (plain text) and password (md5)</b>`htpasswd -nbm [username] [password]`


title: TLDR
content:
<b>Display current user's ID (UID), group ID (GID) and groups to which they belong</b>`id`<br><b>Display the current user identity</b>`id [[-un|--user --name]]`<br><b>Display the current user identity as a number</b>`id [[-u|--user]]`<br><b>Display the current primary group identity</b>`id [[-gn|--group --name]]`<br><b>Display the current primary group identity as a number</b>`id [[-g|--group]]`<br><b>Display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong</b>`id [username]`


title: TLDR
content:
<b>Convert file to a specific encoding, and print to stdout</b>`iconv [[-f|--from-code]] [from_encoding] [[-t|--to-code]] [to_encoding] [input_file]`<br><b>Convert file to the current locale's encoding, and output to a file</b>`iconv [[-f|--from-code]] [from_encoding] [input_file] > [output_file]`<br><b>List supported encodings</b>`iconv [[-l|--list]]`


title: TLDR
content:
<b>Get the hostname of the computer</b>`hostnamectl`<br><b>Set the hostname of the computer</b>`sudo hostnamectl set-hostname "[hostname]"`<br><b>Set a pretty hostname for the computer</b>`sudo hostnamectl set-hostname --static "[hostname.example.com]" && sudo hostnamectl set-hostname --pretty "[hostname]"`<br><b>Reset hostname to its default value</b>`sudo hostnamectl set-hostname --pretty ""`


title: TLDR
content:
<b>View network settings of an interface</b>`ifconfig [interface_name]`<br><b>Display details of all interfaces, including disabled interfaces</b>`ifconfig -a`<br><b>Disable an interface</b>`ifconfig [interface_name] down`<br><b>Enable an interface</b>`ifconfig [interface_name] up`<br><b>Assign an IP address to an interface</b>`ifconfig [interface_name] [ip_address]`


title: TLDR
content:
<b>Restore an archive into an existing database</b>`pg_restore [[-d|--dbname]] [db_name] [archive_file.dump]`<br><b>Same as above, customize username</b>`pg_restore [[-U|--username]] [username] [[-d|--dbname]] [db_name] [archive_file.dump]`<br><b>Same as above, customize host and port</b>`pg_restore [[-h|--host]] [host] [[-p|--port]] [port] [[-d|--dbname]] [db_name] [archive_file.dump]`<br><b>List database objects included in the archive</b>`pg_restore [[-l|--list]] [archive_file.dump]`<br><b>Clean database objects before creating them</b>`pg_restore [[-c|--clean]] [[-d|--dbname]] [db_name] [archive_file.dump]`<br><b>Use multiple jobs to do the restoring</b>`pg_restore [[-j|--jobs]] [2] [[-d|--dbname]] [db_name] [archive_file.dump]`


title: TLDR
content:
<b>Disable interface eth0</b>`ifdown [eth0]`<br><b>Disable all interfaces which are enabled</b>`ifdown [[-a|--all]]`


title: TLDR
content:
<b>Enable interface eth0</b>`ifup [eth0]`<br><b>Enable all the interfaces defined with "auto" in /etc/network/interfaces</b>`ifup [[-a|--all]]`


title: TLDR
content:
<b>Copy files to the destination</b>`install [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`<br><b>Copy files to the destination, setting their ownership</b>`install [[-o|--owner]] [user] [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`<br><b>Copy files to the destination, setting their group ownership</b>`install [[-g|--group]] [user] [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`<br><b>Copy files to the destination, setting their mode</b>`install [[-m|--mode]] [+x] [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`<br><b>Copy files and apply access/modification times of source to the destination</b>`install [[-p|--preserve-timestamps]] [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`<br><b>Copy files and create the directories at the destination if they don't exist</b>`install -D [path/to/source_file1 path/to/source_file2 ...] [path/to/destination]`


title: TLDR
content:
<b>Print the EXIF metadata for a given file</b>`exiftool [path/to/file]`<br><b>Remove all EXIF metadata from the given files</b>`exiftool -All= [path/to/file1 path/to/file2 ...]`<br><b>Remove GPS EXIF metadata from given image files</b>`exiftool "-gps*=" [path/to/image1 path/to/image2 ...]`<br><b>Remove all EXIF metadata from the given image files, then re-add metadata for color and orientation</b>`exiftool -All= -tagsfromfile @ -colorspacetags -orientation [path/to/image1 path/to/image2 ...]`<br><b>Move the date at which all photos in a directory were taken 1 hour forward</b>`exiftool "-AllDates+=0:0:0 1:0:0" [path/to/directory]`<br><b>Move the date at which all JPEG photos in the current directory were taken 1 day and 2 hours backward</b>`exiftool "-AllDates-=0:0:1 2:0:0" [[-ext|-extension]] jpg`<br><b>Only change the DateTimeOriginal field subtracting 1.5 hours, without keeping backups</b>`exiftool -DateTimeOriginal-=1.5 -overwrite_original`<br><b>Recursively rename all JPEG photos in a directory based on the DateTimeOriginal field</b>`exiftool '-filename<DateTimeOriginal' [[-d|-dateFormat]] %Y-%m-%d_%H-%M-%S%%lc.%%e [path/to/directory] [[-r|-recurse]] [[-ext|-extension]] jpg`


title: TLDR
content:
<b>Start a REPL (interactive shell)</b>`scala`<br><b>Start the interpreter with a dependency in the classpath</b>`scala -classpath [filename.jar] [command]`<br><b>Execute a Scala script</b>`scala [script.scala]`<br><b>Execute a .jar program</b>`scala [filename.jar]`<br><b>Execute a single Scala command in the command-line</b>`scala -e [command]`


title: TLDR
content:
<b>List connected minions</b>`salt '*' test.ping`<br><b>Execute a highstate on all connected minions</b>`salt '*' state.highstate`<br><b>Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions</b>`salt '*.example.com' pkg.upgrade`<br><b>Execute an arbitrary command on a particular minion</b>`salt '[minion_id]' cmd.run "ls "`


title: TLDR
content:
<b>Scan for available networks</b>`sudo wpa_cli scan`<br><b>Show scan results</b>`sudo wpa_cli scan_results`<br><b>Add a network</b>`sudo wpa_cli [[add_n|add_network]] [number]`<br><b>Set a network's SSID</b>`sudo wpa_cli [[set_n|set_network]] [number] ssid "[SSID]"`<br><b>Enable network</b>`sudo wpa_cli [[en|enable_network]] [number]`<br><b>Save config</b>`sudo wpa_cli [[sa|save_config]]`


title: TLDR
content:
<b>Display the username, line, and time of all currently logged-in sessions</b>`who`<br><b>Display all available information</b>`who [[-a|--all]]`<br><b>Display all available information with table headers</b>`who [[-aH|--all --heading]]`


title: TLDR
content:
<b>Display the current time as reported by the hardware clock</b>`sudo hwclock`<br><b>Write the current software clock time to the hardware clock (sometimes used during system setup)</b>`sudo hwclock [[-w|--systohc]]`<br><b>Write the current hardware clock time to the software clock</b>`sudo hwclock [[-s|--hctosys]]`


title: TLDR
content:
<b>Format output for a PostScript printer, saving the output to a file</b>`groff [path/to/input.roff] > [path/to/output.ps]`<br><b>Render a man page using the ASCII output device, and display it using a pager</b>`groff -man -T ascii [path/to/manpage.1] | less --RAW-CONTROL-CHARS`<br><b>Render a man page into an HTML file</b>`groff -man -T html [path/to/manpage.1] > [path/to/manpage.html]`<br><b>Typeset a roff file containing [t]ables and [p]ictures, using the [me] macro set, to PDF, saving the output</b>`groff [-t] [-p] -[me] -T [pdf] [path/to/input.me] > [path/to/output.pdf]`<br><b>Run a groff command with preprocessor and macro options guessed by the grog utility</b>`eval "$(grog -T utf8 [path/to/input.me])"`


title: TLDR
content:
<b>Create a shared memory segment</b>`ipcmk [[-M|--shmem]] [segment_size_in_bytes]`<br><b>Create a semaphore</b>`ipcmk [[-S|--semaphore]] [element_size]`<br><b>Create a message queue</b>`ipcmk [[-Q|--queue]]`<br><b>Create a shared memory segment with specific permissions (default is 0644)</b>`ipcmk [[-M|--shmem]] [segment_size_in_bytes] [octal_permissions]`


title: TLDR
content:
<b>Run an installed application</b>`flatpak run [com.example.app]`<br><b>Install an application from a remote source</b>`flatpak install [remote_name] [com.example.app]`<br><b>List installed applications, ignoring runtimes</b>`flatpak list --app`<br><b>Update all installed applications and runtimes</b>`flatpak update`<br><b>Add a remote source</b>`flatpak remote-add --if-not-exists [remote_name] [remote_url]`<br><b>Remove an installed application</b>`flatpak remove [com.example.app]`<br><b>Remove all unused applications</b>`flatpak remove --unused`<br><b>Show information about an installed application</b>`flatpak info [com.example.app]`


title: TLDR
content:
<b>Print a summary of CPU, memory, hard drive and kernel information</b>`inxi`<br><b>Print a full description of CPU, memory, disk, network, and process information and filter sensitive information</b>`inxi [[-ez|--expanded --filter]]`<br><b>Print a summary of CPU information</b>`inxi [[-C|--cpu]]`<br><b>Print a summary of graphics information</b>`inxi [[-G|--graphics]]`<br><b>Print a summary of system RAM</b>`inxi [[-m|--memory]]`<br><b>Print a summary of system audio</b>`inxi [[-A|--audio]]`<br><b>Print available sensor data</b>`inxi [[-s|--sensors]]`<br><b>Print information about the distribution's repositories</b>`inxi [[-r|--repos]]`


title: TLDR
content:
<b>Display a report of CPU and disk statistics since system startup</b>`iostat`<br><b>Display a report of CPU and disk statistics with units converted to megabytes</b>`iostat -m`<br><b>Display CPU statistics</b>`iostat [[-c|--compact]]`<br><b>Display disk statistics with disk names (including LVM)</b>`iostat -N`<br><b>Display extended disk statistics with disk names for device "sda"</b>`iostat -xN [sda]`<br><b>Display incremental reports of CPU and disk statistics every 2 seconds</b>`iostat [2]`


title: TLDR
content:
<b>Show information about [a]ll the IPC</b>`ipcs -a`<br><b>Show information about active shared [m]emory segments, message [q]ueues or [s]empahore sets</b>`ipcs [-m|-q|-s]`<br><b>Show information on maximum allowable size in [b]ytes</b>`ipcs -b`<br><b>Show [c]reator's user name and group name for all IPC facilities</b>`ipcs -c`<br><b>Show the [p]ID of the last operators for all IPC facilities</b>`ipcs -p`<br><b>Show access [t]imes for all IPC facilities</b>`ipcs -t`<br><b>Show [o]utstanding usage for active message queues, and shared memory segments</b>`ipcs -o`


title: TLDR
content:
<b>Delete a shared memory segment by ID</b>`ipcrm [[-m|--shmem-id]] [shmem_id]`<br><b>Delete a shared memory segment by key</b>`ipcrm [[-M|--shmem-key]] [shmem_key]`<br><b>Delete an IPC queue by ID</b>`ipcrm [[-q|--queue-id]] [ipc_queue_id]`<br><b>Delete an IPC queue by key</b>`ipcrm [[-Q|--queue-key]] [ipc_queue_key]`<br><b>Delete a semaphore by ID</b>`ipcrm [[-s|--semaphore-id]] [semaphore_id]`<br><b>Delete a semaphore by key</b>`ipcrm [[-S|--semaphore-key]] [semaphore_key]`<br><b>Delete all IPC resources</b>`ipcrm [[-a|--all]]`


title: TLDR
content:
<b>Run a command with the given scheduling class and priority</b>`ionice [[-c|--class]] [scheduling_class] [[-n|--classdata]] [priority] [command]`<br><b>Set I/O scheduling class of a running process with a specific [p]id, [P]gid or [u]id</b>`ionice [[-c|--class]] [scheduling_class] -[p|P|u] [id]`<br><b>Run a command with custom I/O scheduling class and priority</b>`ionice [[-c|--class]] [scheduling_class] [[-n|--classdata]] [priority] [command]`<br><b>Ignore failure to set the requested priority</b>`ionice [[-t|--ignore]] [[-n|--classdata]] [priority] [[-p|--pid]] [pid]`<br><b>Run the command even in case it was not possible to set the desired priority (this can happen due to insufficient privileges or an old kernel version)</b>`ionice [[-t|--ignore]] [[-n|--classdata]] [priority] [[-p|--pid]] [pid]`<br><b>Print the I/O scheduling class and priority of a running process</b>`ionice [[-p|--pid]] [pid]`


title: TLDR
content:
<b>Compress a file into a new file with the .zst suffix</b>`zstd [path/to/file]`<br><b>Decompress a file</b>`zstd --decompress [path/to/file.zst]`<br><b>Decompress to stdout</b>`zstd --decompress --stdout [path/to/file.zst]`<br><b>Compress a file specifying the compression level, where 1=fastest, 19=slowest and 3=default</b>`zstd -[level] [path/to/file]`<br><b>Unlock higher compression levels (up to 22) using more memory (both for compression and decompression)</b>`zstd --ultra -[level] [path/to/file]`


title: TLDR
content:
<b>Execute a specific expression only using the jq binary (print a colored and formatted JSON output)</b>`jq '.' [path/to/file.json]`<br><b>Execute a specific script</b>`[cat path/to/file.json] | jq [[-f|--from-file]] [path/to/script.jq]`<br><b>Pass specific arguments</b>`[cat path/to/file.json] | jq [--arg "name1" "value1" --arg "name2" "value2" ...] '[. + $ARGS.named]'`<br><b>Create new JSON object via old JSON objects from multiple files</b>`[cat path/to/multiple_json_file_*.json] | jq '[{newKey1: .key1, newKey2: .key2.nestedKey, ...]}'`<br><b>Print specific array items</b>`[cat path/to/file.json] | jq '[.[index1], .[index2], ...]'`<br><b>Print all array/object values</b>`[cat path/to/file.json] | jq '.[]'`<br><b>Print objects with 2-condition filter in array</b>`[cat path/to/file.json] | jq '.[] | select((.key1=="value1") and .key2=="value2")'`<br><b>Add/remove specific keys</b>`[cat path/to/file.json] | jq '. [+|-] [{"key1": "value1", "key2": "value2", ...]}'`


title: TLDR
content:
<b>Compile a .java file</b>`javac [path/to/file.java]`<br><b>Compile several .java files</b>`javac [path/to/file1.java path/to/file2.java ...]`<br><b>Compile all .java files in current directory</b>`javac [*.java]`<br><b>Compile a .java file and place the resulting class file in a specific directory</b>`javac -d [path/to/directory] [path/to/file.java]`


title: TLDR
content:
<b>Print shared object mappings for a Java process (output like pmap)</b>`jmap [java_pid]`<br><b>Print heap summary information</b>`jmap -heap [filename.jar] [java_pid]`<br><b>Print histogram of heap usage by type</b>`jmap -histo [java_pid]`<br><b>Dump contents of the heap into a binary file for analysis with jhat</b>`jmap -dump:format=b,file=[path/to/file] [java_pid]`<br><b>Dump live objects of the heap into a binary file for analysis with jhat</b>`jmap -dump:live,format=b,file=[path/to/file] [java_pid]`


title: TLDR
content:
<b>Print Java stack traces for all threads in a Java process</b>`jstack [java_pid]`<br><b>Print mixed mode (Java/C++) stack traces for all threads in a Java process</b>`jstack -m [java_pid]`<br><b>Print stack traces from Java core dump</b>`jstack [/usr/bin/java] [file.core]`


title: TLDR
content:
<b>Add partition mappings and print created mappings</b>`kpartx -av [whole_disk.img]`<br><b>Delete partition mappings</b>`kpartx -d [whole_disk.img]`<br><b>List partition mappings</b>`kpartx -l [whole_disk.img]`


title: TLDR
content:
<b>Scan for available wireless networks</b>`iw dev [wlp] scan`<br><b>Join an open wireless network</b>`iw dev [wlp] connect [SSID]`<br><b>Close the current connection</b>`iw dev [wlp] disconnect`<br><b>Show information about the current connection</b>`iw dev [wlp] link`<br><b>List all physical and logical wireless network interfaces</b>`iw dev`<br><b>List all wireless capabilities for all physical hardware interfaces</b>`iw phy`<br><b>List the kernel's current wireless regulatory domain information</b>`iw reg get`<br><b>Display help</b>`iw help`


title: TLDR
content:
<b>List files one per line</b>`exa [[-1|--oneline]]`<br><b>List all files, including hidden files</b>`exa [[-a|--all]]`<br><b>Long format list (permissions, ownership, size and modification date) of all files</b>`exa [[-l|--long]] [[-a|--all]]`<br><b>List files with the largest at the top</b>`exa [[-r|--reverse]] [[-s|--sort]] [size]`<br><b>Display a tree of files, three levels deep</b>`exa [[-l|--long]] [[-T|--tree]] [[-L|--level]] [3]`<br><b>List files sorted by modification date (oldest first)</b>`exa [[-l|--long]] [[-s|--sort]] [modified]`<br><b>List files with their headers, icons, and Git statuses</b>`exa [[-l|--long]] [[-h|--header]] --icons --git`<br><b>Don't list files mentioned in .gitignore</b>`exa --git-ignore`


title: TLDR
content:
<b>View last login infromation (e.g., username, terminal, boot time, kernel) of all users as read from /var/log/wtmp</b>`last`<br><b>List login information of a specific user</b>`last [username]`<br><b>Specify how many of the last logins to show</b>`last [[-n|--limit]] [login_count]`<br><b>Print the full date and time for entries and then display the hostname column last to prevent truncation</b>`last [[-F|--fulltimes]] [[-a|--hostlast]]`<br><b>View all logins by a specific user and show the IP address instead of the hostname</b>`last [username] [[-i|--ip]]`<br><b>List information since a specific time and date</b>`last [[-s|--since]] [-7days]`<br><b>View all recorded reboots (i.e., the last logins of the pseudo user "reboot")</b>`last reboot`<br><b>Display help</b>`last [[-h|--help]]`


title: TLDR
content:
<b>Show all messages with priority level 3 (errors) from this boot</b>`journalctl [[-b|--boot]] [[-p|--priority]] 3`<br><b>Delete journal logs which are older than 2 days</b>`journalctl --vacuum-time 2d`<br><b>Show only the last n lines and follow new messages (like tail -f for traditional syslog)</b>`journalctl [[-n|--lines]] [n] [[-f|--follow]]`<br><b>Show all messages by a specific unit</b>`journalctl [[-u|--unit]] [unit]`<br><b>Show logs for a given unit since the last time it started</b>`journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show --value --property=InvocationID [unit])`<br><b>Filter messages within a time range (either timestamp or placeholders like "yesterday")</b>`journalctl [[-S|--since]] [now|today|yesterday|tomorrow] [[-U|--until]] "[YYYY-MM-DD HH:MM:SS]"`<br><b>Show all messages by a specific process</b>`journalctl _PID=[pid]`<br><b>Show all messages by a specific executable</b>`journalctl [path/to/executable]`


title: TLDR
content:
<b>Query an LDAP server for all items that are a member of the given group and return the object's displayName value</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] [[-b|--baseDN]] [base_ou] '[memberOf=group1]' displayName`<br><b>Query an LDAP server with a no-newline password file for all items that are a member of the given group and return the object's displayName value</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-u|--keyStorePasswordFile]] '[password_file]' [[-h|--hostname]] [ldap_host] [[-b|--baseDN]] [base_ou] '[memberOf=group1]' displayName`<br><b>Return 5 items that match the given filter</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] [[-b|--baseDN]] [base_ou] '[memberOf=group1]' [[-z|--sizeLimit]] 5 displayName`<br><b>Wait up to 7 seconds for a response</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] [[-b|--baseDN]] [base_ou] '[memberOf=group1]' [[-l|--timeLimitSeconds]] 7 displayName`<br><b>Invert the filter</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] [[-b|--baseDN]] [base_ou] '(!(memberOf=[group1]))' displayName`<br><b>Return all items that are part of multiple groups, returning the display name for each item</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] '(&([memberOf=group1])([memberOf=group2])([memberOf=group3]))' "displayName"`<br><b>Return all items that are members of at least 1 of the specified groups</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] '(|([memberOf=group1])([memberOf=group1])([memberOf=group3]))' displayName`<br><b>Combine multiple boolean logic filters</b>`ldapsearch [[-D|--bindDN]] '[admin_DN]' [[-w|--bindPassword]] '[password]' [[-h|--hostname]] [ldap_host] '(&([memberOf=group1])([memberOf=group2])(!([memberOf=group3])))' displayName`


title: TLDR
content:
<b>Display the most recent login of all users</b>`lastlog`<br><b>Display the lastlog record of the specified user</b>`lastlog --user [username]`<br><b>Display records older than 7 days</b>`lastlog --before 7`<br><b>Display records more recent than 3 days</b>`lastlog --time 3`


title: TLDR
content:
<b>Terminate a process using the default SIGTERM (terminate) signal</b>`killall [process_name]`<br><b>List available signal names (to be used without the SIG prefix)</b>`killall [[-l|--list]]`<br><b>Interactively ask for confirmation before termination</b>`killall [[-i|--interactive]] [process_name]`<br><b>Terminate a process using the SIGINT (interrupt) signal, which is the same signal sent by pressing <Ctrl c></b>`killall -INT [process_name]`<br><b>Force kill a process</b>`killall -KILL [process_name]`


title: TLDR
content:
<b>Display help</b>`openssl help`<br><b>Display help for a specific subcommand</b>`openssl help [x509]`<br><b>Display version</b>`openssl version`


title: TLDR
content:
<b>Run a command using the input data as arguments</b>`[arguments_source] | xargs [command]`<br><b>Run multiple chained commands on the input data</b>`[arguments_source] | xargs sh -c "[command1] && [command2] | [command3]"`<br><b>Gzip all files with .log extension taking advantage of multiple threads (-print0 uses a null character to split file names, and -0 uses it as delimiter)</b>`find . -name '*.log' -print0 | xargs [[-0|--null]] [[-P|--max-procs]] [4] [[-n|--max-args]] 1 gzip`<br><b>Execute the command once per argument</b>`[arguments_source] | xargs [[-n|--max-args]] 1 [command]`<br><b>Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as _) with the input line</b>`[arguments_source] | xargs -I _ [command] _ [optional_extra_arguments]`<br><b>Parallel runs of up to max-procs processes at a time; the default is 1. If max-procs is 0, xargs will run as many processes as possible at a time</b>`[arguments_source] | xargs [[-P|--max-procs]] [max-procs] [command]`<br><b>Prompt user for confirmation before executing command (confirm with y or Y)</b>`[arguments_source] | xargs [[-p|--interactive]] [command]`


title: TLDR
content:
<b>Join two files on the first (default) field</b>`join [path/to/file1] [path/to/file2]`<br><b>Join two files using a comma (instead of a space) as the field separator</b>`join -t ',' [path/to/file1] [path/to/file2]`<br><b>Join field3 of file1 with field1 of file2</b>`join -1 [3] -2 [1] [path/to/file1] [path/to/file2]`<br><b>Produce a line for each unpairable line for file1</b>`join -a [1] [path/to/file1] [path/to/file2]`<br><b>Join a file from stdin</b>`cat [path/to/file1] | join - [path/to/file2]`


title: TLDR
content:
<b>Run a specific command using the same namespaces as an existing process</b>`nsenter [[-t|--target]] [pid] [[-a|--all]] [command] [command_arguments]`<br><b>Run a specific command in an existing process's mount|UTS|IPC|network|PID|user|cgroup|time namespace</b>`nsenter [[-t|--target]] [pid] --[mount|uts|ipc|net|pid|user|cgroup] [command] [command_arguments]`<br><b>Run a specific command in an existing process's UTS, time, and IPC namespaces</b>`nsenter [[-t|--target]] [pid] [[-u|--uts]] [[-T|--time]] [[-i|--ipc]] -- [command] [command_arguments]`<br><b>Run a specific command in an existing process's namespace by referencing procfs</b>`nsenter [[-p|--pid=]]/proc/[pid]/pid/net -- [command] [command_arguments]`


title: TLDR
content:
<b>Create a symbolic link to a file or directory</b>`ln [[-s|--symbolic]] /[path/to/file_or_directory] [path/to/symlink]`<br><b>Overwrite an existing symbolic link to point to a different file</b>`ln [[-sf|--symbolic --force]] /[path/to/new_file] [path/to/symlink]`<br><b>Create a hard link to a file</b>`ln /[path/to/file] [path/to/hardlink]`


title: TLDR
content:
<b>Update symlinks and rebuild the cache (usually run when a new library is installed)</b>`sudo ldconfig`<br><b>Update the symlinks for a given directory</b>`sudo ldconfig -n [path/to/directory]`<br><b>Print the libraries in the cache and check whether a given library is present</b>`ldconfig [[-p|--print-cache]] | grep [library_name]`


title: TLDR
content:
<b>Look for pattern in the database. Note: The database is recomputed periodically (usually weekly or daily)</b>`locate "[pattern]"`<br><b>Look for a pattern case-insensitively</b>`locate [[-i|--ignore-case]] "[pattern]"`<br><b>Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as *pattern*)</b>`locate "*/[filename]"`<br><b>Recompute the database. You need to do it if you want to find recently added files</b>`sudo updatedb`


title: TLDR
content:
<b>[c]reate an archive and write it to a [f]ile</b>`tar cf [path/to/target.tar] [path/to/file1 path/to/file2 ...]`<br><b>[c]reate a g[z]ipped archive and write it to a [f]ile</b>`tar czf [path/to/target.tar.gz] [path/to/file1 path/to/file2 ...]`<br><b>[c]reate a g[z]ipped (compressed) archive from a directory using relative paths</b>`tar czf [path/to/target.tar.gz] [[-C|--directory]] [path/to/directory] .`<br><b>E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely</b>`tar xvf [path/to/source.tar[.gz|.bz2|.xz]]`<br><b>E[x]tract a (compressed) archive [f]ile into the target directory</b>`tar xf [path/to/source.tar[.gz|.bz2|.xz]] [[-C|--directory]] [path/to/directory]`<br><b>[c]reate a compressed archive and write it to a [f]ile, using the file extension to [a]utomatically determine the compression program</b>`tar caf [path/to/target.tar.xz] [path/to/file1 path/to/file2 ...]`<br><b>Lis[t] the contents of a tar [f]ile [v]erbosely</b>`tar tvf [path/to/source.tar]`<br><b>E[x]tract files matching a pattern from an archive [f]ile</b>`tar xf [path/to/source.tar] --wildcards "[*.html]"`


title: TLDR
content:
<b>Add files/directories to a specific archive</b>`zip [[-r|--recurse-paths]] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Remove files/directories from a specific archive</b>`zip [[-d|--delete]] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Archive files/directories excluding specified ones</b>`zip [[-r|--recurse-paths]] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...] [[-x|--exclude]] [path/to/excluded_files_or_directories]`<br><b>Archive files/directories with a specific compression level (0 - the lowest, 9 - the highest)</b>`zip [[-r|--recurse-paths]] -[0..9] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Create an encrypted archive with a specific password</b>`zip [[-re|--recurse-paths --encrypt]] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Archive files/directories to a multi-part split Zip archive (e.g. 3 GB parts)</b>`zip [[-rs|--recurse-paths --split-size]] [3g] [path/to/compressed.zip] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Print a specific archive contents</b>`zip [[-sf|--split-size --freshen]] [path/to/compressed.zip]`


title: TLDR
content:
<b>List files one per line</b>`ls -1`<br><b>List all files, including hidden files</b>`ls [[-a|--all]]`<br><b>List files with a trailing symbol to indicate file type (directory/, symbolic_link@, executable*, ...)</b>`ls [[-F|--classify]]`<br><b>List all files in [l]ong format (permissions, ownership, size, and modification date)</b>`ls [[-la|-l --all]]`<br><b>List files in [l]ong format with size displayed using human-readable units (KiB, MiB, GiB)</b>`ls [[-lh|-l --human-readable]]`<br><b>List files in [l]ong format, sorted by [S]ize (descending) recursively</b>`ls [[-lSR|-lS --recursive]]`<br><b>List files in [l]ong format, sorted by [t]ime the file was modified and in reverse order (oldest first)</b>`ls [[-ltr|-lt --reverse]]`<br><b>Only list directories</b>`ls [[-d|--directory]] */`


title: TLDR
content:
<b>List loop devices with detailed info</b>`losetup [[-a|--all]]`<br><b>Attach a file to a given loop device</b>`sudo losetup [/dev/loop] /[path/to/file]`<br><b>Attach a file to a new free loop device and scan the device for partitions</b>`sudo losetup --show [[-P|--partscan]] [[-f|--find]] /[path/to/file]`<br><b>Attach a file to a read-only loop device</b>`sudo losetup [[-r|--read-only]] [/dev/loop] /[path/to/file]`<br><b>Detach all loop devices</b>`sudo losetup [[-D|--detach-all]]`<br><b>Detach a given loop device</b>`sudo losetup [[-d|--detach]] [/dev/loop]`


title: TLDR
content:
<b>Print (trace) library calls of a program binary</b>`ltrace ./[program]`<br><b>Count library calls. Print a handy summary at the bottom</b>`ltrace -c [path/to/program]`<br><b>Trace calls to malloc and free, omit those done by libc</b>`ltrace -e malloc+free-@libc.so* [path/to/program]`<br><b>Write to file instead of terminal</b>`ltrace [[-o|--output]] [file] [path/to/program]`


title: TLDR
content:
<b>List all storage devices in a tree-like format</b>`lsblk`<br><b>Also list empty devices</b>`lsblk [[-a|--all]]`<br><b>Print the SIZE column in bytes rather than in a human-readable format</b>`lsblk [[-b|--bytes]]`<br><b>Output info about filesystems</b>`lsblk [[-f|--fs]]`<br><b>Use ASCII characters for tree formatting</b>`lsblk [[-i|--ascii]]`<br><b>Output info about block-device topology</b>`lsblk [[-t|--topology]]`<br><b>Exclude the devices specified by the comma-separated list of major device numbers</b>`lsblk [[-e|--exclude]] [1,7,...]`<br><b>Display a customized summary using a comma-separated list of columns</b>`lsblk [[-o|--output]] [NAME,ROTA,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...]`


title: TLDR
content:
<b>Compress a file with LZMA - slow compression, fast decompression</b>`lrzip [path/to/file]`<br><b>Compress a file with BZIP2 - good middle ground for compression/speed</b>`lrzip -b [path/to/file]`<br><b>Compress with ZPAQ - extreme compression, but very slow</b>`lrzip -z [path/to/file]`<br><b>Compress with LZO - light compression, extremely fast decompression</b>`lrzip -l [path/to/file]`<br><b>Compress a file and password protect/encrypt it</b>`lrzip -e [path/to/file]`<br><b>Override the number of processor threads to use</b>`lrzip -p [8] [path/to/file]`


title: TLDR
content:
<b>List all local system locks</b>`lslocks`<br><b>List locks with defined column headers</b>`lslocks [[-o|--output]] [PID],[COMMAND],[PATH]`<br><b>List locks producing a raw output (no columns), and without column headers</b>`lslocks [[-r|--raw]] [[-n|--noheadings]]`<br><b>List locks by PID input</b>`lslocks [[-p|--pid]] [PID]`<br><b>List locks with JSON output to stdout</b>`lslocks [[-J|--json]]`


title: TLDR
content:
<b>Show a brief list of devices</b>`lspci`<br><b>Display [v]erbose information (Note: the -v flag can be repeated to increase verbosity)</b>`lspci -v`<br><b>Display [k]ernel drivers and modules handling each device</b>`lspci -k`<br><b>[s]elect a specific device</b>`lspci -s [00:18.3]`<br><b>Dump info in a ([m]achine) readable form</b>`lspci -vm`<br><b>Show PCI vendor and device codes as both [n]umbers and [n]ames</b>`lspci -nn`


title: TLDR
content:
<b>Launch the X11 GUI (if available)</b>`sudo lshw -X`<br><b>List all hardware in tabular format</b>`sudo lshw -short`<br><b>List multiple class of hardware (all disks and storage controllers) in tabular format</b>`sudo lshw [[-c|-class]] disk [[-c|-class]] storage -short`<br><b>Save all network interfaces to an HTML/XML/JSON file</b>`sudo lshw [[-c|-class]] network -[html|xml|json] > interfaces[.html|.xml|.json]`<br><b>List network interfaces without revealing sensitive information (IP addresses, serial numbers, etc.)</b>`sudo lshw [[-c|-class]] network -sanitize`<br><b>List a particular class of hardware</b>`sudo lshw [[-c|-class]] [system|bridge|memory|processor|address|storage|disk|tape|bus|network|display|input|printer|multimedia|communication|power|volume|generic]`


title: TLDR
content:
<b>List all the USB devices available</b>`lsusb`<br><b>List the USB hierarchy as a tree</b>`lsusb [[-t|--tree]]`<br><b>List verbose information about USB devices</b>`sudo lsusb [[-v|--verbose]]`<br><b>List detailed information about a USB device</b>`sudo lsusb [[-v|--verbose]] -s [bus]:[device number]`<br><b>List devices with a specified vendor and product ID only</b>`lsusb -d [vendor]:[product]`


title: TLDR
content:
<b>Create a logical volume of 10 gigabytes in the volume group vg1</b>`sudo lvcreate [[-L|--size]] 10G vg1`<br><b>Create a 1500 megabyte linear logical volume named mylv in the volume group vg1</b>`sudo lvcreate [[-L|--size]] 1500 [[-n|--name]] mylv vg1`<br><b>Create a logical volume called mylv that uses 60% of the total space in volume group vg1</b>`sudo lvcreate [[-l|--extents]] 60%VG [[-n|--name]] mylv vg1`<br><b>Create a logical volume called mylv that uses all the unallocated space in the volume group vg1</b>`sudo lvcreate [[-l|--extents]] 100%FREE [[-n|--name]] mylv vg1`


title: TLDR
content:
<b>Display the attributes of the files in the current directory</b>`lsattr`<br><b>List the attributes of files in a particular path</b>`lsattr [path]`<br><b>List file attributes recursively in the current and subsequent directories</b>`lsattr -R`<br><b>Show attributes of all the files in the current directory, including hidden ones</b>`lsattr -a`<br><b>Display attributes of directories in the current directory</b>`lsattr -d`


title: TLDR
content:
<b>Retrieve the X-Windows window ID of the running Firefox window(s)</b>`xdotool search --onlyvisible --name [firefox]`<br><b>Perform a mouse <RightClick></b>`xdotool click [3]`<br><b>Get the ID of the currently active window</b>`xdotool getactivewindow`<br><b>Focus on the window with ID of 12345</b>`xdotool windowfocus --sync [12345]`<br><b>Type a message, with a 500ms delay for each letter</b>`xdotool type --delay [500] "Hello world"`<br><b>Press the <Enter> key</b>`xdotool key [KP_Enter]`


title: TLDR
content:
<b>Open an interactive prompt to check personal mail</b>`mail`<br><b>Send a typed email message with optional CC. The command-line below continues after pressing <Enter>. Input message text (can be multiline). Press <Ctrl d> to complete the message text</b>`mail --subject "[subject line]" [to_user@example.com] --cc "[cc_email_address]"`<br><b>Send an email that contains file content</b>`mail < [path/to/file.txt] --subject "[$HOSTNAME filename.txt]" [to_user@example.com]`<br><b>Send a tar.gz file as an attachment</b>`tar cvzf - [path/to/directory1 path/to/directory2] | uuencode [data.tar.gz] | mail --subject "[subject_line]" [to_user@example.com]`<br><b>Display help</b>`mail [[-h|--help]]`


title: TLDR
content:
<b>Process macros in a file</b>`m4 [path/to/file]`<br><b>Define a macro before processing files</b>`m4 [[-D|--define]] [macro_name]=[macro_value] [path/to/file]`


title: TLDR
content:
<b>Purge and process manual pages</b>`mandb`<br><b>Update a single entry</b>`mandb --filename [path/to/file]`<br><b>Create entries from scratch instead of updating</b>`mandb --create`<br><b>Only process user databases</b>`mandb --user-db`<br><b>Do not purge obsolete entries</b>`mandb --no-purge`<br><b>Check the validity of manual pages</b>`mandb --test`


title: TLDR
content:
<b>View documentation for MinIO client</b>`tldr mc.cli`<br><b>View documentation for Midnight Commander</b>`tldr mc.fm`


title: TLDR
content:
<b>Create a fat filesystem inside partition Y on device X</b>`sudo mkfs.fat [/dev/sdXY]`<br><b>Create filesystem with a volume-name</b>`sudo mkfs.fat -n [volume_name] [/dev/sdXY]`<br><b>Create filesystem with a volume-id</b>`sudo mkfs.fat -i [volume_id] [/dev/sdXY]`<br><b>Use 4 instead of 2 file allocation tables</b>`sudo mkfs.fat -f 4 [/dev/sdXY]`<br><b>Specify filesystem type</b>`sudo mkfs.fat -F [12|16|32] [/dev/sdXY]`


title: TLDR
content:
<b>Calculate the MD5 checksum for one or more files</b>`md5sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of MD5 checksums to a file</b>`md5sum [path/to/file1 path/to/file2 ...] > [path/to/file.md5]`<br><b>Calculate an MD5 checksum from stdin</b>`[command] | md5sum`<br><b>Read a file of MD5 checksums and filenames and verify all files have matching checksums</b>`md5sum [[-c|--check]] [path/to/file.md5]`<br><b>Only show a message for missing files or when verification fails</b>`md5sum [[-c|--check]] --quiet [path/to/file.md5]`<br><b>Only show a message when verification fails, ignoring missing files</b>`md5sum --ignore-missing [[-c|--check]] --quiet [path/to/file.md5]`<br><b>Check a known MD5 checksum of a file</b>`echo [known_md5_checksum_of_the_file] [path/to/file] | md5sum [[-c|--check]]`


title: TLDR
content:
<b>Create a ROM filesystem out of a directory inside partition Y on device X</b>`sudo mkfs.cramfs [path/to/directory] [/dev/sdXY]`<br><b>Create a ROM filesystem with a volume-name</b>`sudo mkfs.cramfs -n [volume_name] [path/to/directory] [/dev/sdXY]`


title: TLDR
content:
<b>Create an exfat filesystem inside partition Y on device X</b>`sudo mkfs.exfat [/dev/sdXY]`<br><b>Create filesystem with a volume-name</b>`sudo mkfs.exfat [[-L|--volume-label]] [volume_name] [/dev/sdXY]`<br><b>Create filesystem with a volume-id</b>`sudo mkfs.exfat [[-U|--volume-guid]] [volume_id] [/dev/sdXY]`


title: TLDR
content:
<b>Print the MIME type of a given file</b>`mimetype [path/to/file]`<br><b>Display only the MIME type, and not the filename</b>`mimetype --brief [path/to/file]`<br><b>Display a description of the MIME type</b>`mimetype --describe [path/to/file]`<br><b>Determine the MIME type of stdin (does not check a filename)</b>`[command] | mimetype --stdin`<br><b>Display debug information about how the MIME type was determined</b>`mimetype --debug [path/to/file]`<br><b>Display all the possible MIME types of a given file in confidence order</b>`mimetype --all [path/to/file]`<br><b>Explicitly specify the 2-letter language code of the output</b>`mimetype --language [path/to/file]`


title: TLDR
content:
<b>Create a NTFS filesystem inside partition Y on device X</b>`sudo mkfs.ntfs [/dev/sdXY]`<br><b>Create filesystem with a volume-label</b>`sudo mkfs.ntfs [[-L|--label]] [volume_label] [/dev/sdXY]`<br><b>Create filesystem with specific UUID</b>`sudo mkfs.ntfs [[-U|--with-uuid]] [UUID] [/dev/sdXY]`


title: TLDR
content:
<b>Create specific directories</b>`mkdir [path/to/directory1 path/to/directory2 ...]`<br><b>Create specific directories and their parents if needed</b>`mkdir [[-p|--parents]] [path/to/directory1 path/to/directory2 ...]`<br><b>Create directories with specific permissions</b>`mkdir [[-m|--mode]] [rwxrw-r--] [path/to/directory1 path/to/directory2 ...]`<br><b>Create multiple nested directories recursively</b>`mkdir [[-p|--parents]] [path/to/{a,b}/{x,y,z}/{h,i,j]}`


title: TLDR
content:
<b>Check terminal's openness to write messages</b>`mesg`<br><b>Disallow receiving messages from the write command</b>`mesg n`<br><b>Allow receiving messages from the write command</b>`mesg y`


title: TLDR
content:
<b>Create array</b>`sudo mdadm --create [/dev/md/MyRAID] --level [raid_level] --raid-devices [number_of_disks] [/dev/sdXN]`<br><b>Stop array</b>`sudo mdadm --stop [/dev/md0]`<br><b>Mark disk as failed</b>`sudo mdadm --fail [/dev/md0] [/dev/sdXN]`<br><b>Remove disk</b>`sudo mdadm --remove [/dev/md0] [/dev/sdXN]`<br><b>Add disk to array</b>`sudo mdadm --assemble [/dev/md0] [/dev/sdXN]`<br><b>Show RAID info</b>`sudo mdadm --detail [/dev/md0]`<br><b>Reset disk by deleting RAID metadata</b>`sudo mdadm --zero-superblock [/dev/sdXN]`


title: TLDR
content:
<b>Create an ext2 filesystem in partition 1 of device b (sdb1)</b>`mke2fs -t ext2 [/dev/sdb1]`<br><b>Create an ext3 filesystem in partition 1 of device b (sdb1)</b>`mke2fs -t ext3 [/dev/sdb1]`<br><b>Create an ext4 filesystem in partition 1 of device b (sdb1)</b>`mke2fs -t ext4 [/dev/sdb1]`


title: TLDR
content:
<b>Create a block device</b>`sudo mknod [path/to/device_file] b [major_device_number] [minor_device_number]`<br><b>Create a character device</b>`sudo mknod [path/to/device_file] c [major_device_number] [minor_device_number]`<br><b>Create a FIFO (queue) device</b>`sudo mknod [path/to/device_file] p`<br><b>Create a device file with default SELinux security context</b>`sudo mknod [[-Z |--context=]][path/to/device_file] [type] [major_device_number] [minor_device_number]`


title: TLDR
content:
<b>Run the command and print the time measurements to stdout</b>`time [command]`<br><b>Create a very simple stopwatch (only works in Bash)</b>`time read`


title: TLDR
content:
<b>Set up a given swap area</b>`sudo mkswap [path/to/file]`<br><b>Check a partition for bad blocks before creating the swap area</b>`sudo mkswap [[-c|--check]] [path/to/file]`<br><b>Specify a label for the partition (to allow swapon to use the label)</b>`sudo mkswap [[-L|--label]] [label] [/dev/sdXY]`<br><b>Use the specified UUID</b>`sudo mkswap [[-U|--uuid]] [clear|random|time|UUID_value]`<br><b>Set up a swap file (for btrfs, see tldr btrfs filesystem instead)</b>`sudo mkswap [[-s|--size]] [file_size] [[-F|--file]] [path/to/swapfile]`


title: TLDR
content:
<b>Create an empty temporary file and print its absolute path</b>`mktemp`<br><b>Use a custom directory if $TMPDIR is not set (the default is platform-dependent, but usually /tmp)</b>`mktemp -p /[path/to/temporary_directory]`<br><b>Use a custom path template (Xs are replaced with random alphanumeric characters)</b>`mktemp [/tmp/example.XXXXXXXX]`<br><b>Use a custom file name template</b>`mktemp -t [example.XXXXXXXX]`<br><b>Create an empty temporary directory and print its absolute path</b>`mktemp -d`


title: TLDR
content:
<b>Terminate a program using the default SIGTERM (terminate) signal</b>`kill [process_id]`<br><b>List available signal names (to be used without the SIG prefix)</b>`kill -l`<br><b>Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating</b>`kill -[1|HUP] [process_id]`<br><b>Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing <Ctrl c></b>`kill -[2|INT] [process_id]`<br><b>Signal the operating system to immediately terminate a program (which gets no chance to capture the signal)</b>`kill -[9|KILL] [process_id]`<br><b>Signal the operating system to pause a program until a SIGCONT ("continue") signal is received</b>`kill -[17|STOP] [process_id]`<br><b>Send a SIGUSR1 signal to all processes with the given GID (group id)</b>`kill -[SIGUSR1] -[group_id]`


title: TLDR
content:
<b>Join a protected wireless network</b>`wpa_supplicant -i [interface] -c [path/to/wpa_supplicant_conf.conf]`<br><b>Join a protected wireless network and run it in a daemon</b>`wpa_supplicant -B -i [interface] -c [path/to/wpa_supplicant_conf.conf]`


title: TLDR
content:
<b>Check if a directory is a mountpoint</b>`mountpoint [path/to/directory]`<br><b>Check if a directory is a mountpoint without showing any output</b>`mountpoint [[-q|--quiet]] [path/to/directory]`<br><b>Show major/minor numbers of a mountpoint's filesystem</b>`mountpoint [[-d|--fs-devno]] [path/to/directory]`


title: TLDR
content:
<b>Traceroute to a host and continuously ping all intermediary hops</b>`mtr [example.com]`<br><b>Disable IP address and host name mapping</b>`mtr [[-n|--no-dns]] [example.com]`<br><b>Generate output after pinging each hop 10 times</b>`mtr [[-w|--report-wide]] [example.com]`<br><b>Force IP IPv4 or IPV6</b>`mtr -4 [example.com]`<br><b>Wait for a given time (in seconds) before sending another packet to the same hop</b>`mtr [[-i|--interval]] [10] [example.com]`<br><b>Display the Autonomous System Number (ASN) for each hop</b>`mtr [[-z|--aslookup]] [example.com]`<br><b>Display both IP address and reverse DNS name</b>`mtr [[-b|--show-ips]] [example.com]`


title: TLDR
content:
<b>Open a file</b>`more [path/to/file]`<br><b>Display a specific line</b>`more +[line_number] [path/to/file]`<br><b>Go to the next page</b>`<Space>`<br><b>Search for a string (press <n> to go to the next match)</b>`</>[something]<Enter>`<br><b>Exit</b>`<q>`<br><b>Display help about interactive commands</b>`<h>`


title: TLDR
content:
<b>Display CPU statistics every 2 seconds</b>`mpstat [2]`<br><b>Display 5 reports, one by one, at 2 second intervals</b>`mpstat [2] [5]`<br><b>Display 5 reports, one by one, from a given processor, at 2 second intervals</b>`mpstat -P [0] [2] [5]`


title: TLDR
content:
<b>Assemble source.asm into a binary file source, in the (default) raw binary format</b>`nasm [source.asm]`<br><b>Assemble source.asm into a binary file output_file, in the specified format</b>`nasm -f [format] [source.asm] -o [output_file]`<br><b>List valid output formats (along with basic nasm help)</b>`nasm -hf`<br><b>Assemble and generate an assembly listing file</b>`nasm -l [list_file] [source.asm]`<br><b>Add a directory (must be written with trailing slash) to the include file search path before assembling</b>`nasm -i [path/to/include_directory]/ [source.asm]`


title: TLDR
content:
<b>Start a [l]istener on the specified TCP [p]ort and send a file into it</b>`nc < [filename] -l -p [port]`<br><b>Connect to a target listener on the specified port and receive a file from it</b>`nc [host] [port] > [received_filename]`<br><b>Scan the open TCP ports of a specified host</b>`nc -v -z -w [timeout_in_seconds] [host] [start_port]-[end_port]`<br><b>Start a [l]istener on the specified TCP [p]ort and provide your local shell access to the connected party (this is dangerous and can be abused)</b>`nc -l -p [port] -e [shell_executable]`<br><b>Connect to a target listener and provide your local shell access to the remote party (this is dangerous and can be abused)</b>`nc [host] [port] -e [shell_executable]`<br><b>Act as a proxy and forward data from a local TCP port to the given remote host</b>`nc -l -p [local_port] | nc [host] [remote_port]`<br><b>Send an HTTP GET request</b>`echo -e "GET / HTTP/1.1\nHost: [host]\n\n" | nc [host] 80`


title: TLDR
content:
<b>Connect to a database</b>`mysql [database_name]`<br><b>Connect to a database, user will be prompted for a password</b>`mysql [[-u|--user]] [user] [[-p|--password]] [database_name]`<br><b>Connect to a database on another host</b>`mysql [[-h|--host]] [database_host] [database_name]`<br><b>Connect to a database through a Unix socket</b>`mysql [[-S|--socket]] [path/to/socket.sock]`<br><b>Execute SQL statements in a script file (batch file)</b>`mysql [[-e|--execute]] "source [filename.sql]" [database_name]`<br><b>Restore a database from a backup created with mysqldump (user will be prompted for a password)</b>`mysql < [path/to/backup.sql] [[-u|--user]] [user] [[-p|--password]] [database_name]`<br><b>Restore all databases from a backup (user will be prompted for a password)</b>`mysql < [path/to/backup.sql] [[-u|--user]] [user] [[-p|--password]]`


title: TLDR
content:
<b>Create a backup (user will be prompted for a password)</b>`mysqldump --user [user] --password [database_name] --result-file=[path/to/file.sql]`<br><b>Backup a specific table redirecting the output to a file (user will be prompted for a password)</b>`mysqldump --user [user] --password [database_name] [table_name] > [path/to/file.sql]`<br><b>Backup all databases redirecting the output to a file (user will be prompted for a password)</b>`mysqldump --user [user] --password --all-databases > [path/to/file.sql]`<br><b>Backup all databases from a remote host, redirecting the output to a file (user will be prompted for a password)</b>`mysqldump --host=[ip_or_hostname] --user [user] --password --all-databases > [path/to/file.sql]`


title: TLDR
content:
<b>Resolve the pathnames specified as the argument parameters</b>`namei [path/to/a] [path/to/b] [path/to/c]`<br><b>Display the results in a long-listing format</b>`namei [[-l|--long]] [path/to/a] [path/to/b] [path/to/c]`<br><b>Show the mode bits of each file type in the style of ls</b>`namei [[-m|--modes]] [path/to/a] [path/to/b] [path/to/c]`<br><b>Show owner and group name of each file</b>`namei [[-o|--owners]] [path/to/a] [path/to/b] [path/to/c]`<br><b>Don't follow symlinks while resolving</b>`namei [[-n|--nosymlinks]] [path/to/a] [path/to/b] [path/to/c]`


title: TLDR
content:
<b>Open specific files, moving to the next file after closing the previous one</b>`nano [path/to/file1 path/to/file2 ...]`<br><b>Start the editor without using configuration files</b>`nano [[-I|--ignorercfiles]]`<br><b>Open a file and position the cursor at a specific line and column</b>`nano +[line],[column] [path/to/file]`<br><b>Open a file and enable soft wrapping</b>`nano [[-S|--softwrap]] [path/to/file]`<br><b>Open a file and indent new lines to the previous line's indentation</b>`nano [[-i|--autoindent]] [path/to/file]`<br><b>Open a file and create a backup file (path/to/file~) on save</b>`nano [[-B|--backup]] [path/to/file]`<br><b>Open a file in restricted mode (i.e. don't read/write to files not specified on the command-line)</b>`nano [[-R|--restricted]] [path/to/file]`<br><b>Exit nano</b>`<Ctrl x>`


title: TLDR
content:
<b>Capture traffic of all interfaces</b>`ngrep -d any`<br><b>Capture traffic of a specific interface</b>`ngrep -d [eth0]`<br><b>Capture traffic crossing port 22 of interface eth0</b>`ngrep -d [eth0] port [22]`<br><b>Capture traffic from or to a host</b>`ngrep host [www.example.com]`<br><b>Filter keyword 'User-Agent:' of interface eth0</b>`ngrep -d [eth0] '[User-Agent:]'`


title: TLDR
content:
<b>Open a new GNOME terminal window</b>`gnome-terminal`<br><b>Run a specific command in a new terminal window</b>`gnome-terminal -- [command]`<br><b>Open a new tab in the last opened window instead</b>`gnome-terminal --tab`<br><b>Set the title of the new tab</b>`gnome-terminal --tab [[-t|--title]] "[title]"`


title: TLDR
content:
<b>Set a user's login shell to nologin to prevent the user from logging in</b>`chsh [[-s|--shell]] [user] nologin`<br><b>Customize message for users with the login shell of nologin</b>`echo "[declined_login_message]" > /etc/nologin.txt`


title: TLDR
content:
<b>Perform a basic Nikto scan against a target host</b>`perl nikto.pl [[-h|-host]] [192.168.0.1]`<br><b>Specify the port number when performing a basic scan</b>`perl nikto.pl [[-h|-host]] [192.168.0.1] [[-p|-port]] [443]`<br><b>Scan ports and protocols with full URL syntax</b>`perl nikto.pl [[-h|-host]] [https://192.168.0.1:443/]`<br><b>Scan multiple ports in the same scanning session</b>`perl nikto.pl [[-h|-host]] [192.168.0.1] [[-p|-port]] [80,88,443]`<br><b>Update to the latest plugins and databases</b>`perl nikto.pl [[-u|-update]]`


title: TLDR
content:
<b>List all ports</b>`netstat [[-a|--all]]`<br><b>List all listening ports</b>`netstat [[-l|--listening]]`<br><b>List listening TCP ports</b>`netstat [[-t|--tcp]]`<br><b>Display PID and program names</b>`netstat [[-p|--program]]`<br><b>List information continuously</b>`netstat [[-c|--continuous]]`<br><b>List routes and do not resolve IP addresses to hostnames</b>`netstat [[-rn|--route --numeric]]`<br><b>List listening TCP and UDP ports (+ user and process if you're root)</b>`netstat [[-tulpne|--tcp --udp --listening --program --numeric --extend]]`


title: TLDR
content:
<b>Change user's primary group membership</b>`newgrp [group_name]`<br><b>Reset primary group membership to user's default group in /etc/passwd</b>`newgrp`


title: TLDR
content:
<b>List all attributes of a kernel module</b>`modinfo [kernel_module]`<br><b>List the specified attribute only</b>`modinfo [[-F|--field]] [author|description|license|parm|filename|version|...] [kernel_module]`


title: TLDR
content:
<b>Start the server with the default configuration file</b>`nginx`<br><b>Start the server with a custom configuration file</b>`nginx -c [configuration_file]`<br><b>Start the server with a prefix for all relative paths in the configuration file</b>`nginx -c [configuration_file] -p [path/to/prefix]`<br><b>Test the configuration without affecting the running server</b>`nginx -t`<br><b>Reload the configuration by sending a signal with no downtime</b>`nginx -s reload`


title: TLDR
content:
<b>Open the user interface</b>`nmtui`<br><b>List available connections, with the option to activate or deactivate them</b>`nmtui connect`<br><b>Connect to a given network</b>`nmtui connect [name|uuid|device|SSID]`<br><b>Edit/Add/Delete a given network</b>`nmtui edit [name|id]`<br><b>Set the system hostname</b>`nmtui hostname`


title: TLDR
content:
<b>Run a process that can live beyond the terminal</b>`nohup [command] [argument1 argument2 ...]`<br><b>Launch nohup in background mode</b>`nohup [command] [argument1 argument2 ...] &`<br><b>Run a shell script that can live beyond the terminal</b>`nohup [path/to/script.sh] &`<br><b>Run a process and write the output to a specific file</b>`nohup [command] [argument1 argument2 ...] > [path/to/output_file] &`


title: TLDR
content:
<b>Parse the contents of a URL or file</b>`nokogiri [url|path/to/file]`<br><b>Parse as a specific type</b>`nokogiri [url|path/to/file] --type [xml|html]`<br><b>Load a specific initialization file before parsing</b>`nokogiri [url|path/to/file] -C [path/to/config_file]`<br><b>Parse using a specific encoding</b>`nokogiri [url|path/to/file] [[-E|--encoding]] [encoding]`<br><b>Validate using a RELAX NG file</b>`nokogiri [url|path/to/file] --rng [url|path/to/file]`


title: TLDR
content:
<b>Show a notification with the title "Test" and the content "This is a test"</b>`notify-send "[Test]" "[This is a test]"`<br><b>Show a notification with a custom icon</b>`notify-send [[-i|--icon]] [icon.png] "[Test]" "[This is a test]"`<br><b>Show a notification for 5 seconds</b>`notify-send [[-t|--expire-time]] 5000 "[Test]" "[This is a test]"`<br><b>Show a notification with the specified urgency level (default: normal)</b>`notify-send [[-u|--urgency]] [low|normal|critical] "[Test]" "[This is a test]"`<br><b>Show a notification with an app's icon and name</b>`notify-send "[Test]" [[-i|--icon]] [google-chrome] [[-a|--app-name]] "[Google Chrome]"`


title: TLDR
content:
<b>Query your system's default name server for an IP address (A record) of the domain</b>`nslookup [example.com]`<br><b>Query a given name server for a NS record of the domain</b>`nslookup -type=NS [example.com] [8.8.8.8]`<br><b>Query for a reverse lookup (PTR record) of an IP address</b>`nslookup -type=PTR [54.240.162.118]`<br><b>Query for ANY available records using TCP protocol</b>`nslookup -vc -type=ANY [example.com]`<br><b>Query a given name server for the whole zone file (zone transfer) of the domain using TCP protocol</b>`nslookup -vc -type=AXFR [example.com] [name_server]`<br><b>Query for a mail server (MX record) of the domain, showing details of the transaction</b>`nslookup -type=MX -debug [example.com]`<br><b>Query a given name server on a specific port number for a TXT record of the domain</b>`nslookup -port=[port_number] -type=TXT [example.com] [name_server]`


title: TLDR
content:
<b>List global (extern) functions in a file (prefixed with T)</b>`nm [[-g|--extern-only]] [path/to/file.o]`<br><b>List only undefined symbols in a file</b>`nm [[-u|--undefined-only]] [path/to/file.o]`<br><b>List all symbols, even debugging symbols</b>`nm [[-a|--debug-syms]] [path/to/file.o]`<br><b>Demangle C++ symbols (make them readable)</b>`nm [[-C|--demangle]] [path/to/file.o]`


title: TLDR
content:
<b>Display the number of available processing units</b>`nproc`<br><b>Display the number of installed processing units, including any inactive ones</b>`nproc --all`<br><b>If possible, subtract a given number of units from the returned value</b>`nproc --ignore [count]`


title: TLDR
content:
<b>View documentation for managing network interfaces and establishing new Wi-Fi connections</b>`tldr nmcli device`<br><b>View documentation for managing network connections</b>`tldr nmcli connection`<br><b>View documentation for running nmcli as a NetworkManager secret/polkit agent</b>`tldr nmcli agent`<br><b>View documentation for managing general settings of NetworkManager</b>`tldr nmcli general`<br><b>View documentation for NetworkManager's activity monitor</b>`tldr nmcli monitor`<br><b>View documentation for enabling/disabling and checking the status of networking</b>`tldr nmcli networking`<br><b>View documentation for managing radio switches</b>`tldr nmcli radio`


title: TLDR
content:
<b>Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with *</b>`od [path/to/file]`<br><b>Display file in verbose mode, i.e. without replacing duplicate lines with *</b>`od [[-v|--output-duplicates]] [path/to/file]`<br><b>Display file in hexadecimal format (2-byte units), with byte offsets in decimal format</b>`od [[-t|--format]] [x] [[-A|--address-radix]] [d] [[-v|--output-duplicates]] [path/to/file]`<br><b>Display file in hexadecimal format (1-byte units), and 4 bytes per line</b>`od [[-t|--format]] [x1] [[-w|--width=]]4 [[-v|--output-duplicates]] [path/to/file]`<br><b>Display file in hexadecimal format along with its character representation, and do not print byte offsets</b>`od [[-t|--format]] [xz] [[-A|--address-radix]] [n] [[-v|--output-duplicates]] [path/to/file]`<br><b>Read only 100 bytes of a file starting from the 500th byte</b>`od [[-N|--read-bytes]] 100 [[-j|--skip-bytes]] 500 [[-v|--output-duplicates]] [path/to/file]`


title: TLDR
content:
<b>Convert 1.5K (SI Units) to 1500</b>`numfmt --from si 1.5K`<br><b>Convert 5th field (1-indexed) to IEC Units without converting header</b>`ls -l | numfmt --header=1 --field 5 --to iec`<br><b>Convert to IEC units, pad with 5 characters, left aligned</b>`du [[-s|--summarize]] * | numfmt --to iec --format "%-5f"`


title: TLDR
content:
<b>Remove all but the 3 most recent package versions from the pacman cache</b>`paccache [[-r|--remove]]`<br><b>Set the number of package versions to keep</b>`paccache [[-rk|--remove --keep]] [num_versions]`<br><b>Perform a dry-run and show the number of candidate packages for deletion</b>`paccache [[-d|--dryrun]]`<br><b>Move candidate packages to a directory instead of deleting them</b>`paccache [[-m|--move]] [path/to/directory]`


title: TLDR
content:
<b>[S]ynchronize and update all packages</b>`sudo pacman -Syu`<br><b>Install a new package</b>`sudo pacman -S [package]`<br><b>[R]emove a package and its dependencies</b>`sudo pacman -Rs [package]`<br><b>Search ([s]) the package database for a regex or keyword</b>`pacman -Ss "[search_pattern]"`<br><b>Search the database for packages containing a specific [F]ile</b>`pacman -F "[file_name]"`<br><b>List only the [e]xplicitly installed packages and versions</b>`pacman -Qe`<br><b>List orphan packages (installed as [d]ependencies but not actually required by any package)</b>`pacman -Qtdq`<br><b>Empty the entire pacman cache</b>`sudo pacman -Scc`


title: TLDR
content:
<b>Pretend to load a module into the kernel, but don't actually do it</b>`sudo modprobe [[-n|--dry-run]] [module_name]`<br><b>Load a module into the kernel</b>`sudo modprobe [module_name]`<br><b>Remove a module from the kernel</b>`sudo modprobe [[-r|--remove]] [module_name]`<br><b>Remove a module and those that depend on it from the kernel</b>`sudo modprobe [[-r|--remove]] --remove-holders [module_name]`<br><b>Show a kernel module's dependencies</b>`sudo modprobe [[-D|--show-depends]] [module_name]`


title: TLDR
content:
<b>Show information about the sound server</b>`pactl info`<br><b>List all sinks (or other types - sinks are outputs and sink-inputs are active audio streams)</b>`pactl list [sinks] short`<br><b>Change the default sink (output) to 1 (the number can be retrieved via the list subcommand)</b>`pactl set-default-sink [1]`<br><b>Move sink-input 627 to sink 1</b>`pactl move-sink-input [627] [1]`<br><b>Set the volume of sink 1 to 75%</b>`pactl set-sink-volume [1] [0.75]`<br><b>Toggle mute on the default sink (using the special name @DEFAULT_SINK@)</b>`pactl set-sink-mute [@DEFAULT_SINK@] toggle`


title: TLDR
content:
<b>Join all the lines into a single line, using TAB as delimiter</b>`paste [[-s|--serial]] [path/to/file]`<br><b>Join all the lines into a single line, using the specified delimiter</b>`paste [[-sd|--serial --delimiters]] [delimiter] [path/to/file]`<br><b>Merge two files side by side, each in its column, using TAB as delimiter</b>`paste [path/to/file1] [path/to/file2]`<br><b>Merge two files side by side, each in its column, using the specified delimiter</b>`paste [[-d|--delimiters]] [delimiter] [path/to/file1] [path/to/file2]`<br><b>Merge two files, with lines added alternatively</b>`paste [[-d|--delimiters]] '\n' [path/to/file1] [path/to/file2]`


title: TLDR
content:
<b>Check pathnames for validity in the current system</b>`pathchk [path1 path2 ...]`<br><b>Check pathnames for validity on a wider range of POSIX compliant systems</b>`pathchk -p [path1 path2 ...]`<br><b>Check pathnames for validity on all POSIX compliant systems</b>`pathchk [[-p -P|--portability]] [path1 path2 ...]`<br><b>Only check for empty pathnames or leading dashes (-)</b>`pathchk -P [path1 path2 ...]`


title: TLDR
content:
<b>List the contents of an archive</b>`pax -f [archive.tar]`<br><b>List the contents of a gzip archive</b>`pax -zf [archive.tar.gz]`<br><b>Create an archive from files</b>`pax -wf [target.tar] [path/to/file1 path/to/file2 ...]`<br><b>Create an archive from files, using output redirection</b>`pax -w [path/to/file1 path/to/file2 ...] > [target.tar]`<br><b>Extract an archive into the current directory</b>`pax -rf [source.tar]`<br><b>Copy to a directory, while keeping the original metadata; target/ must exist</b>`pax -rw [path/to/file1] [path/to/directory1 path/to/directory2 ...] [target/]`


title: TLDR
content:
<b>Launch xeyes on the local machine's default display</b>`xeyes`<br><b>Launch xeyes on a remote machine's display 0, screen 0</b>`xeyes -display [remote_host]:[0].[0]`


title: TLDR
content:
<b>Execute a Java .class file that contains a main method by using just the class name</b>`java [classname]`<br><b>Execute a Java program and use additional third-party or user-defined classes</b>`java -classpath [path/to/classes1]:[path/to/classes2]:. [classname]`<br><b>Execute a .jar program</b>`java -jar [filename.jar]`<br><b>Execute a .jar program with debug waiting to connect on port 5005</b>`java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 -jar [filename.jar]`<br><b>Display JDK, JRE and HotSpot versions</b>`java -version`<br><b>Display help</b>`java -help`


title: TLDR
content:
<b>Open a file</b>`less [source_file]`<br><b>Page down/up</b>`[<Space>|<b>]`<br><b>Go to end/start of file</b>`[<G>|<g>]`<br><b>Forward search for a string (press <n>/<N> to go to next/previous match)</b>`</>[something]`<br><b>Backward search for a string (press <n>/<N> to go to next/previous match)</b>`<?>[something]`<br><b>Follow the output of the currently opened file</b>`<F>`<br><b>Open the current file in an editor</b>`<v>`<br><b>Exit</b>`<q>`


title: TLDR
content:
<b>Generate an analyzer from a Lex file, storing it to the file lex.yy.c</b>`lex [analyzer.l]`<br><b>Specify the output file</b>`lex -t [analyzer.l] > [analyzer.c]`<br><b>Compile a C file generated by Lex</b>`c99 [path/to/lex.yy.c] -o [executable]`


title: TLDR
content:
<b>Print lines from stdin [m]atching regex1 and case [i]nsensitive regex2</b>`perl -n -e 'print if m/regex1/ and m/regex2/i'`<br><b>Say ([-E]) first match group, using a regex, ignoring space ([x]) in regex</b>`perl -n -E 'say $1 if m/[before] ( [group_regex] ) [after]/x'`<br><b>[i]n-place, with backup, [s]ubstitute all occurrence ([g]) of regex with a replacement</b>`perl -i'.bak' -p -e 's/regex/[replacement]/g' [path/to/files]`


title: TLDR
content:
<b>Add one or more files or directories to a Phar file</b>`phar add -f [path/to/phar_file] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Display the contents of a Phar file</b>`phar list -f [path/to/phar_file]`<br><b>Delete the specified file or directory from a Phar file</b>`phar delete -f [path/to/phar_file] -e [file_or_directory]`<br><b>Compress or uncompress files and directories in a Phar file</b>`phar compress -f [path/to/phar_file] -c [algorithm]`<br><b>Get information about a Phar file</b>`phar info -f [path/to/phar_file]`<br><b>Sign a Phar file with a specific hash algorithm</b>`phar sign -f [path/to/phar_file] -h [algorithm]`<br><b>Sign a Phar file with an OpenSSL private key</b>`phar sign -f [path/to/phar_file] -h openssl -y [path/to/private_key]`<br><b>Display help and available hashing/compression algorithms</b>`phar help`


title: TLDR
content:
<b>Parse and execute a PHP script</b>`php [path/to/file]`<br><b>Check syntax on (i.e. [l]int) a PHP script</b>`php [[-l|--syntax-check]] [path/to/file]`<br><b>Run PHP inter[a]ctively</b>`php [[-a|--interactive]]`<br><b>Run PHP code (Notes: Don't use <? ?> tags; escape double quotes with backslash)</b>`php [[-r|--run]] "[code]"`<br><b>Start a PHP built-in web server in the current directory</b>`php [[-S|--server]] [host]:[port]`<br><b>List installed PHP extensions</b>`php [[-m|--modules]]`<br><b>Display information about the current PHP configuration</b>`php [[-i|--info]]`<br><b>Display information about a specific function</b>`php [[--rf|--rfunction]] [function_name]`


title: TLDR
content:
<b>Display basic performance counter stats for a command</b>`perf stat [gcc hello.c]`<br><b>Display system-wide real-time performance counter profile</b>`sudo perf top`<br><b>Run a command and record its profile into perf.data</b>`sudo perf record [command]`<br><b>Record the profile of an existing process into perf.data</b>`sudo perf record [[-p|--pid]] [pid]`<br><b>Read perf.data (created by perf record) and display the profile</b>`sudo perf report`


title: TLDR
content:
<b>Ping a host</b>`ping6 [host]`<br><b>Ping a host only a specific number of times</b>`ping6 -c [count] [host]`<br><b>Ping a host, specifying the interval in seconds between requests (default is 1 second)</b>`ping6 -i [seconds] [host]`<br><b>Ping a host without trying to lookup symbolic names for addresses</b>`ping6 -n [host]`<br><b>Ping a host and ring the bell when a packet is received (if your terminal supports it)</b>`ping6 -a [host]`


title: TLDR
content:
<b>Install a package</b>`pip3 install [package]`<br><b>Install a specific version of a package</b>`pip3 install [package]==[version]`<br><b>Upgrade a package</b>`pip3 install [[-U|--upgrade]] [package]`<br><b>Uninstall a package</b>`pip3 uninstall [package]`<br><b>Save the list of installed packages to a file</b>`pip3 freeze > [requirements.txt]`<br><b>Install packages from a file</b>`pip3 install [[-r|--requirement]] [requirements.txt]`<br><b>Show installed package info</b>`pip3 show [package]`


title: TLDR
content:
<b>Install a package (see pip install for more install examples)</b>`pip install [package]`<br><b>Install a package to the user's directory instead of the system-wide default location</b>`pip install --user [package]`<br><b>Upgrade a package</b>`pip install [[-U|--upgrade]] [package]`<br><b>Uninstall a package</b>`pip uninstall [package]`<br><b>Save installed packages to file</b>`pip freeze > [requirements.txt]`<br><b>List installed packages</b>`pip list`<br><b>Show installed package info</b>`pip show [package]`<br><b>Install packages from a file</b>`pip install [[-r|--requirement]] [requirements.txt]`


title: TLDR
content:
<b>Play the given audio file</b>`play [path/to/audio_file]`<br><b>Play the given audio files</b>`play [path/to/audio_file1 path/to/audio_file2 ...]`<br><b>Play the given audio at twice the speed</b>`play [path/to/audio_file] speed 2.0`<br><b>Play the given audio in reverse</b>`play [path/to/audio_file] reverse`


title: TLDR
content:
<b>Convert filename.pdf to plain text and print it to stdout</b>`pdftotext [filename.pdf] -`<br><b>Convert filename.pdf to plain text and save it as filename.txt</b>`pdftotext [filename.pdf]`<br><b>Convert filename.pdf to plain text and preserve the layout</b>`pdftotext -layout [filename.pdf]`<br><b>Convert input.pdf to plain text and save it as output.txt</b>`pdftotext [input.pdf] [output.txt]`<br><b>Convert pages 2, 3 and 4 of input.pdf to plain text and save them as output.txt</b>`pdftotext -f [2] -l [4] [input.pdf] [output.txt]`


title: TLDR
content:
<b>Display details about the current user</b>`pinky`<br><b>Display details for a specific user</b>`pinky [user]`<br><b>Display details in the long format</b>`pinky [user] -l`<br><b>Omit the user's home directory and shell in long format</b>`pinky [user] -lb`<br><b>Omit the user's project file in long format</b>`pinky [user] -lh`<br><b>Omit the column headings in short format</b>`pinky [user] -f`


title: TLDR
content:
<b>Return PIDs of any running processes with a matching command string</b>`pgrep [process_name]`<br><b>Search for processes including their command-line options</b>`pgrep [[-f|--full]] "[process_name] [parameter]"`<br><b>Search for processes run by a specific user</b>`pgrep [[-u|--euid]] root [process_name]`


title: TLDR
content:
<b>Launch a program with altered priority</b>`nice -[niceness_value] [command]`<br><b>Define the priority with an explicit option</b>`nice [[-n|--adjustment]] [niceness_value] [command]`


title: TLDR
content:
<b>List all input devices</b>`xinput list`<br><b>Disable an input</b>`xinput disable [id]`<br><b>Enable an input</b>`xinput enable [id]`<br><b>Disconnect an input from its master</b>`xinput float [id]`<br><b>Reattach an input as slave to a master</b>`xinput reattach [id] [master_id]`<br><b>List settings of an input device</b>`xinput list-props [id]`<br><b>Change a setting of an input device</b>`xinput set-prop [id] [setting_id] [value]`


title: TLDR
content:
<b>Power off the system</b>`poweroff`<br><b>Halt the system (same as halt)</b>`poweroff --halt`<br><b>Reboot the system (same as reboot)</b>`poweroff --reboot`<br><b>Shut down immediately without contacting the system manager</b>`poweroff [[-f|--force]]`<br><b>Write the wtmp shutdown entry without shutting down the system</b>`poweroff [[-w|--wtmp-only]]`


title: TLDR
content:
<b>Kill all processes which match</b>`pkill "[process_name]"`<br><b>Kill all processes which match their full command instead of just the process name</b>`pkill [[-f|--full]] "[command_name]"`<br><b>Force kill matching processes (can't be blocked)</b>`pkill -9 "[process_name]"`<br><b>Send SIGUSR1 signal to processes which match</b>`pkill -USR1 "[process_name]"`<br><b>Kill the main firefox process to close the browser</b>`pkill [[-o|--oldest]] "[firefox]"`


title: TLDR
content:
<b>Submit a script with default settings (depends on TORQUE settings)</b>`qsub [script.sh]`<br><b>Submit a script with a specified wallclock runtime limit of 1 hour, 2 minutes and 3 seconds</b>`qsub -l walltime=[1]:[2]:[3] [script.sh]`<br><b>Submit a script that is executed on 2 nodes using 4 cores per node</b>`qsub -l nodes=[2]:ppn=[4] [script.sh]`<br><b>Submit a script to a specific queue. Note that different queues can have different maximum and minimum runtime limits</b>`qsub -q [queue_name] [script.sh]`


title: TLDR
content:
<b>View documentation for the Zsh builtin</b>`tldr print.zsh`<br><b>View documentation for the print alias of run-mailcap</b>`tldr [[-p|--platform]] linux print.runmailcap`<br><b>View documentation for printing text files on Windows</b>`tldr [[-p|--platform]] windows print.win`


title: TLDR
content:
<b>Generate Python code from a .proto file</b>`protoc --python_out=[path/to/output_directory] [input_file.proto]`<br><b>Generate Java code from a .proto file that imports other .proto files</b>`protoc --java_out=[path/to/output_directory] --proto_path=[path/to/import_search_path] [input_file.proto]`<br><b>Generate code for multiple languages</b>`protoc --csharp_out=[path/to/c#_output_directory] --js_out=[path/to/js_output_directory] [input_file.proto]`<br><b>Encode a text-format message into a protocol message from a .proto file</b>`protoc < [message.txt] --encode=[TypeName] [input_file.proto]`<br><b>Decode a protocol message into text-format from a .proto file</b>`protoc < [message.bin] --decode=[TypeName] [input_file.proto]`<br><b>Decode a protocol message into raw tag/value pairs</b>`protoc < [message.bin] --decode_raw`


title: TLDR
content:
<b>Display key-value pairs of all environment variables</b>`printenv`<br><b>Display the value of a specific variable</b>`printenv [HOME]`<br><b>Display the value of a variable and end with NUL instead of newline</b>`printenv [[-0|--null]] [HOME]`


title: TLDR
content:
<b>Print a text message</b>`printf "[%s\n]" "[Hello world]"`<br><b>Print an integer in bold blue</b>`printf "[\e[1;34m%.3d\e[0m\n]" [42]`<br><b>Print a float number with the Unicode Euro sign</b>`printf "[\u20AC %.2f\n]" [123.4]`<br><b>Print a text message composed with environment variables</b>`printf "[var1: %s\tvar2: %s\n]" "[$VAR1]" "[$VAR2]"`<br><b>Store a formatted message in a variable (does not work on Zsh)</b>`printf -v [myvar] ["This is %s = %d\n" "a year" 2016]`<br><b>Print a hexadecimal, octal and scientific number</b>`printf "[hex=%x octal=%o scientific=%e]" 0x[FF] 0[377] [100000]`


title: TLDR
content:
<b>List all running processes</b>`ps aux`<br><b>List all running processes including the full command string</b>`ps auxww`<br><b>Search for a process that matches a string (the brackets will prevent grep from matching itself)</b>`ps aux | grep [[s]tring]`<br><b>List all processes of the current user in extra full format</b>`ps [[-u|--user]] $(id [[-u|--user]]) -F`<br><b>List all processes of the current user as a tree</b>`ps [[-u|--user]] $(id [[-u|--user]]) f`<br><b>Get the parent PID of a process</b>`ps [[-o|--format]] ppid= [[-p|--pid]] [pid]`<br><b>Sort processes by memory consumption</b>`ps --sort size`


title: TLDR
content:
<b>Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one</b>`qpdf --empty --pages [path/to/input.pdf] [1-3,5,6-10] -- [path/to/output.pdf]`<br><b>Merge (concatenate) all the pages of multiple PDF files and save the result as a new PDF</b>`qpdf --empty --pages [path/to/file1.pdf file2.pdf ...] -- [path/to/output.pdf]`<br><b>Merge (concatenate) given pages from a list of PDF files and save the result as a new PDF</b>`qpdf --empty --pages [path/to/file1.pdf] [1,6-8] [path/to/file2.pdf] [3,4,5] -- [path/to/output.pdf]`<br><b>Write each group of n pages to a separate output file with a given filename pattern</b>`qpdf --split-pages=[n] [path/to/input.pdf] [path/to/out_%d.pdf]`<br><b>Rotate certain pages of a PDF with a given angle</b>`qpdf --rotate=[90:2,4,6] --rotate=[180:7-8] [path/to/input.pdf] [path/to/output.pdf]`<br><b>Remove the password from a password-protected file</b>`qpdf --password=[password] --decrypt [path/to/input.pdf] [path/to/output.pdf]`


title: TLDR
content:
<b>Connect to the database. By default, it connects to the local socket using port 5432 with the currently logged in user</b>`psql [database]`<br><b>Connect to the database on given server host running on given port with given username, without a password prompt</b>`psql [[-h|--host]] [host] [[-p|--port]] [port] [[-U|--username]] [username] [database]`<br><b>Connect to the database; user will be prompted for password</b>`psql [[-h|--host]] [host] [[-p|--port]] [port] [[-U|--username]] [username] [[-W|--password]] [database]`<br><b>Execute a single SQL query or PostgreSQL command on the given database (useful in shell scripts)</b>`psql [[-c|--command]] '[query]' [database]`<br><b>Execute commands from a file on the given database</b>`psql [database] [[-f|--file]] [path/to/file.sql]`


title: TLDR
content:
<b>Print the contents of the file and display a progress bar</b>`pv [path/to/file]`<br><b>Measure the speed and amount of data flow between pipes (--size is optional)</b>`[command1] | pv [[-s|--size]] [expected_amount_of_data_for_eta] | [command2]`<br><b>Filter a file, see both progress and amount of output data</b>`pv [[-cN|--cursor --name]] in [path/to/file.txt] | grep [pattern] | pv [[-cN|--cursor --name]] out > [path/to/filtered_file.txt]`<br><b>Attach to an already running process and see its file reading progress</b>`pv [[-d|--watchfd]] [PID]`<br><b>Read an erroneous file, skip errors as dd conv=sync,noerror would</b>`pv [[-EE|--skip-errors --skip-errors]] [path/to/faulty_media] > [path/to/image.img]`<br><b>Stop reading after reading specified amount of data, rate limit to 1K/s</b>`pv [[-L|--rate-limit]] [1K] [[-S|--stop-at-size]] [maximum_file_size_to_be_read]`<br><b>Calculate hash (MD5, SHA1, SHA256, etc) of a large file and show progress</b>`pv [path/to/file] | [sha256sum]`


title: TLDR
content:
<b>Display a tree of all processes (rooted at init)</b>`pstree`<br><b>Display a tree of processes with PIDs</b>`pstree [[-p|--show-pids]]`<br><b>Display all process trees rooted at processes owned by specified user</b>`pstree [user]`<br><b>Display command line arguments</b>`pstree [[-a|--arguments]]`<br><b>Display children of a specified process</b>`pstree [pid]`<br><b>Display parents of a specified process</b>`pstree [[-s|--show-parents]] [pid]`


title: TLDR
content:
<b>Initialize the /dev/sda1 volume for use by LVM</b>`sudo pvcreate [/dev/sdXY]`<br><b>Force the creation without any confirmation prompts</b>`sudo pvcreate [[-f|--force]] [/dev/sdXY]`


title: TLDR
content:
<b>Generate a permuted index where the first field of each line is an index reference</b>`ptx [[-r|--references]] [path/to/file]`<br><b>Generate a permuted index with automatically generated index references</b>`ptx [[-A|--auto-reference]] [path/to/file]`<br><b>Generate a permuted index with a fixed width</b>`ptx [[-w|--width]] [width_in_columns] [path/to/file]`<br><b>Generate a permuted index with a list of filtered words</b>`ptx [[-o|--only-file]] [path/to/filter] [path/to/file]`<br><b>Generate a permuted index with SYSV-style behaviors</b>`ptx [[-G|--traditional]] [path/to/file]`


title: TLDR
content:
<b>Generate random password with symbols</b>`pwgen [[-y|--symbols]] [length]`<br><b>Generate secure, hard-to-memorize passwords</b>`pwgen [[-s|--secure]] [length]`<br><b>Generate password with at least one capital letter in them</b>`pwgen [[-c|--capitalize]] [length]`


title: TLDR
content:
<b>Highlight file syntax and print to stdout (language is inferred from the file extension)</b>`pygmentize [file.py]`<br><b>Explicitly set the language for syntax highlighting</b>`pygmentize -l [javascript] [input_file]`<br><b>List available lexers (processors for input languages)</b>`pygmentize -L lexers`<br><b>Save output to a file in HTML format</b>`pygmentize -f html -o [output_file.html] [input_file.py]`<br><b>List available output formats</b>`pygmentize -L formatters`<br><b>Output an HTML file, with additional formatter options (full page, with line numbers)</b>`pygmentize -f html -O "full,linenos=True" -o [output_file.html] [input_file]`


title: SYNOPSIS
content:
<p><b>python</b> [ <b>-B</b> ] [ <b>-b</b> ] [ <b>-d</b> ] [ <b>-E</b> ] [ <b>-h</b> ] [ <b>-i</b> ] [ <b>-I</b> ] <br> [ <b>-m</b> <i>module-name</i> ] [ <b>-q</b> ] [ <b>-O</b> ] [ <b>-OO</b> ] [ <b>-s</b> ] [ <b>-S</b> ] [ <b>-u</b> ] <br> [ <b>-v</b> ] [ <b>-V</b> ] [ <b>-W</b> <i>argument</i> ] [ <b>-x</b> ] [ [ <b>-X</b> <i>option</i> ] <b>-?</b> ] <br> [ <b>-c</b> <i>command</i> | <i>script</i> | - ] [ <i>arguments</i> ]</p>


title: DESCRIPTION
content:
<p>Python is an interpreted, interactive, object-oriented programming language that combines remarkable power with very clear syntax. For an introduction to programming in Python you are referred to the Python Tutorial. The Python Library Reference documents built-in and standard types, constants, functions and modules. Finally, the Python Reference Manual describes the syntax and semantics of the core language in (perhaps too) much detail. (These documents may be located via the <b>INTERNET RESOURCES</b> below; they may be installed on your system as well.)</p> <p>Python&rsquo;s basic power can be extended with your own modules written in C or C++. On most systems such modules may be dynamically loaded. Python is also adaptable as an extension language for existing applications. See the internal documentation for hints.</p> <p>Documentation for installed Python modules and packages can be viewed by running the <b>pydoc</b> program.</p>


title: COMMAND LINE OPTIONS
content:
<p><b>-B</b></p> <p>Don&rsquo;t write <i>.py[co]</i> files on import. See also PYTHONDONTWRITEBYTECODE.</p> <p><b>-b</b></p> <p>Issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str. (-bb: issue errors)</p> <p><b>-c</b> <i>command</i></p> <p>Specify the command to execute (see next section). This terminates the option list (following options are passed as arguments to the command).</p> <p><b>-d</b></p> <p>Turn on parser debugging output (for wizards only, depending on compilation options).</p> <p><b>-E</b></p> <p>Ignore environment variables like PYTHONPATH and PYTHONHOME that modify the behavior of the interpreter.</p> <p><b>-h , -? , --help</b></p> <p>Prints the usage for the interpreter executable and exits.</p> <p><b>-i</b></p> <p>When a script is passed as first argument or the <b>-c</b> option is used, enter interactive mode after executing the script or the command. It does not read the $PYTHONSTARTUP file. This can be useful to inspect global variables or a stack trace when a script raises an exception.</p> <p><b>-I</b></p> <p>Run Python in isolated mode. This also implies <b>-E</b> and <b>-S</b>. In isolated mode sys.path contains neither the script&acirc;s directory nor the user&acirc;s site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.</p> <p><b>-m</b> <i>module-name</i></p> <p>Searches <i>sys.path</i> for the named module and runs the corresponding <i>.py</i> file as a script.</p> <p><b>-O</b></p> <p>Turn on basic optimizations. This changes the filename extension for compiled (bytecode) files from <i>.pyc</i> to <i>.pyo</i>. Given twice, causes docstrings to be discarded.</p> <p><b>-OO</b></p> <p>Discard docstrings in addition to the <b>-O</b> optimizations.</p> <p><b>-q</b></p> <p>Do not print the version and copyright messages. These messages are also suppressed in non-interactive mode.</p> <p><b>-s</b></p> <p>Don&rsquo;t add user site directory to sys.path.</p> <p><b>-S</b></p> <p>Disable the import of the module <i>site</i> and the site-dependent manipulations of <i>sys.path</i> that it entails. Also disable these manipulations if <i>site</i> is explicitly imported later.</p> <p><b>-u</b></p> <p>Force the binary I/O layers of stdout and stderr to be unbuffered. stdin is always buffered. The text I/O layer will still be line-buffered.</p> <p><b>-v</b></p> <p>Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice, print a message for each file that is checked for when searching for a module. Also provides information on module cleanup at exit.</p> <p><b>-V , --version</b></p> <p>Prints the Python version number of the executable and exits.</p> <p><b>-W</b> <i>argument</i></p> <p>Warning control. Python sometimes prints warning message to <i>sys.stderr</i>. A typical warning message has the following form: <i>file</i><b>:</b><i>line</i><b>:</b> <i>category</i><b>:</b> <i>message.</i> By default, each warning is printed once for each source line where it occurs. This option controls how often warnings are printed. Multiple <b>-W</b> options may be given; when a warning matches more than one option, the action for the last matching option is performed. Invalid <b>-W</b> options are ignored (a warning message is printed about invalid options when the first warning is issued). Warnings can also be controlled from within a Python program using the <i>warnings</i> module.</p> <p>The simplest form of <i>argument</i> is one of the following <i>action</i> strings (or a unique abbreviation): <b>ignore</b> to ignore all warnings; <b>default</b> to explicitly request the default behavior (printing each warning once per source line); <b>all</b> to print a warning each time it occurs (this may generate many messages if a warning is triggered repeatedly for the same source line, such as inside a loop); <b>module</b> to print each warning only the first time it occurs in each module; <b>once</b> to print each warning only the first time it occurs in the program; or <b>error</b> to raise an exception instead of printing a warning message.</p> <p>The full form of <i>argument</i> is <i>action</i><b>:</b><i>message</i><b>:</b><i>category</i><b>:</b><i>module</i><b>:</b><i>line.</i> Here, <i>action</i> is as explained above but only applies to messages that match the remaining fields. Empty fields match all values; trailing empty fields may be omitted. The <i>message</i> field matches the start of the warning message printed; this match is case-insensitive. The <i>category</i> field matches the warning category. This must be a class name; the match test whether the actual warning category of the message is a subclass of the specified warning category. The full class name must be given. The <i>module</i> field matches the (fully-qualified) module name; this match is case-sensitive. The <i>line</i> field matches the line number, where zero matches all line numbers and is thus equivalent to an omitted line number.</p> <p><b>-X</b> <i>option</i></p> <p>Set implementation specific option.</p> <p><b>-x</b></p> <p>Skip the first line of the source. This is intended for a DOS specific hack only. Warning: the line numbers in error messages will be off by one!</p>


title: INTERPRETER INTERFACE
content:
<p>The interpreter interface resembles that of the UNIX shell: when called with standard input connected to a tty device, it prompts for commands and executes them until an EOF is read; when called with a file name argument or with a file as standard input, it reads and executes a <i>script</i> from that file; when called with <b>-c</b> <i>command</i>, it executes the Python statement(s) given as <i>command</i>. Here <i>command</i> may contain multiple statements separated by newlines. Leading whitespace is significant in Python statements! In non-interactive mode, the entire input is parsed before it is executed.</p> <p>If available, the script name and additional arguments thereafter are passed to the script in the Python variable <i>sys.argv</i>, which is a list of strings (you must first <i>import sys</i> to be able to access it). If no script name is given, <i>sys.argv[0]</i> is an empty string; if <b>-c</b> is used, <i>sys.argv[0]</i> contains the string <i>&rsquo;-c&rsquo;.</i> Note that options interpreted by the Python interpreter itself are not placed in <i>sys.argv</i>.</p> <p>In interactive mode, the primary prompt is &rsquo;&gt;&gt;&gt;&rsquo;; the second prompt (which appears when a command is not complete) is &rsquo;...&rsquo;. The prompts can be changed by assignment to <i>sys.ps1</i> or <i>sys.ps2</i>. The interpreter quits when it reads an EOF at a prompt. When an unhandled exception occurs, a stack trace is printed and control returns to the primary prompt; in non-interactive mode, the interpreter exits after printing the stack trace. The interrupt signal raises the <i>KeyboardInterrupt</i> exception; other UNIX signals are not caught (except that SIGPIPE is sometimes ignored, in favor of the <i>IOError</i> exception). Error messages are written to stderr.</p>


title: FILES AND DIRECTORIES
content:
<p>These are subject to difference depending on local installation conventions; ${prefix} and ${exec_prefix} are installation-dependent and should be interpreted as for GNU software; they may be the same. On Debian GNU/{Hurd,Linux} the default for both is <i>/usr</i>. <i><br> ${exec_prefix}/bin/python</i></p> <p>Recommended location of the interpreter.</p> <p><i>${prefix}/lib/python&lt;version&gt; <br> ${exec_prefix}/lib/python&lt;version&gt;</i></p> <p>Recommended locations of the directories containing the standard modules.</p> <p><i>${prefix}/include/python&lt;version&gt; <br> ${exec_prefix}/include/python&lt;version&gt;</i></p> <p>Recommended locations of the directories containing the include files needed for developing Python extensions and embedding the interpreter.</p>


title: ENVIRONMENT VARIABLES
content:
<p>PYTHONHOME</p> <p>Change the location of the standard Python libraries. By default, the libraries are searched in ${prefix}/lib/python&lt;version&gt; and ${exec_prefix}/lib/python&lt;version&gt;, where ${prefix} and ${exec_prefix} are installation-dependent directories, both defaulting to <i>/usr/local</i>. When $PYTHONHOME is set to a single directory, its value replaces both ${prefix} and ${exec_prefix}. To specify different values for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.</p> <p>PYTHONPATH</p> <p>Augments the default search path for module files. The format is the same as the shell&rsquo;s $PATH: one or more directory pathnames separated by colons. Non-existent directories are silently ignored. The default search path is installation dependent, but generally begins with ${prefix}/lib/python&lt;version&gt; (see PYTHONHOME above). The default search path is always appended to $PYTHONPATH. If a script argument is given, the directory containing the script is inserted in the path in front of $PYTHONPATH. The search path can be manipulated from within a Python program as the variable <i>sys.path</i>.</p> <p>PYTHONSTARTUP</p> <p>If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same name space where interactive commands are executed so that objects defined or imported in it can be used without qualification in the interactive session. You can also change the prompts <i>sys.ps1</i> and <i>sys.ps2</i> in this file.</p> <p>PYTHONY2K</p> <p>Set this to a non-empty string to cause the <i>time</i> module to require dates specified as strings to include 4-digit years, otherwise 2-digit years are converted based on rules described in the <i>time</i> module documentation.</p> <p>PYTHONOPTIMIZE</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-O</b> option. If set to an integer, it is equivalent to specifying <b>-O</b> multiple times.</p> <p>PYTHONDEBUG</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-d</b> option. If set to an integer, it is equivalent to specifying <b>-d</b> multiple times.</p> <p>PYTHONDONTWRITEBYTECODE</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-B</b> option (don&rsquo;t try to write <i>.py[co]</i> files).</p> <p>PYTHONINSPECT</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-i</b> option.</p> <p>PYTHONIOENCODING</p> <p>If this is set before running the interpreter, it overrides the encoding used for stdin/stdout/stderr, in the syntax <i>encodingname</i><b>:</b><i>errorhandler</i> The <i>errorhandler</i> part is optional and has the same meaning as in str.encode. For stderr, the <i>errorhandler</i> <br> part is ignored; the handler will always be &acute;backslashreplace&acute;.</p> <p>PYTHONNOUSERSITE</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-s</b> option (Don&rsquo;t add the user site directory to sys.path).</p> <p>PYTHONUNBUFFERED</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-u</b> option.</p> <p>PYTHONVERBOSE</p> <p>If this is set to a non-empty string it is equivalent to specifying the <b>-v</b> option. If set to an integer, it is equivalent to specifying <b>-v</b> multiple times.</p> <p>PYTHONWARNINGS</p> <p>If this is set to a comma-separated string it is equivalent to specifying the <b>-W</b> option for each separate value.</p> <p>PYTHONHASHSEED</p> <p>If this variable is set to &quot;random&quot;, a random value is used to seed the hashes of str, bytes and datetime objects.</p> <p>If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for generating the hash() of the types covered by the hash randomization. Its purpose is to allow repeatable hashing, such as for selftests for the interpreter itself, or to allow a cluster of python processes to share hash values.</p> <p>The integer must be a decimal number in the range [0,4294967295]. Specifying the value 0 will disable hash randomization.</p>


title: INTERNET RESOURCES
content:
<p>Main website: http://www.python.org/ <br> Documentation: http://docs.python.org/py3k/ <br> Developer resources: http://docs.python.org/devguide/ <br> Downloads: http://python.org/download/ <br> Module repository: http://pypi.python.org/ <br> Newsgroups: comp.lang.python, comp.lang.python.announce</p>


title: LICENSING
content:
<p>Python is distributed under an Open Source license. See the file &quot;LICENSE&quot; in the Python source distribution for information on terms &amp; conditions for accessing and otherwise using Python and for a DISCLAIMER OF ALL WARRANTIES.</p>


title: TLDR
content:
<b>Print the current directory</b>`pwd`<br><b>Print the current directory, and resolve all symlinks (i.e. show the "physical" path)</b>`pwd [[-P|--physical]]`<br><b>Display help</b>`pwd --help`


title: TLDR
content:
<b>Display general information about a binary (architecture, type, endianness)</b>`rabin2 -I [path/to/binary]`<br><b>Display linked libraries</b>`rabin2 -l [path/to/binary]`<br><b>Display symbols imported from libraries</b>`rabin2 -i [path/to/binary]`<br><b>Display strings contained in the binary</b>`rabin2 -z [path/to/binary]`<br><b>Display the output in JSON</b>`rabin2 -j -I [path/to/binary]`


title: TLDR
content:
<b>Display a cursor to kill a window when pressing the left mouse button (press any other mouse button to cancel)</b>`xkill`<br><b>Display a cursor to select a window to kill by pressing any mouse button</b>`xkill -button any`<br><b>Kill a window with a specific ID (use xwininfo to get info about windows)</b>`xkill -id [id]`


title: TLDR
content:
<b>Get the actual file to which the symlink points</b>`readlink [path/to/file]`<br><b>Get the absolute path to a file</b>`readlink [[-f|--canonicalize]] [path/to/file]`


title: TLDR
content:
<b>Ping host</b>`ping [host]`<br><b>Ping a host only a specific number of times</b>`ping -c [count] [host]`<br><b>Ping host, specifying the interval in seconds between requests (default is 1 second)</b>`ping -i [seconds] [host]`<br><b>Ping host without trying to lookup symbolic names for addresses</b>`ping -n [host]`<br><b>Ping host and ring the bell when a packet is received (if your terminal supports it)</b>`ping -a [host]`<br><b>Also display a message if no response was received</b>`ping -O [host]`<br><b>Ping a host with specific number of pings, per-packet response timeout (-W), and total time limit (-w) of the entire ping run</b>`ping -c [count] -W [seconds] -w [seconds] [host]`


title: DESCRIPTION
content:
rdesktop  is a client for Remote Desktop Protocol (RDP), used in a num‐
   ber of Microsoft products including Windows NT Terminal Server, Windows
   2000 Server, Windows XP and Windows 2003 Server.


title: OPTIONS
content:
-u <username>
          Username for authentication on the server.

   -d <domain>
          Domain for authentication.

   -s <shell>
          Startup  shell  for the user - starts a specific application in‐
          stead of Explore.  If SeamlessRDP is enabled this is the  appli‐
          cation which i started in seamless mode.

   -c <directory>
          The  initial working directory for the user.  Often used in com‐
          bination with -s to set up a fixed login environment.

   -p <password>
          The password to authenticate with.  Note that this may  have  no
          effect if "Always prompt for password" is enabled on the server.
          WARNING: if you specify a password on the command line it may be
          visible to other users when they use tools like ps.  Use -p - to
          make rdesktop request a password at startup (from  standard  in‐
          put).

   -n <hostname>
          Client  hostname.   Normally  rdesktop automatically obtains the
          hostname of the client.

   -k <keyboard-map>
          Keyboard layout  to  emulate.   This  requires  a  corresponding
          keymap file to be installed.  The standard keymaps provided with
          rdesktop follow the RFC1766 naming scheme: a language code  fol‐
          lowed  by  a country code if necessary - e.g.  en-us, en-gb, de,
          fr, sv, etc.

          The default keyboard map depends on the current locale (LC_* and
          LANG  environment  variables). If the current locale is unknown,
          the default keyboard map is en-us (a US English keyboard).

          The keyboard maps are file names, which means that they are case
          sensitive. The standard keymaps are all in lowercase.

          The  keyboard  maps  are  searched  relative  to the directories
          $HOME/.rdesktop/keymaps, KEYMAP_PATH (specified at build  time),
          and  $CWD/keymaps,  in this order. The keyboard-map argument can
          also be an absolute filename.

          The special value `none' can be used instead of a keyboard  map.
          In  this  case,  rdesktop  will guess the scancodes from the X11
          event key codes using an internal mapping  method.  This  method
          only supports the basic alphanumeric keys and may not work prop‐
          erly on all platforms so its use is discouraged.

   -g <geometry>
          Desktop  geometry  (WxH).  If  geometry  is  the  special   word
          "workarea",  the geometry will be fetched from the extended win‐
          dow manager hints property _NET_WORKAREA, from the root  window.
          The  geometry can also be specified as a percentage of the whole
          screen, e.g. "-g 80%".

          If the specified geometry depends on the screen  size,  and  the
          screen  size  is  changed, rdesktop will automatically reconnect
          using the new screen size. This requires that rdesktop has  been
          compiled with RandR support.

   -i     Use  password  as  smartcard pin. If a valid user certificate is
          matched in smart card reader the password passed with p argument
          is  used  as pin for the smart card.  This feature also requires
          that smart card redirection is used using r scard argument.

   -f     Enable fullscreen mode.  This overrides the window  manager  and
          causes  the  rdesktop  window to fully cover the current screen.
          Fullscreen mode can be toggled at any time using Ctrl-Alt-Enter.

   -b     Force the server to send screen updates as bitmaps  rather  than
          using higher-level drawing operations.

   -t     Disable  use  of remote control. This will disable features like
          seamless connection sharing.

   -A <seamlessrdpshell>
          Enable SeamlessRDP by specifying the path to seamless rdp shell.
          In  this  mode, rdesktop creates a X11 window for each window on
          the server side.  This mode requires the SeamlessRDP server side
          component,  which  is available from http://www.cendio.com/seam‐
          lessrdp/.

          When using this option, you should normally  specify  a  startup
          shell  which  launches the desired application through Seamless‐
          RDP.

          Example: rdesktop  -A  'c:\seamlessrdp\seamlessrdpshell.exe'  -s
          'notepad' mywts.domain.com

          Any  subsequential  call  to  the above commandline example will
          make use of the seamless connection sharing feature which spawns
          another  notepad  in  the  current  connection  to the specified
          server and then exit.

   -B     Use the BackingStore of the Xserver instead  of  the  integrated
          one in rdesktop.

   -e     Disable  encryption.   This option is only needed (and will only
          work) if you have a French version of NT TSE.

   -E     Disable encryption from client to server.   This  sends  an  en‐
          crypted  login  packet, but everything after this is unencrypted
          (including interactive logins).

   -m     Do not send mouse motion events.  This saves bandwidth, although
          some Windows applications may rely on receiving mouse motion.

   -C     Use  private colourmap.  This will improve colour accuracy on an
          8-bit display, but rdesktop will appear in false colour when not
          focused.

   -D     Hide window manager decorations, by using MWM hints.

   -K     Do  not override window manager key bindings.  By default rdesk‐
          top attempts to grab all keyboard input when it is in focus.

   -S <button size>
          Enable single application mode. This option  can  be  used  when
          running a single, maximized application (via -s). When the mini‐
          mize button of the windows application is pressed, the  rdesktop
          window is minimized instead of the remote application. The maxi‐
          mize/restore button is disabled. For  this  to  work,  you  must
          specify  the  correct  button  size, in pixels. The special word
          "standard" means 18 pixels.

   -T <title>
          Sets the window title. The title  must  be  specified  using  an
          UTF-8 string.

   -N     Enable numlock syncronization between the Xserver and the remote
          RDP session.  This is useful with applications that looks at the
          numlock  state, but might cause problems with some Xservers like
          Xvnc.

   -X <windowid>
          Embed rdesktop-window in another window.  The  windowid  is  ex‐
          pected to be decimal or hexadecimal (prefixed by 0x).

   -a <bpp>
          Sets  the colour depth for the connection (8, 15, 16, 24 or 32).
          More than 8 bpp are only supported when connecting to Windows XP
          (up to 16 bpp) or newer.  Note that the colour depth may also be
          limited by the server configuration. The default  value  is  the
          depth of the root window.

   -z     Enable compression of the RDP datastream.

   -x <experience>
          Changes default bandwidth performance behaviour for RDP5. By de‐
          fault only theming is enabled, and all other  options  are  dis‐
          abled  (corresponding to modem (56 Kbps)). Setting experience to
          b[roadband] enables menu animations and  full  window  dragging.
          Setting experience to l[an] will also enable the desktop wallpa‐
          per. Setting  experience  to  m[odem]  disables  all  (including
          themes).  Experience can also be a hexidecimal number containing
          the flags.

   -P     Enable caching of bitmaps to disk (persistent  bitmap  caching).
          This generally improves performance (especially on low bandwidth
          connections) and reduces network traffic at the cost of slightly
          longer  startup  and  some  disk space.  (10MB for 8-bit colour,
          20MB for 15/16-bit colour, 30MB for 24-bit colour and  40MB  for
          32-bit colour sessions)

   -r <device>
          Enable  redirection  of the specified device on the client, such
          that it appears on the server. Note that  the  allowed  redirec‐
          tions may be restricted by the server configuration.

          Following devices are currently supported:

   -r comport:<comport>=<device>,...
          Redirects serial devices on your client to the server. Note that
          if you need to change any settings on the serial  device(s),  do
          so  with  an  appropriate tool before starting rdesktop. In most
          OSes you would use  stty.  Bidirectional/Read  support  requires
          Windows XP or newer.  In Windows 2000 it will create a port, but
          it's not seamless, most shell programs will not work with it.

   -r disk:<sharename>=<path>,...
          Redirects a path to  the  share  \\tsclient\<sharename>  on  the
          server (requires Windows XP or newer). The share name is limited
          to 8 characters.

   -r lptport:<lptport>=<device>,...
          Redirects parallel devices on your client to the server.   Bidi‐
          rectional/Read  support requires Windows XP or newer. In Windows
          2000 it will create a port, but it's not  seamless,  most  shell
          programs will not work with it.

   -r printer:<printername>[=<driver>],...
          Redirects  a  printer  queue  on  the  client to the server. The
          <printername> is the name of the queue  in  your  local  system.
          <driver>  defaults to a simple PS-driver unless you specify one.
          Keep in mind that you need a 100% match in the  server  environ‐
          ment,  or the driver will fail. The first printer on the command
          line will be set as your default printer.

   -r sound:[local|off|remote]
          Redirects sound generated on the server to the client.  "remote"
          only  has any effect when you connect to the console with the -0
          option. (Requires Windows XP or newer).

   -r lspci
          Activates the lspci channel, which allows the server to  enumer‐
          ate  the  clients PCI devices. See the file lspci-channel.txt in
          the documentation for more information.

   -r scard[:<Scard Name>=<Alias Name>[;<Vendor Name>][,...]]
          Enables redirection of one or more smart-cards. You can  provide
          static  name  binding  between linux and windows. To do this you
          can use optional parameters as described: <Scard Name> -  device
          name  in Linux/Unix enviroment, <Alias Name> - device name shown
          in Windows enviroment <Vendor Name>  -  optional  device  vendor
          name. For list of examples run rdesktop without parameters.

   -r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]
          Enable  clipboard  redirection. 'PRIMARYCLIPBOARD' looks at both
          PRIMARY and CLIPBOARD when sending data to  server.  'CLIPBOARD'
          looks at only CLIPBOARD.

   -0     Attach  to  the  console  of the server (requires Windows Server
          2003 or newer).

   -4     Use RDP version 4.

   -5     Use RDP version 5 (default).


title: CredSSP Smartcard options
content:
--sc-csp-name <name>
          Specify the CSP (Crypto Service Provider) to use on the  windows
          side  for  the  smartcard  authentication. CSP is the driver for
          your smartcard and it seems like this is required to  be  speci‐
          fied for CredSSP authentication. For swedish NetID the following
          CSP name is used; "Net iD - CSP".

   --sc-container-name <name>
          Specify the container name, usally this is the username for  de‐
          fault  container and it seems like this is required to be speci‐
          fied for CredSSP authentication.

   --sc-reader-name <name>
          Specify the reader name to be used to prevent the pin code being
          sent to wrong card if there are several readers.

   --sc-card-name <name>
          Specify the card name for example; "Telia EID IP5a".


title: EXIT VALUES
content:
0      RDP session terminated normally

   1      Server  initiated  disconnect  (also  returned  for logoff by XP
          joined to a domain)

   2      Server initiated logoff

   3      Server idle timeout reached

   4      Server logon timeout reached

   5      The session was replaced

   6      The server is out of memory

   7      The server denied the connection

   8      The server denied the connection for security reason

   9      The user cannot connect to the server due to insufficient access
          privileges

   10     The  server  does not accept saved user credentials and requires
          that the user enter their credentials for each connection

   11     Disconnect initiated by administration tool

   12     Disconnect initiated by user

   16     Internal licensing error

   17     No license server available

   18     No valid license available

   19     Invalid licensing message

   20     Hardware id doesn't match software license

   21     Client license error

   22     Network error during licensing protocol

   23     Licensing protocol was not completed

   24     Incorrect client license enryption

   25     Can't upgrade license

   26     The server is not licensed to accept remote connections

   62     The local client window was closed

   63     Some other, unknown error occured

   64     Command line usage error

   69     A service or resource (such as memory) is unavailable

   70     An internal software error has been detected

   71     Operating system error

   76     Protocol error or unable to connect to remote host.


title: TLDR
content:
<b>Connect to a remote computer (default port is 3389)</b>`rdesktop -u [username] -p [password] [host:port]`<br><b>Simple Examples</b>`rdesktop -u Administrator -p passwd123 192.168.1.111:3389`<br><b>Connect to a remote computer with full screen (press <Ctrl Alt Enter> to exist)</b>`rdesktop -u [username] -p [password] -f [host:port]`<br><b>Use a custom resolution (use the letter x between the numbers)</b>`rdesktop -u [username] -p [password] -g [1366]x[768] [host:port]`<br><b>Connect to a remote computer using domain user</b>`rdesktop -u [username] -p [password] -d [domainname] [host:port]`<br><b>Use the 16-bit color (speed up)</b>`rdesktop -u [username] -p [password] -a 16 [host:port]`


title: LINKS
content:
Main website of rdesktop
   http://www.rdesktop.org/

                             November 2005                     <B>rdesktop(1)</B>


title: TLDR
content:
<b>Convert an RDF/XML document to Turtle</b>`rapper [[-i|--input]] rdfxml [[-o|--output]] turtle [path/to/file]`<br><b>Count the number of triples in a Turtle file</b>`rapper [[-i|--input]] turtle [[-c|--count]] [path/to/file]`


title: TLDR
content:
<b>Replace from with to in the filenames of the specified files</b>`rename 's/[from]/[to]/' [*.txt]`<br><b>Dry-run - display which changes would occur without performing them</b>`rename -n 's/[from]/[to]/' [*.txt]`<br><b>Change the extension</b>`rename 's/\.[old]$/\.[new]/' [*.txt]`<br><b>Change to lowercase (use -f in case-insensitive filesystems)</b>`rename [[-f|--force]] 'y/A-Z/a-z/' [*.txt]`<br><b>Capitalize first letter of every word in the name</b>`rename [[-f|--force]] 's/\b(\w)/\U$1/g' [*.txt]`<br><b>Replace spaces with underscores</b>`rename 's/\s+/_/g' [*.txt]`


title: TLDR
content:
<b>Increase/decrease the priority of a running [p]rocess</b>`renice -n [3] -p [pid]`<br><b>Increase/decrease the priority of all processes owned by a [u]ser</b>`renice -n [-4] -u [uid|user]`<br><b>Increase/decrease the priority of all processes that belong to a process [g]roup</b>`renice -n [5] -g [process_group]`


title: TLDR
content:
<b>Reinitialize the current terminal</b>`reset`<br><b>Display the terminal type instead</b>`reset -q`


title: TLDR
content:
<b>Store data that you type from the keyboard</b>`read [variable]`<br><b>Store each of the next lines you enter as values of an array</b>`read -a [array]`<br><b>Specify the number of maximum characters to be read</b>`read -n [character_count] [variable]`<br><b>Assign multiple values to multiple variables</b>`read <<< "[The surname is Bond]" [_ variable1 _ variable2]`<br><b>Do not let backslash (\\) act as an escape character</b>`read -r [variable]`<br><b>Display a prompt before the input</b>`read -p "[Enter your input here: ]" [variable]`<br><b>Do not echo typed characters (silent mode)</b>`read -s [variable]`<br><b>Read stdin and perform an action on every line</b>`while read line; do [echo|ls|rm|...] "$line"; done < [/dev/stdin|path/to/file|...]`


title: TLDR
content:
<b>Reboot the system</b>`reboot`<br><b>Power off the system (same as poweroff)</b>`reboot [[-p|--poweroff]]`<br><b>Halt (terminates all processes and shuts down the CPU) the system (same as halt)</b>`reboot --halt`<br><b>Reboot immediately without contacting the system manager</b>`reboot [[-f|--force]]`<br><b>Write the wtmp shutdown entry without rebooting the system</b>`reboot [[-w|--wtmp-only]]`


title: TLDR
content:
<b>Apply settings (according to the actual power source)</b>`sudo tlp start`<br><b>Apply battery settings (ignoring the actual power source)</b>`sudo tlp bat`<br><b>Apply AC settings (ignoring the actual power source)</b>`sudo tlp ac`


title: TLDR
content:
<b>Show version of httpd package</b>`rpm [[-q|--query]] httpd`<br><b>List versions of all matching packages</b>`rpm [[-qa|--query --all]] '[mariadb*]'`<br><b>Forcibly install a package regardless of currently installed versions</b>`rpm [[-U|--upgrade]] [path/to/package.rpm] --force`<br><b>Identify owner of a file and show version of the package</b>`rpm [[-qf|--query --file]] [/etc/postfix/main.cf]`<br><b>List package-owned files</b>`rpm [[-ql|--query --list]] [kernel]`<br><b>Show scriptlets from an RPM file</b>`rpm [[-qp|--query --package]] --scripts [package.rpm]`<br><b>Show changed, missing and/or incorrectly installed files of matching packages</b>`rpm [[-Va|--verify --all]] '[php-*]'`<br><b>Display the changelog of a specific package</b>`rpm [[-q|--query]] --changelog [package]`


title: TLDR
content:
<b>Reverse text typed into terminal</b>`rev`<br><b>Reverse the text string "hello"</b>`echo "hello" | rev`<br><b>Reverse an entire file and print to stdout</b>`rev [path/to/file]`<br><b>Use '\0' as a line separator (zero termination)</b>`rev -0 [path/to/file]`<br><b>Display help</b>`rev -h`<br><b>Display version</b>`rev -V`


title: TLDR
content:
<b>Transfer a file</b>`rsync [path/to/source] [path/to/destination]`<br><b>Use archive mode (recursively copy directories, copy symlinks without resolving, and preserve permissions, ownership and modification times)</b>`rsync [[-a|--archive]] [path/to/source] [path/to/destination]`<br><b>Compress the data as it is sent to the destination, display verbose and human-readable progress, and keep partially transferred files if interrupted</b>`rsync [[-zvhP|--compress --verbose --human-readable --partial --progress]] [path/to/source] [path/to/destination]`<br><b>Recursively copy directories</b>`rsync [[-r|--recursive]] [path/to/source] [path/to/destination]`<br><b>Transfer directory contents, but not the directory itself</b>`rsync [[-r|--recursive]] [path/to/source]/ [path/to/destination]`<br><b>Use archive mode, resolve symlinks, and skip files that are newer on the destination</b>`rsync [[-auL|--archive --update --copy-links]] [path/to/source] [path/to/destination]`<br><b>Transfer a directory from a remote host running rsyncd and delete files on the destination that do not exist on the source</b>`rsync [[-r|--recursive]] --delete rsync://[host]:[path/to/source] [path/to/destination]`<br><b>Transfer a file over SSH using a different port than the default (22) and show global progress</b>`rsync [[-e|--rsh]] 'ssh -p [port]' --info=progress2 [host]:[path/to/source] [path/to/destination]`


title: TLDR
content:
<b>Execute a Ruby script</b>`ruby [path/to/script.rb]`<br><b>Execute a single Ruby command in the command-line</b>`ruby -e "[command]"`<br><b>Check for syntax errors on a given Ruby script</b>`ruby -c [path/to/script.rb]`<br><b>Start the built-in HTTP server on port 8080 in the current directory</b>`ruby -run -e httpd`<br><b>Locally execute a Ruby binary without installing the required library it depends on</b>`ruby -I [path/to/library_folder] -r [library_require_name] [path/to/bin_folder/bin_name]`<br><b>Display version</b>`ruby [[-v|--version]]`


title: TLDR
content:
<b>List devices</b>`rfkill`<br><b>Filter by columns</b>`rfkill [[-o|--output]] [ID,TYPE,DEVICE,...]`<br><b>Block devices by type</b>`rfkill block [bluetooth|wifi|gps|nfc|...]`<br><b>Unblock devices by type</b>`rfkill unblock [bluetooth|wifi|gps|nfc|...]`<br><b>Output in JSON format</b>`rfkill [[-J|--json]]`


title: TLDR
content:
<b>Invoke individual actions/programs on run-mailcap</b>`run-mailcap --action=[view|cat|compose|composetyped|edit|print] [path/to/file]`<br><b>Turn on extra information</b>`run-mailcap --action=[action] --debug [path/to/file]`<br><b>Ignore any "copiousoutput" directive and forward output to stdout</b>`run-mailcap --action=[action] --nopager [path/to/file]`<br><b>Display the found command without actually executing it</b>`run-mailcap --action=[action] --norun [path/to/file]`


title: TLDR
content:
<b>Report I/O and transfer rate issued to physical devices, one per second (press <Ctrl c> to quit)</b>`sar -b [1]`<br><b>Report a total of 10 network device statistics, one per 2 seconds</b>`sar -n DEV [2] [10]`<br><b>Report CPU utilization, one per 2 seconds</b>`sar -u ALL [2]`<br><b>Report a total of 20 memory utilization statistics, one per second</b>`sar -r ALL [1] [20]`<br><b>Report the run queue length and load averages, one per second</b>`sar -q [1]`<br><b>Report paging statistics, one per 5 seconds</b>`sar -B [5]`


title: TLDR
content:
<b>Show full table of all RPC services registered on localhost</b>`rpcinfo`<br><b>Show concise table of all RPC services registered on localhost</b>`rpcinfo -s [localhost]`<br><b>Display table of statistics of rpcbind operations on localhost</b>`rpcinfo -m`<br><b>Display list of entries of given service name (mountd) and version number (2) on a remote nfs share</b>`rpcinfo -l [remote_nfs_server_ip] [mountd] [2]`<br><b>Delete the registration for version 1 of the mountd service for all transports</b>`rpcinfo -d [mountd] [1]`


title: TLDR
content:
<b>Copy a local file to a remote host</b>`scp [path/to/local_file] [remote_host]:[path/to/remote_file]`<br><b>Use a specific port when connecting to the remote host</b>`scp -P [port] [path/to/local_file] [remote_host]:[path/to/remote_file]`<br><b>Copy a file from a remote host to a local directory</b>`scp [remote_host]:[path/to/remote_file] [path/to/local_directory]`<br><b>Recursively copy the contents of a directory from a remote host to a local directory</b>`scp -r [remote_host]:[path/to/remote_directory] [path/to/local_directory]`<br><b>Copy a file between two remote hosts transferring through the local host</b>`scp -3 [host1]:[path/to/remote_file] [host2]:[path/to/remote_directory]`<br><b>Use a specific username when connecting to the remote host</b>`scp [path/to/local_file] [remote_username]@[remote_host]:[path/to/remote_directory]`<br><b>Use a specific SSH private key for authentication with the remote host</b>`scp -i [~/.ssh/private_key] [path/to/local_file] [remote_host]:[path/to/remote_file]`<br><b>Use a specific proxy when connecting to the remote host</b>`scp -J [proxy_username]@[proxy_host] [path/to/local_file] [remote_host]:[path/to/remote_file]`


title: TLDR
content:
<b>Show whether an alarm is set or not</b>`sudo rtcwake [[-m|--mode]] show [[-v|--verbose]]`<br><b>Suspend to RAM and wakeup after 10 seconds</b>`sudo rtcwake [[-m|--mode]] mem [[-s|--seconds]] [10]`<br><b>Suspend to disk (higher power saving) and wakeup 15 minutes later</b>`sudo rtcwake [[-m|--mode]] disk --date +[15]min`<br><b>Freeze the system (more efficient than suspend-to-RAM but version 3.9 or newer of the Linux kernel is required) and wakeup at a given date and time</b>`sudo rtcwake [[-m|--mode]] freeze --date [YYYYMMDDhhmm]`<br><b>Disable a previously set alarm</b>`sudo rtcwake [[-m|--mode]] disable`<br><b>Perform a dry run to wakeup the computer at a given time. (Press <Ctrl c> to abort)</b>`sudo rtcwake [[-m|--mode]] on --date [hh:ss]`


title: TLDR
content:
<b>Sequence from 1 to 10</b>`seq 10`<br><b>Every 3rd number from 5 to 20</b>`seq 5 3 20`<br><b>Separate the output with a space instead of a newline</b>`seq [[-s|--separator]] " " 5 3 20`<br><b>Format output width to a minimum of 4 digits padding with zeros as necessary</b>`seq [[-f|--format]] "%04g" 5 3 20`


title: TLDR
content:
<b>Return all nodes (tags) named "foo"</b>`xmllint --xpath "//[foo]" [source_file.xml]`<br><b>Return the contents of the first node named "foo" as a string</b>`xmllint --xpath "string(//[foo])" [source_file.xml]`<br><b>Return the href attribute of the second anchor element in an HTML file</b>`xmllint --html --xpath "string(//a[2]/@href)" webpage.xhtml`<br><b>Return human-readable (indented) XML from file</b>`xmllint --format [source_file.xml]`<br><b>Check that an XML file meets the requirements of its DOCTYPE declaration</b>`xmllint --valid [source_file.xml]`<br><b>Validate XML against DTD schema hosted online</b>`xmllint --dtdvalid [URL] [source_file.xml]`


title: TLDR
content:
<b>Record a new session to a file named typescript in the current directory</b>`script`<br><b>Stop recording</b>`exit`<br><b>Record a new session to a custom filepath</b>`script [path/to/session.out]`<br><b>Append to an existing file</b>`script [[-a|--append]] [logfile.log]`<br><b>Record timing information (data is outputted to stderr)</b>`script [[-t|--timing]] 2> [path/to/timing_file]`<br><b>Write out data as soon as it happens</b>`script [[-f|--flush]] [path/to/file]`<br><b>Execute quietly without start and done messages</b>`script [[-q|--quiet]] [logfile.log]`


title: TLDR
content:
<b>Replay a typescript at the speed it was recorded</b>`scriptreplay [path/to/timing_file] [path/to/typescript]`<br><b>Replay a typescript at double the original speed</b>`scriptreplay [path/to/timingfile] [path/to/typescript] 2`<br><b>Replay a typescript at half the original speed</b>`scriptreplay [path/to/timingfile] [path/to/typescript] 0.5`


title: TLDR
content:
<b>See action can be used to view any file (usually image) on default mailcap explorer</b>`see [filename]`<br><b>Using with run-mailcap</b>`run-mailcap --action=view [filename]`


title: TLDR
content:
<b>Calculate the SHA224 checksum for one or more files</b>`sha224sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of SHA224 checksums to a file</b>`sha224sum [path/to/file1 path/to/file2 ...] > [path/to/file.sha224]`<br><b>Calculate a SHA224 checksum from stdin</b>`[command] | sha224sum`<br><b>Read a file of SHA224 checksums and filenames and verify all files have matching checksums</b>`sha224sum [[-c|--check]] [path/to/file.sha224]`<br><b>Only show a message for missing files or when verification fails</b>`sha224sum [[-c|--check]] --quiet [path/to/file.sha224]`<br><b>Only show a message when verification fails, ignoring missing files</b>`sha224sum --ignore-missing [[-c|--check]] --quiet [path/to/file.sha224]`<br><b>Check a known SHA224 checksum of a file</b>`echo [known_sha224_checksum_of_the_file] [path/to/file] | sha224sum [[-c|--check]]`


title: TLDR
content:
<b>Open a file in the default editor</b>`sensible-editor [path/to/file]`<br><b>Open a file in the default editor, with the cursor at the end of the file</b>`sensible-editor + [path/to/file]`<br><b>Open a file in the default editor, with the cursor at the beginning of line 10</b>`sensible-editor +10 [path/to/file]`<br><b>Open 3 files in vertically split editor windows at the same time</b>`sensible-editor -O3 [path/to/file1 path/to/file2 path/to/file3]`


title: TLDR
content:
<b>Send a message with the content of message.txt to the mail directory of local user username</b>`sendmail < [message.txt] [username]`<br><b>Send an email from sender@example.com (assuming the mail server is configured for this) to receiver@example.com containing the message in message.txt</b>`sendmail < message.txt -f sender@example.com receiver@example.com`<br><b>Send an email from sender@example.com (assuming the mail server is configured for this) to receiver@example.com containing the file file.zip</b>`sendmail < file.zip -f sender@example.com receiver@example.com`


title: TLDR
content:
<b>Replace all apple (basic regex) occurrences with mango (basic regex) in all input lines and print the result to stdout</b>`[command] | sed 's/apple/mango/g'`<br><b>Execute a specific script [f]ile and print the result to stdout</b>`[command] | sed -f [path/to/script.sed]`<br><b>Print just a first line to stdout</b>`[command] | sed -n '1p'`


title: TLDR
content:
<b>List all the available Wacom devices. The device name is in the first column</b>`xsetwacom list`<br><b>Set Wacom area to specific screen. Get name of the screen with xrandr</b>`xsetwacom set "[device_name]" MapToOutput [screen]`<br><b>Set mode to relative (like a mouse) or absolute (like a pen) mode</b>`xsetwacom set "[device_name]" Mode "[Relative|Absolute]"`<br><b>Rotate the input (useful for tablet-PC when rotating screen) by 0|90|180|270 degrees from "natural" rotation</b>`xsetwacom set "[device_name]" Rotate [none|half|cw|ccw]`<br><b>Set button to only work when the tip of the pen is touching the tablet</b>`xsetwacom set "[device_name]" TabletPCButton "on"`


title: TLDR
content:
<b>Generate a hexdump from a binary file and display the output</b>`xxd [input_file]`<br><b>Generate a hexdump from a binary file and save it as a text file</b>`xxd [input_file] [output_file]`<br><b>Display a more compact output, replacing consecutive zeros (if any) with a star</b>`xxd [[-a|-autoskip]] [input_file]`<br><b>Display the output with 10 columns of one octet (byte) each</b>`xxd [[-c|-cols]] [10] [input_file]`<br><b>Display output only up to a length of 32 bytes</b>`xxd [[-l|-len]] [32] [input_file]`<br><b>Display the output in plain mode, without any gaps between the columns</b>`xxd [[-p|-postscript]] [input_file]`<br><b>Revert a plaintext hexdump back into binary, and save it as a binary file</b>`xxd [[-r|-revert]] [[-p|-postscript]] [input_file] [output_file]`


title: TLDR
content:
<b>Display the names and values of shell variables</b>`set`<br><b>Export newly initialized variables to child processes</b>`set -a`<br><b>Write formatted messages to stderr when jobs finish</b>`set -b`<br><b>Write and edit text in the command-line with vi-like keybindings (e.g. yy)</b>`set -o [vi]`<br><b>Return to default mode</b>`set -o [emacs]`<br><b>List all modes</b>`set -o`<br><b>Exit the shell when (some) command fails</b>`set -e`<br><b>Reset all shell parameters and assign new ones</b>`set -- [argument1 argument2 ...]`


title: TLDR
content:
<b>Start an interactive Lua shell</b>`lua`<br><b>Execute a Lua script</b>`lua [path/to/script.lua] [--optional-argument]`<br><b>Execute a Lua expression</b>`lua -e '[print("Hello World")]'`


title: TLDR
content:
<b>List all the files included in an ISO image</b>`isoinfo -f -i [path/to/image.iso]`<br><b>E[x]tract a specific file from an ISO image and send it out stdout</b>`isoinfo -i [path/to/image.iso] -x [/PATH/TO/FILE/INSIDE/ISO.EXT]`<br><b>Show header information for an ISO disk image</b>`isoinfo -d -i [path/to/image.iso]`


title: TLDR
content:
<b>Open a new window of the default browser</b>`sensible-browser`<br><b>Open a URL in the default browser</b>`sensible-browser [url]`


title: TLDR
content:
<b>Modify ACL of a file for user with read and write access</b>`setfacl [[-m|--modify]] u:[username]:rw [path/to/file_or_directory]`<br><b>Modify default ACL of a file for all users</b>`setfacl [[-d|--default]] [[-m|--modify]] u::rw [path/to/file_or_directory]`<br><b>Remove ACL of a file for a user</b>`setfacl [[-x|--remove]] u:[username] [path/to/file_or_directory]`<br><b>Remove all ACL entries of a file</b>`setfacl [[-b|--remove-all]] [path/to/file_or_directory]`


title: TLDR
content:
<b>Remove specific files</b>`rm [path/to/file1 path/to/file2 ...]`<br><b>Remove specific files ignoring nonexistent ones</b>`rm [[-f|--force]] [path/to/file1 path/to/file2 ...]`<br><b>Remove specific files interactively prompting before each removal</b>`rm [[-i|--interactive]] [path/to/file1 path/to/file2 ...]`<br><b>Remove specific files printing info about each removal</b>`rm [[-v|--verbose]] [path/to/file1 path/to/file2 ...]`<br><b>Remove specific files and directories recursively</b>`rm [[-r|--recursive]] [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>Remove empty directories (this is considered the safe method)</b>`rm [[-d|--dir]] [path/to/directory]`


title: TLDR
content:
<b>Connect to a remote server and enter an interactive command mode</b>`sftp [remote_user]@[remote_host]`<br><b>Connect using an alternate port</b>`sftp -P [remote_port] [remote_user]@[remote_host]`<br><b>Connect using a predefined host (in ~/.ssh/config)</b>`sftp [host]`<br><b>Transfer remote file to the local system</b>`get [path/to/remote_file]`<br><b>Transfer local file to the remote system</b>`put [path/to/local_file]`<br><b>Transfer remote directory to the local system recursively (works with put too)</b>`get -R [path/to/remote_directory]`<br><b>Get list of files on local machine</b>`lls`<br><b>Get list of files on remote machine</b>`ls`


title: TLDR
content:
<b>Compress a file using xz</b>`xz [path/to/file]`<br><b>Decompress an XZ file</b>`xz [[-d|--decompress]] [path/to/file.xz]`<br><b>Compress a file using lzma</b>`xz [[-F|--format]] lzma [path/to/file]`<br><b>Decompress an LZMA file</b>`xz [[-d|--decompress]] [[-F|--format]] lzma [path/to/file.lzma]`<br><b>Decompress a file and write to stdout (implies --keep)</b>`xz [[-d|--decompress]] [[-c|--stdout]] [path/to/file.xz]`<br><b>Compress a file, but don't delete the original</b>`xz [[-k|--keep]] [path/to/file]`<br><b>Compress a file using the fastest compression</b>`xz -0 [path/to/file]`<br><b>Compress a file using the best compression</b>`xz -9 [path/to/file]`


title: TLDR
content:
<b>Calculate the SHA1 checksum for one or more files</b>`sha1sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of SHA1 checksums to a file</b>`sha1sum [path/to/file1 path/to/file2 ...] > [path/to/file.sha1]`<br><b>Calculate a SHA1 checksum from stdin</b>`[command] | sha1sum`<br><b>Read a file of SHA1 checksums and filenames and verify all files have matching checksums</b>`sha1sum [[-c|--check]] [path/to/file.sha1]`<br><b>Only show a message for missing files or when verification fails</b>`sha1sum [[-c|--check]] --quiet [path/to/file.sha1]`<br><b>Only show a message when verification fails, ignoring missing files</b>`sha1sum --ignore-missing [[-c|--check]] --quiet [path/to/file.sha1]`<br><b>Check a known SHA1 checksum of a file</b>`echo [known_sha1_checksum_of_the_file] [path/to/file] | sha1sum [[-c|--check]]`


title: TLDR
content:
<b>Start an interactive shell session</b>`sh`<br><b>Execute a command and then exit</b>`sh -c "[command]"`<br><b>Execute a script</b>`sh [path/to/script.sh]`<br><b>Read and execute commands from stdin</b>`sh -s`


title: TLDR
content:
<b>Calculate the SHA256 checksum for one or more files</b>`sha256sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of SHA256 checksums to a file</b>`sha256sum [path/to/file1 path/to/file2 ...] > [path/to/file.sha256]`<br><b>Calculate a SHA256 checksum from stdin</b>`[command] | sha256sum`<br><b>Read a file of SHA256 checksums and filenames and verify all files have matching checksums</b>`sha256sum [[-c|--check]] [path/to/file.sha256]`<br><b>Only show a message for missing files or when verification fails</b>`sha256sum [[-c|--check]] --quiet [path/to/file.sha256]`<br><b>Only show a message when verification fails, ignoring missing files</b>`sha256sum --ignore-missing [[-c|--check]] --quiet [path/to/file.sha256]`<br><b>Check a known SHA256 checksum of a file</b>`echo [known_sha256_checksum_of_the_file] [path/to/file] | sha256sum [[-c|--check]]`


title: TLDR
content:
<b>List the name and status of all services</b>`service --status-all`<br><b>Start/Stop/Restart/Reload service (start/stop should always be available)</b>`service [service_name] [start|stop|restart|reload]`<br><b>Do a full restart (runs script twice with start and stop)</b>`service [service_name] --full-restart`<br><b>Show the current status of a service</b>`service [service_name] status`


title: TLDR
content:
<b>Repeatedly output "message"</b>`yes [message]`<br><b>Repeatedly output "y"</b>`yes`<br><b>Accept everything prompted by the apt-get command</b>`yes | sudo apt-get install [program]`<br><b>Repeatedly output a newline to always accept the default option of a prompt</b>`yes ''`


title: TLDR
content:
<b>Print the uncompressed contents of a gzip archive to stdout</b>`zcat [path/to/file.txt.gz]`<br><b>Print compression details of a gzip archive to stdout</b>`zcat [[-l|--list]] [path/to/file.txt.gz]`<br><b>Test the integrity of a compressed file verbosely</b>`zcat [[-v|--verbose]] [[-t|--test]] [path/to/file.txt.gz]`<br><b>Suppress all warnings when decompressing a file</b>`zcat [[-q|--quiet]] [path/to/file.txt.gz]`<br><b>Avoid any system crashes when decompressing a file (slower output)</b>`zcat --synchronous [path/to/file.txt.gz]`


title: TLDR
content:
<b>Calculate the SHA1 checksum for one or more files</b>`shasum [path/to/file1 path/to/file2 ...]`<br><b>Calculate the SHA checksum for one or more files with the specified algorithm</b>`shasum --algorithm [1|224|256|384|512|512224|512256] [path/to/file1 path/to/file2 ...]`<br><b>Calculate a SHA1 checksum from stdin</b>`[command] | shasum`<br><b>Calculate and save the list of SHA256 checksums to a file</b>`shasum --algorithm 256 [path/to/file1 path/to/file2 ...] > [path/to/file.sha256]`<br><b>Read a file of SHA checksums and filenames and verify all files have matching checksums (the algorithm will be automatically detected)</b>`shasum [[-c|--check]] [path/to/file]`<br><b>Only show a message for missing files or when verification fails</b>`shasum [[-c|--check]] --quiet [path/to/file]`<br><b>Only show a message when verification fails, ignoring missing files</b>`shasum --ignore-missing [[-c|--check]] --quiet [path/to/file]`<br><b>Check a known SHA checksum of a file</b>`echo [known_sha_checksum_of_the_file] [path/to/file] | shasum [[-c|--check]]`


title: TLDR
content:
<b>Overwrite a file</b>`shred [path/to/file]`<br><b>Overwrite a file and show progress on the screen</b>`shred [[-v|--verbose]] [path/to/file]`<br><b>Overwrite a file, leaving zeros instead of random data</b>`shred [[-z|--zero]] [path/to/file]`<br><b>Overwrite a file a specific number of times</b>`shred [[-n|--iterations]] [25] [path/to/file]`<br><b>Overwrite a file and remove it</b>`shred [[-u|--remove]] [path/to/file]`<br><b>Overwrite a file 100 times, add a final overwrite with zeros, remove the file after overwriting it and show verbose progress on the screen</b>`shred [[-vzun|--verbose --zero --remove --iterations]] 100 [path/to/file]`


title: TLDR
content:
<b>Calculate the SHA512 checksum for one or more files</b>`sha512sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of SHA512 checksums to a file</b>`sha512sum [path/to/file1 path/to/file2 ...] > [path/to/file.sha512]`<br><b>Calculate a SHA512 checksum from stdin</b>`[command] | sha512sum`<br><b>Read a file of SHA512 checksums and filenames and verify all files have matching checksums</b>`sha512sum [[-c|--check]] [path/to/file.sha512]`<br><b>Only show a message for missing files or when verification fails</b>`sha512sum [[-c|--check]] --quiet [path/to/file.sha512]`<br><b>Only show a message when verification fails, ignoring missing files</b>`sha512sum --ignore-missing [[-c|--check]] --quiet [path/to/file.sha512]`<br><b>Check a known SHA512 checksum of a file</b>`echo [known_sha512_checksum_of_the_file] [path/to/file] | sha512sum [[-c|--check]]`


title: TLDR
content:
<b>Randomize the order of lines in a file and output the result</b>`shuf [path/to/file]`<br><b>Only output the first 5 entries of the result</b>`shuf [[-n|--head-count]] 5 [path/to/file]`<br><b>Write the output to another file</b>`shuf [path/to/input_file] [[-o|--output]] [path/to/output_file]`<br><b>Generate 3 random numbers in the range 1-10 (inclusive)</b>`shuf [[-n|--head-count]] 3 [[-i|--input-range]] 1-10 [[-r|--repeat]]`


title: TLDR
content:
<b>Retrieve all public SSH keys of a remote host</b>`ssh-keyscan [hostname]`<br><b>Retrieve all public SSH keys of a remote host listening on a specific port</b>`ssh-keyscan -p [port] [hostname]`<br><b>Retrieve certain types of public SSH keys of a remote host</b>`ssh-keyscan -t [rsa,dsa,ecdsa,ed25519] [hostname]`<br><b>Manually update the SSH known_hosts file with the fingerprint of a given host</b>`ssh-keyscan -H [hostname] >> ~/.ssh/known_hosts`


title: TLDR
content:
<b>Generate a key interactively</b>`ssh-keygen`<br><b>Generate an ed25519 key with 32 key derivation function rounds and save the key to a specific file</b>`ssh-keygen -t [ed25519] -a [32] -f [~/.ssh/filename]`<br><b>Generate an RSA 4096-bit key with email as a comment</b>`ssh-keygen -t [rsa] -b [4096] -C "[comment|email]"`<br><b>Remove the keys of a host from the known_hosts file (useful when a known host has a new key)</b>`ssh-keygen -R [remote_host]`<br><b>Retrieve the fingerprint of a key in MD5 Hex</b>`ssh-keygen -l -E [md5] -f [~/.ssh/filename]`<br><b>Change the password of a key</b>`ssh-keygen -p -f [~/.ssh/filename]`<br><b>Change the type of the key format (for example from OPENSSH format to PEM), the file will be rewritten in-place</b>`ssh-keygen -p -N "" -m [PEM] -f [~/.ssh/OpenSSH_private_key]`<br><b>Retrieve public key from secret key</b>`ssh-keygen -y -f [~/.ssh/OpenSSH_private_key]`


title: TLDR
content:
<b>Connect to a share (user will be prompted for password; exit to quit the session)</b>`smbclient [//server/share]`<br><b>Connect with a different username</b>`smbclient [//server/share] --user [username]`<br><b>Connect with a different workgroup</b>`smbclient [//server/share] --workgroup [domain] --user [username]`<br><b>Connect with a username and password</b>`smbclient [//server/share] --user [username%password]`<br><b>Download a file from the server</b>`smbclient [//server/share] --directory [path/to/directory] --command "get [file.txt]"`<br><b>Upload a file to the server</b>`smbclient [//server/share] --directory [path/to/directory] --command "put [file.txt]"`<br><b>List the shares from a server anonymously</b>`smbclient --list=[server] --no-pass`


title: TLDR
content:
<b>Sort a file in ascending order</b>`sort [path/to/file]`<br><b>Sort a file in descending order</b>`sort [[-r|--reverse]] [path/to/file]`<br><b>Sort a file in case-insensitive way</b>`sort [[-f|--ignore-case]] [path/to/file]`<br><b>Sort a file using numeric rather than alphabetic order</b>`sort [[-n|--numeric-sort]] [path/to/file]`<br><b>Sort /etc/passwd by the 3rd field of each line numerically, using ":" as a field separator</b>`sort [[-t|--field-separator]] [:] [[-k|--key]] [3n] [/etc/passwd]`<br><b>As above, but when items in the 3rd field are equal, sort by the 4th field by numbers with exponents</b>`sort [[-t|--field-separator]] [:] [[-k|--key]] [3,3n] [[-k|--key]] [4,4g] [/etc/passwd]`<br><b>Sort a file preserving only unique lines</b>`sort [[-u|--unique]] [path/to/file]`<br><b>Sort a file, printing the output to the specified output file (can be used to sort a file in-place)</b>`sort [[-o|--output]] [path/to/file] [path/to/file]`


title: TLDR
content:
<b>Listen to a port, wait for an incoming connection and transfer data to STDIO</b>`sudo socat - TCP-LISTEN:8080,fork`<br><b>Listen on a port using SSL and print to stdout</b>`sudo socat OPENSSL-LISTEN:4433,reuseaddr,cert=./cert.pem,cafile=./ca.cert.pem,key=./key.pem,verify=0 STDOUT`<br><b>Create a connection to a host and port, transfer data in STDIO to connected host</b>`sudo socat - TCP4:www.example.com:80`<br><b>Forward incoming data of a local port to another host and port</b>`sudo socat TCP-LISTEN:80,fork TCP4:www.example.com:80`<br><b>Send data with multicast routing scheme</b>`[echo "Hello Multicast"] | socat - UDP4-DATAGRAM:[224.0.0.1]:[5000]`<br><b>Receive data from a multicast</b>`socat - UDP4-RECVFROM:[5000]`


title: TLDR
content:
<b>Calculate the SHA384 checksum for one or more files</b>`sha384sum [path/to/file1 path/to/file2 ...]`<br><b>Calculate and save the list of SHA384 checksums to a file</b>`sha384sum [path/to/file1 path/to/file2 ...] > [path/to/file.sha384]`<br><b>Calculate a SHA384 checksum from stdin</b>`[command] | sha384sum`<br><b>Read a file of SHA384 checksums and filenames and verify all files have matching checksums</b>`sha384sum [[-c|--check]] [path/to/file.sha384]`<br><b>Only show a message for missing files or when verification fails</b>`sha384sum [[-c|--check]] --quiet [path/to/file.sha384]`<br><b>Only show a message when verification fails, ignoring missing files</b>`sha384sum --ignore-missing [[-c|--check]] --quiet [path/to/file.sha384]`<br><b>Check a known SHA384 checksum of a file</b>`echo [known_sha384_checksum_of_the_file] [path/to/file] | sha384sum [[-c|--check]]`


title: TLDR
content:
<b>Split a file, each split having 10 lines (except the last split)</b>`split [[-l|--lines]] 10 [path/to/file]`<br><b>Split a file into 5 files. File is split such that each split has same size (except the last split)</b>`split [[-n|--number]] 5 [path/to/file]`<br><b>Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes)</b>`split [[-b|--bytes]] 512 [path/to/file]`<br><b>Split a file with at most 512 bytes in each split without breaking lines</b>`split [[-C|--line-bytes]] 512 [path/to/file]`<br><b>Split into multiple files from stdin</b>`gzip [[-cd|--stdout --decompress]] [path/to/compressed_file.gz] | split [[-l|--lines]] [1000] - [path/to/output]`


title: TLDR
content:
<b>Run sqlmap against a single target URL</b>`python sqlmap.py [[-u|--url]] "[http://www.example.com/vuln.php?id=1]"`<br><b>Send data in a POST request (--data implies POST request)</b>`python sqlmap.py [[-u|--url]] "[http://www.example.com/vuln.php]" --data="[id=1]"`<br><b>Change the parameter delimiter (& is the default)</b>`python sqlmap.py [[-u|--url]] "[http://www.example.com/vuln.php]" --data="[query=foobar;id=1]" --param-del="[;]"`<br><b>Select a random User-Agent from ./txt/user-agents.txt and use it</b>`python sqlmap.py [[-u|--url]] "[http://www.example.com/vuln.php]" --random-agent`<br><b>Provide user credentials for HTTP protocol authentication</b>`python sqlmap.py [[-u|--url]] "[http://www.example.com/vuln.php]" --auth-type [Basic] --auth-cred "[testuser:testpass]"`


title: TLDR
content:
<b>Start an interactive shell with a new database</b>`sqlite3`<br><b>Open an interactive shell against an existing database</b>`sqlite3 [path/to/database.sqlite3]`<br><b>Execute an SQL statement against a database and then exit</b>`sqlite3 [path/to/database.sqlite3] '[SELECT * FROM some_table;]'`


title: TLDR
content:
<b>Show all TCP/UDP/RAW/UNIX sockets</b>`ss [[-a|--all]] [-t|-u|-w|-x]`<br><b>Filter TCP sockets by states, only/exclude</b>`ss [state|exclude] [bucket|big|connected|synchronized|...]`<br><b>Show all TCP sockets connected to the local HTTPS port (443)</b>`ss [[-t|--tcp]] src :[443]`<br><b>Show all TCP sockets listening on the local 8080 port</b>`ss [[-lt|--listening --tcp]] src :[8080]`<br><b>Show all TCP sockets along with processes connected to a remote SSH port</b>`ss [[-pt|--processes --tcp]] dst :[ssh]`<br><b>Show all UDP sockets connected on specific source and destination ports</b>`ss [[-u|--udp]] 'sport == :[source_port] and dport == :[destination_port]'`<br><b>Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16</b>`ss [[-4t|--ipv4 --tcp]] src [192.168/16]`<br><b>Kill IPv4 or IPv6 Socket Connection with a specific destination IP and port</b>`ss [[-K|--kill]] dst [ip_address] dport = [port]`


title: TLDR
content:
<b>Remove specific directories</b>`rmdir [path/to/directory1 path/to/directory2 ...]`<br><b>Remove specific nested directories recursively</b>`rmdir [[-p|--parents]] [path/to/directory1 path/to/directory2 ...]`<br><b>Clean a directory of empty directories</b>`rmdir *`


title: TLDR
content:
<b>Display properties about a specific file such as size, permissions, creation and access dates among others</b>`stat [path/to/file]`<br><b>Display properties about a specific file, only showing the raw result data without labels</b>`stat [[-t|--terse]] [path/to/file]`<br><b>Display information about the filesystem where a specific file is located</b>`stat [[-f|--file-system]] [path/to/file]`<br><b>Show only octal file permissions</b>`stat [[-c|--format]] "%a %n" [path/to/file]`<br><b>Show the owner and group of a specific file</b>`stat [[-c|--format]] "%U %G" [path/to/file]`<br><b>Show the size of a specific file in bytes</b>`stat [[-c|--format]] "%s %n" [path/to/file]`


title: TLDR
content:
<b>Display SMART health summary</b>`sudo smartctl [[-H|--health]] [/dev/sdX]`<br><b>Display device information</b>`sudo smartctl [[-i|--info]] [/dev/sdX]`<br><b>Start a short/long self-test in the background</b>`sudo smartctl [[-t|--test]] [short|long] [/dev/sdX]`<br><b>Display the self-test log</b>`sudo smartctl [[-l|--log]] selftest`<br><b>Display current/last self-test status and other SMART capabilities</b>`sudo smartctl [[-c|--capabilities]] [/dev/sdX]`<br><b>Display exhaustive SMART data</b>`sudo smartctl [[-a|--all]] [/dev/sdX]`


title: TLDR
content:
<b>Archive a directory with tar, then compress</b>`lrztar [path/to/directory]`<br><b>Same as above, with ZPAQ - extreme compression, but very slow</b>`lrztar -z [path/to/directory]`<br><b>Specify the output file</b>`lrztar -o [path/to/file] [path/to/directory]`<br><b>Override the number of processor threads to use</b>`lrztar -p [8] [path/to/directory]`<br><b>Force overwriting of existing files</b>`lrztar -f [path/to/directory]`


title: TLDR
content:
<b>Start tracing a specific process by its PID</b>`sudo strace [[-p|--attach]] [pid]`<br><b>Trace a process and filter output by system call [e]xpression</b>`sudo strace [[-p|--attach]] [pid] -e [system_call,system_call2,...]`<br><b>Count time, calls, and errors for each system call and report a summary on program exit</b>`sudo strace [[-p|--attach]] [pid] [[-c|--summary-only]]`<br><b>Show the time spent in every system call and specify the maximum string size to print</b>`sudo strace [[-p|--attach]] [pid] [[-T|--syscall-times]] [[-s|--string-limit]] [32]`<br><b>Start tracing a program by executing it</b>`strace [program]`<br><b>Start tracing file operations of a program</b>`strace -e trace=file [program]`<br><b>Start tracing network operations of a program as well as all its forked and child processes, saving the output to a file</b>`strace [[-f|--follow-forks]] -e trace=network [[-o|--output]] [trace.txt] [program]`


title: TLDR
content:
<b>Change stdin buffer size to 512 KiB</b>`stdbuf [[-i|--input]] 512K [command]`<br><b>Change stdout buffer to line-buffered</b>`stdbuf [[-o|--output]] L [command]`<br><b>Change stderr buffer to unbuffered</b>`stdbuf [[-e|--error]] 0 [command]`


title: TLDR
content:
<b>Copy your keys to the remote machine</b>`ssh-copy-id [username]@[remote_host]`<br><b>Copy the given public key to the remote</b>`ssh-copy-id -i [path/to/certificate] [username]@[remote_host]`<br><b>Copy the given public key to the remote with specific port</b>`ssh-copy-id -i [path/to/certificate] -p [port] [username]@[remote_host]`


title: TLDR
content:
<b>Add the default SSH keys in ~/.ssh to the ssh-agent</b>`ssh-add`<br><b>Add a specific key to the ssh-agent</b>`ssh-add [path/to/private_key]`<br><b>List fingerprints of currently loaded keys</b>`ssh-add -l`<br><b>Delete a key from the ssh-agent</b>`ssh-add -d [path/to/private_key]`<br><b>Delete all currently loaded keys from the ssh-agent</b>`ssh-add -D`<br><b>Add a key to the ssh-agent and the keychain</b>`ssh-add -K [path/to/private_key]`


title: TLDR
content:
<b>Connect to a remote server</b>`ssh [username]@[remote_host]`<br><b>Connect to a remote server with a specific [i]dentity (private key)</b>`ssh -i [path/to/key_file] [username]@[remote_host]`<br><b>Connect to a remote server with IP 10.0.0.1 and using a specific [p]ort (Note: 10.0.0.1 can be shortened to 10.1)</b>`ssh [username]@10.0.0.1 -p [2222]`<br><b>Run a command on a remote server with a [t]ty allocation allowing interaction with the remote command</b>`ssh [username]@[remote_host] -t [command] [command_arguments]`<br><b>SSH tunneling: [D]ynamic port forwarding (SOCKS proxy on localhost:1080)</b>`ssh -D [1080] [username]@[remote_host]`<br><b>SSH tunneling: Forward a specific port (localhost:9999 to example.org:80) along with disabling pseudo-[T]ty allocation and executio[N] of remote commands</b>`ssh -L [9999]:[example.org]:[80] -N -T [username]@[remote_host]`<br><b>SSH [J]umping: Connect through a jumphost to a remote server (Multiple jump hops may be specified separated by comma characters)</b>`ssh -J [username]@[jump_host] [username]@[remote_host]`<br><b>Close a hanged session</b>`<Enter><~><.>`


title: TLDR
content:
<b>Delay in seconds</b>`sleep [seconds]`<br><b>Execute a specific command after 20 seconds delay</b>`sleep 20 && [command]`


title: TLDR
content:
<b>Set a size of 10 GB to an existing file, or create a new file with the specified size</b>`truncate [[-s|--size]] 10G [path/to/file]`<br><b>Extend the file size by 50 MiB, fill with holes (which reads as zero bytes)</b>`truncate [[-s|--size]] +50M [path/to/file]`<br><b>Shrink the file by 2 GiB, by removing data from the end of file</b>`truncate [[-s|--size]] -2G [path/to/file]`<br><b>Empty the file's content</b>`truncate [[-s|--size]] 0 [path/to/file]`<br><b>Empty the file's content, but do not create the file if it does not exist</b>`truncate [[-cs|--no-create --size]] 0 [path/to/file]`


title: TLDR
content:
<b>Print all strings in a binary</b>`strings [path/to/file]`<br><b>Limit results to strings at least n characters long</b>`strings [[-n|--bytes]] [n] [path/to/file]`<br><b>Prefix each result with its offset within the file</b>`strings [[-t|--radix]] d [path/to/file]`<br><b>Prefix each result with its offset within the file in hexadecimal</b>`strings [[-t|--radix]] x [path/to/file]`


title: TLDR
content:
<b>Compress a file</b>`lz4 [path/to/file]`<br><b>Decompress a file</b>`lz4 [[-d|--decompress]] [file.lz4]`<br><b>Decompress a file and write to stdout</b>`lz4 [[-dc|--decompress --stdout]] [file.lz4]`<br><b>Package and compress a directory and its contents</b>`tar cvf - [path/to/directory] | lz4 - [dir.tar.lz4]`<br><b>Decompress and unpack a directory and its contents</b>`lz4 [[-dc|--decompress --stdout]] [dir.tar.lz4] | tar -xv`<br><b>Compress a file using the best compression</b>`lz4 [[-12|--best]] [path/to/file]`


title: TLDR
content:
<b>Connect to a local database on the default port (mongodb://localhost:27017)</b>`mongo`<br><b>Connect to a database</b>`mongo --host [host] --port [port] [db_name]`<br><b>Authenticate using the specified username on the specified database (you will be prompted for a password)</b>`mongo --host [host] --port [port] --username [username] --authenticationDatabase [authdb_name] [db_name]`<br><b>Evaluate a JavaScript expression on a database</b>`mongo --eval '[JSON.stringify(db.foo.findOne())]' [db_name]`


title: TLDR
content:
<b>Connect to a hypervisor session</b>`virsh connect [qemu:///system]`<br><b>Activate a network named default</b>`sudo virsh net-start [default]`<br><b>List all domains</b>`virsh list --all`<br><b>Create a guest from a configuration file</b>`virsh create [path/to/config_file.xml]`<br><b>Edit a guest's configuration file (editor can be changed with $EDITOR)</b>`virsh edit [guest_id]`<br><b>Start/reboot/shutdown/suspend/resume a guest</b>`virsh [command] [guest_id]`<br><b>Save the current state of a guest to a file</b>`virsh save [guest_id] [filename]`<br><b>Delete a running guest</b>`virsh destroy [guest_id] && virsh undefine [guest_id]`


title: TLDR
content:
<b>Run a command as the superuser</b>`sudo [less /var/log/syslog]`<br><b>Edit a file as the superuser with your default editor</b>`sudo [[-e|--edit]] [/etc/fstab]`<br><b>Run a command as another user and/or group</b>`sudo [[-u|--user]] [user] [[-g|--group]] [group] [id -a]`<br><b>Repeat the last command prefixed with sudo (only in Bash, Zsh, etc.)</b>`sudo !!`<br><b>Launch the default shell with superuser privileges and run login-specific files (.profile, .bash_profile, etc.)</b>`sudo [[-i|--login]]`<br><b>Launch the default shell with superuser privileges without changing the environment</b>`sudo [[-s|--shell]]`<br><b>Launch the default shell as the specified user, loading the user's environment and reading login-specific files (.profile, .bash_profile, etc.)</b>`sudo [[-i|--login]] [[-u|--user]] [user]`<br><b>List the allowed (and forbidden) commands for the invoking user</b>`sudo [[-ll|--list --list]]`


title: TLDR
content:
<b>Display current terminal size</b>`stty size`<br><b>Display all settings for the current terminal</b>`stty [[-a|--all]]`<br><b>Set the number of rows or columns</b>`stty [rows|cols] [count]`<br><b>Get the actual transfer speed of a device</b>`stty [[-F|--file]] [path/to/device_file] speed`<br><b>Reset all modes to reasonable values for the current terminal</b>`stty sane`<br><b>Switch between raw and normal mode</b>`stty [raw|cooked]`<br><b>Turn character echoing off or on</b>`stty [-echo|echo]`<br><b>Display help</b>`stty --help`


title: TLDR
content:
<b>Disable a given swap area</b>`sudo swapoff [path/to/file]`<br><b>Disable all swap areas in /proc/swaps</b>`sudo swapoff [[-a|--all]]`<br><b>Disable a swap partition by its label</b>`sudo swapoff -L [label]`


title: TLDR
content:
<b>Check out a working copy from a repository</b>`svn [[co|checkout]] [file:///path/to/repository]`<br><b>Bring changes from the repository into the working copy</b>`svn [[up|update]]`<br><b>Put files and directories under version control, scheduling them for addition to repository. They will be added in next commit</b>`svn add [PATH]`<br><b>Send changes from your working copy to the repository</b>`svn [[ci|commit]] [[-m|--message]] [commit_log_message] [[PATH]]`<br><b>Display changes from the last 10 revisions, showing modified files for each revision</b>`svn log [[-vl|--verbose --limit]] [10]`<br><b>Display help</b>`svn [[h|help]]`


title: TLDR
content:
<b>Print the last system startup time</b>`systemd-analyze`<br><b>List all running units, ordered by the time they took to initialize</b>`systemd-analyze blame`<br><b>Print a tree of the time-critical chain of units</b>`systemd-analyze critical-chain`<br><b>Create an SVG file showing when each system service started, highlighting the time that they spent on initialization</b>`systemd-analyze plot > [path/to/file.svg]`<br><b>Plot a dependency graph and convert it to an SVG file</b>`systemd-analyze dot | dot -T [svg] > [path/to/file.svg]`<br><b>Show security scores of running units</b>`systemd-analyze security`<br><b>View all udev rules together</b>`systemd-analyze cat-config udev/rules.d`


title: TLDR
content:
<b>Show swap information</b>`swapon`<br><b>Enable a given swap area</b>`sudo swapon [path/to/file]`<br><b>Enable all swap areas specified in /etc/fstab except those with the noauto option</b>`sudo swapon [[-a|--all]]`<br><b>Enable a swap partition by its label</b>`sudo swapon -L [label]`


title: TLDR
content:
<b>Show all running services</b>`systemctl status`<br><b>List failed units</b>`systemctl --failed`<br><b>Start/Stop/Restart/Reload/Show the status a service</b>`systemctl [start|stop|restart|reload|status] [unit]`<br><b>Enable/Disable a unit to be started on bootup</b>`systemctl [enable|disable] [unit]`<br><b>Reload systemd, scan for new or changed units</b>`systemctl daemon-reload`<br><b>Check if a unit is active/enabled/failed</b>`systemctl [is-active|is-enabled|is-failed] [unit]`<br><b>List all service/socket/automount units filtering by running/failed state</b>`systemctl list-units [[-t|--type]] [service|socket|automount] --state [failed|running]`<br><b>Show the contents & absolute path of a unit file or edit it</b>`systemctl [cat|edit] [unit]`


title: TLDR
content:
<b>Switch to superuser (requires the root password)</b>`su`<br><b>Switch to a given user (requires the user's password)</b>`su [username]`<br><b>Switch to a given user and simulate a full login shell</b>`su - [username]`<br><b>Execute a command as another user</b>`su - [username] [[-c|--command]] "[command]"`


title: TLDR
content:
<b>Concatenate specific files in reversed order</b>`tac [path/to/file1 path/to/file2 ...]`<br><b>Display stdin in reversed order</b>`[cat path/to/file] | tac`<br><b>Use a specific separator</b>`tac [[-s|--separator]] [separator] [path/to/file1 path/to/file2 ...]`<br><b>Use a specific regex as a separator</b>`tac [[-r|--regex]] [[-s|--separator]] [separator] [path/to/file1 path/to/file2 ...]`<br><b>Use a separator before each file</b>`tac [[-b|--before]] [path/to/file1 path/to/file2 ...]`


title: TLDR
content:
<b>Start terminator window</b>`terminator`<br><b>Start with a fullscreen window</b>`terminator [[-f|--fullscreen]]`<br><b>Split terminals horizontally</b>`<Ctrl Shift o>`<br><b>Split terminals vertically</b>`<Ctrl Shift e>`<br><b>Open new tab</b>`<Ctrl Shift t>`


title: TLDR
content:
<b>Display the information of route table</b>`route -n`<br><b>Add route rule</b>`sudo route add -net [ip_address] netmask [netmask_address] gw [gw_address]`<br><b>Delete route rule</b>`sudo route del -net [ip_address] netmask [netmask_address] dev [gw_address]`


title: TLDR
content:
<b>List available network interfaces</b>`tcpdump [[-D|--list-interfaces]]`<br><b>Capture the traffic of a specific interface</b>`sudo tcpdump [[-i|--interface]] [eth0]`<br><b>Capture all TCP traffic showing contents ([A]SCII) in console</b>`sudo tcpdump -A tcp`<br><b>Capture the traffic from or to a host</b>`sudo tcpdump host [www.example.com]`<br><b>Capture the traffic from a specific interface, source, destination and destination port</b>`sudo tcpdump [[-i|--interface]] [eth0] src [192.168.1.1] and dst [192.168.1.2] and dst port [80]`<br><b>Capture the traffic of a network</b>`sudo tcpdump net [192.168.1.0/24]`<br><b>Capture all traffic except traffic over port 22 and [w]rite to a dump file</b>`sudo tcpdump -w [dumpfile.pcap] port not [22]`<br><b>[r]ead from a given dump file</b>`tcpdump -r [dumpfile.pcap]`


title: TLDR
content:
<b>Open thunderbird</b>`thunderbird`<br><b>Use a specific user profile</b>`thunderbird -P [profile_name]`<br><b>Use a specific user profile directory</b>`thunderbird --profile [path/to/profile_directory]`


title: TLDR
content:
<b>Test if a given variable is equal to a given string</b>`test "[$MY_VAR]" = "[/bin/zsh]"`<br><b>Test if a given variable is empty ([z]ero length)</b>`test -z "[$GIT_BRANCH]"`<br><b>Test if a [f]ile exists</b>`test -f "[path/to/file_or_directory]"`<br><b>Test if a [d]irectory does not exist</b>`test ! -d "[path/to/directory]"`<br><b>If A is true, then do B, or C in the case of an error (notice that C may run even if A fails)</b>`test [condition] && [echo "true"] || [echo "false"]`<br><b>Use test in a conditional statement</b>`if test -f "[path/to/file]"; then echo "File exists"; else echo "File does not exist"; fi`


title: TLDR
content:
<b>Start htop</b>`htop`<br><b>Start htop displaying processes owned by a specific user</b>`htop [[-u|--user]] [username]`<br><b>Display processes hierarchically in a tree view to show the parent-child relationships</b>`htop [[-t|--tree]]`<br><b>Sort processes by a specified sort_item (use htop --sort help for available options)</b>`htop [[-s|--sort]] [sort_item]`<br><b>Start htop with the specified delay between updates, in tenths of a second (i.e. 50 = 5 seconds)</b>`htop [[-d|--delay]] [50]`<br><b>Disable all system and process changing features</b>`htop --readonly`<br><b>See interactive commands while running htop</b>`[<F1>|<?>]`<br><b>Switch to a different tab</b>`<Tab>`


title: TLDR
content:
<b>Telnet to the default port of a host</b>`telnet [host]`<br><b>Telnet to a specific port of a host</b>`telnet [ip_address] [port]`<br><b>Exit a telnet session</b>`quit`<br><b>Emit the default escape character combination for terminating the session</b>`<Ctrl ]>`<br><b>Start telnet with "x" as the session termination character</b>`telnet [[-e|--escape]] [x] [ip_address] [port]`<br><b>Telnet to Star Wars animation</b>`telnet [towel.blinkenlights.nl]`


title: TLDR
content:
<b>Generate status report with configuration and all active settings</b>`sudo tlp-stat`<br><b>Show information about various devices</b>`sudo tlp-stat --[battery|disk|processor|graphics|pcie|rfkill|usb]`<br><b>Show verbose information about devices that support verbosity</b>`sudo tlp-stat [[-v|--verbose]] --[battery|processor|pcie|usb]`<br><b>Show configuration</b>`sudo tlp-stat [[-c|--config]]`<br><b>Monitor [p]ower supply udev [ev]ents</b>`sudo tlp-stat [[-P|--pev]]`<br><b>Show [p]ower [sup]ply diagonistics</b>`sudo tlp-stat --psup`<br><b>Show [t]emperatures and fan speed</b>`sudo tlp-stat [[-t|--temp]]`<br><b>Show general system information</b>`sudo tlp-stat [[-s|--system]]`


title: TLDR
content:
<b>Copy stdin to each file, and also to stdout</b>`echo "example" | tee [path/to/file]`<br><b>Append to the given files, do not overwrite</b>`echo "example" | tee [[-a|--append]] [path/to/file]`<br><b>Print stdin to the terminal, and also pipe it into another program for further processing</b>`echo "example" | tee [/dev/tty] | [xargs printf "[%s]"]`<br><b>Create a directory called "example", count the number of characters in "example" and write "example" to the terminal</b>`echo "example" | tee >(xargs mkdir) >(wc [[-c|--bytes]])`


title: TLDR
content:
<b>Show all available variables and their values</b>`sysctl [[-a|--all]]`<br><b>Set a changeable kernel state variable</b>`sysctl [[-w|--write]] [section.tunable]=[value]`<br><b>Get currently open file handlers</b>`sysctl fs.file-nr`<br><b>Get limit for simultaneous open files</b>`sysctl fs.file-max`<br><b>Apply changes from /etc/sysctl.conf</b>`sysctl [[-p|--load]]`


title: TLDR
content:
<b>Print files and directories up to num levels of depth (where 1 means the current directory)</b>`tree -L [num]`<br><b>Print directories only</b>`tree -d`<br><b>Print hidden files too with colorization on</b>`tree -a -C`<br><b>Print the tree without indentation lines, showing the full path instead (use -N to not escape non-printable characters)</b>`tree -i -f`<br><b>Print the size of each file and the cumulative size of each directory, in human-readable format</b>`tree -s -h --du`<br><b>Print files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files</b>`tree -P '[*.txt]' --prune`<br><b>Print directories within the tree hierarchy, using the wildcard (glob) pattern, and pruning out directories that aren't ancestors of the wanted one</b>`tree -P [directory_name] --matchdirs --prune`<br><b>Print the tree ignoring the given directories</b>`tree -I '[directory_name1|directory_name2]'`


title: TLDR
content:
<b>Get a running process' CPU affinity by PID</b>`taskset [[-p|--pid]] [[-c|--cpu-list]] [pid]`<br><b>Set a running process' CPU affinity by PID</b>`taskset [[-p|--pid]] [[-c|--cpu-list]] [cpu_id] [pid]`<br><b>Start a new process with affinity for a single CPU</b>`taskset [[-c|--cpu-list]] [cpu_id] [command]`<br><b>Start a new process with affinity for multiple non-sequential CPUs</b>`taskset [[-c|--cpu-list]] [cpu_id_1],[cpu_id_2],[cpu_id_3]`<br><b>Start a new process with affinity for CPUs 1 through 4</b>`taskset [[-c|--cpu-list]] [cpu_id_1]-[cpu_id_4]`


title: TLDR
content:
<b>Start top</b>`top`<br><b>Do not show any idle or zombie processes</b>`top [[-i|--idle-toggle]]`<br><b>Show only processes owned by given user</b>`top [[-u|--filter-only-euser]] [username]`<br><b>Sort processes by a field</b>`top [[-o|--sort-override]] [field_name]`<br><b>Show the individual threads of a given process</b>`top [[-Hp|--threads-show --pid]] [process_id]`<br><b>Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name)</b>`top [[-p|--pid]] $(pgrep [[-d|--delimiter]] ',' [process_name])`<br><b>Display help about interactive commands</b>`<?>`


title: TLDR
content:
<b>List the commands and the names of the expected events</b>`trap`<br><b>Execute a command when a signal is received</b>`trap 'echo "Caught signal [SIGHUP]"' [HUP]`<br><b>Remove commands</b>`trap - [HUP] [INT]`


title: TLDR
content:
<b>Traceroute to a host</b>`traceroute [example.com]`<br><b>Disable IP address and host name mapping</b>`traceroute -n [example.com]`<br><b>Specify wait time in seconds for response</b>`traceroute [[-w|--wait]] [0.5] [example.com]`<br><b>Specify number of queries per hop</b>`traceroute [[-q|--queries]] [5] [example.com]`<br><b>Specify size in bytes of probing packet</b>`traceroute [example.com] [42]`<br><b>Determine the MTU to the destination</b>`traceroute --mtu [example.com]`<br><b>Use ICMP instead of UDP for tracerouting</b>`traceroute [[-I|--icmp]] [example.com]`


title: TLDR
content:
<b>Create specific files</b>`touch [path/to/file1 path/to/file2 ...]`<br><b>Set the file [a]ccess or [m]odification times to the current one and don't create file if it doesn't exist</b>`touch [[-c|--no-create]] -[a|m] [path/to/file1 path/to/file2 ...]`<br><b>Set the file [t]ime to a specific value and don't create file if it doesn't exist</b>`touch [[-c|--no-create]] -t [YYYYMMDDHHMM.SS] [path/to/file1 path/to/file2 ...]`<br><b>Set the files' timestamp to the reference file's timestamp, and do not create the file if it does not exist</b>`touch [[-c|--no-create]] [[-r|--reference]] [path/to/reference_file] [path/to/file1 path/to/file2 ...]`<br><b>Set the timestamp by parsing a string</b>`touch [[-d|--date]] "[last year|5 hours|next thursday|nov 14|...]" [path/to/file]`<br><b>Create multiple files with an increasing number</b>`touch [path/to/file{1..10]}`<br><b>Create multiple files with a letter range</b>`touch [path/to/file{a..z]}`


title: TLDR
content:
<b>Kill in-progress connections at a specified interface, host and port</b>`tcpkill -i [eth1] host [192.95.4.27] and port [2266]`


title: TLDR
content:
<b>Move the cursor to a screen location</b>`tput cup [row] [column]`<br><b>Set foreground (af) or background (ab) color</b>`tput [setaf|setab] [ansi_color_code]`<br><b>Reverse text and background colors</b>`tput rev`<br><b>Reset all terminal text attributes</b>`tput sgr0`<br><b>Show number of columns, lines, or colors</b>`tput [cols|lines|colors]`<br><b>Enable or disable word wrap</b>`tput [smam|rmam]`<br><b>Hide or show the terminal cursor</b>`tput [civis|cnorm]`<br><b>Save or restore terminal text status (smcup also captures scroll wheel events)</b>`tput [smcup|rmcup]`


title: TLDR
content:
<b>Transpile a specified input file and output to stdout</b>`babel [path/to/file]`<br><b>Transpile a specified input file and output to a specific file</b>`babel [path/to/input_file] --out-file [path/to/output_file]`<br><b>Transpile the input file every time it is changed</b>`babel [path/to/input_file] --watch`<br><b>Transpile a whole directory of files</b>`babel [path/to/input_directory]`<br><b>Ignore specified comma-separated files in a directory</b>`babel [path/to/input_directory] --ignore [ignored_file1,ignored_file2,...]`<br><b>Transpile and output as minified JavaScript</b>`babel [path/to/input_file] --minified`<br><b>Choose a set of presets for output formatting</b>`babel [path/to/input_file] --presets [preset1,preset2,...]`<br><b>Display help</b>`babel --help`


title: TLDR
content:
<b>Monitor everything on localhost</b>`tshark`<br><b>Only capture packets matching a specific capture filter</b>`tshark -f '[udp port 53]'`<br><b>Only show packets matching a specific output filter</b>`tshark -Y '[http.request.method == "GET"]'`<br><b>Decode a TCP port using a specific protocol (e.g. HTTP)</b>`tshark -d tcp.port==[8888],[http]`<br><b>Specify the format of captured output</b>`tshark -T [json|text|ps|...]`<br><b>Select specific fields to output</b>`tshark -T [fields|ek|json|pdml] -e [http.request.method] -e [ip.src]`<br><b>Write captured packet to a file</b>`tshark -w [path/to/file]`<br><b>Analyze packets from a file</b>`tshark -r [path/to/file.pcap]`


title: TLDR
content:
<b>Start a new session</b>`tmux`<br><b>Start a new named [s]ession</b>`tmux [[new|new-session]] -s [name]`<br><b>List existing sessions</b>`tmux [[ls|list-sessions]]`<br><b>Attach to the most recently used session</b>`tmux [[a|attach]]`<br><b>Detach from the current session (inside a tmux session)</b>`<Ctrl b><d>`<br><b>Create a new window (inside a tmux session)</b>`<Ctrl b><c>`<br><b>Switch between sessions and windows (inside a tmux session)</b>`<Ctrl b><w>`<br><b>Kill a session by [t]arget name</b>`tmux kill-session -t [name]`


title: TLDR
content:
<b>Start an SSH session, restarting when the [M]onitoring port fails to return data</b>`autossh -M [monitor_port] "[ssh_command]"`<br><b>Forward a [L]ocal port to a remote one, restarting when necessary</b>`autossh -M [monitor_port] -L [local_port]:localhost:[remote_port] [user]@[host]`<br><b>Fork autossh into the background before executing SSH and do [N]ot open a remote shell</b>`autossh -f -M [monitor_port] -N "[ssh_command]"`<br><b>Run in the background, with no monitoring port, and instead send SSH keep-alive packets every 10 seconds to detect failure</b>`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" "[ssh_command]"`<br><b>Run in the background, with no monitoring port and no remote shell, exiting if the port forward fails</b>`autossh -f -M 0 -N -o "ServerAliveInterval 10" -o "ServerAliveCountMax 3" -o ExitOnForwardFailure=yes -L [local_port]:localhost:[remote_port] [user]@[host]`<br><b>Run in the background, logging autossh debug output and SSH verbose output to files</b>`AUTOSSH_DEBUG=1 AUTOSSH_LOGFILE=[path/to/autossh_log_file.log] autossh -f -M [monitor_port] -v -E [path/to/ssh_log_file.log] [ssh_command]`


title: TLDR
content:
<b>Create a random UUIDv4</b>`uuidgen [[-r|--random]]`<br><b>Create a UUIDv1 based on the current time</b>`uuidgen [[-t|--time]]`<br><b>Create a UUIDv5 of the name with a specified namespace prefix</b>`uuidgen [[-s|--sha1]] [[-n|--namespace]] [@dns|@url|@oid|@x500] [[-N|--name]] [object_name]`


title: TLDR
content:
<b>Display the type of a command</b>`type [command]`<br><b>Display all locations containing the specified executable (works only in Bash/fish/Zsh shells)</b>`type -a [command]`<br><b>Display the name of the disk file that would be executed (works only in Bash/fish/Zsh shells)</b>`type -p [command]`<br><b>Display the type of a specific command, alias/keyword/function/builtin/file (works only in Bash/fish shells)</b>`type -t [command]`


title: TLDR
content:
<b>Trim some whitespace using a regex (output stream: stdout)</b>`[echo 'lorem ipsum 23   '] | sd '\s+$' ''`<br><b>Replace words using capture groups (output stream: stdout)</b>`[echo 'cargo +nightly watch'] | sd '(\w+)\s+\+(\w+)\s+(\w+)' 'cmd: $1, channel: $2, subcmd: $3'`<br><b>Find and replace in a specific file (output stream: stdout)</b>`sd [[-p|--preview]] '[window.fetch]' '[fetch]' [path/to/file.js]`<br><b>Find and replace in all files in the current project (output stream: stdout)</b>`sd '[from "react"]' '[from "preact"]' "$(find . -type f)"`


title: TLDR
content:
<b>Enable ufw</b>`sudo ufw enable`<br><b>Disable ufw</b>`sudo ufw disable`<br><b>Show ufw rules, along with their numbers</b>`sudo ufw status numbered`<br><b>Allow incoming traffic on port 5432 on this host with a comment identifying the service</b>`sudo ufw allow 5432 comment "[Service]"`<br><b>Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22</b>`sudo ufw allow proto tcp from 192.168.0.4 to any port 22`<br><b>Deny traffic on port 80 on this host</b>`sudo ufw deny 80`<br><b>Deny all UDP traffic to ports in range 8412:8500</b>`sudo ufw deny proto udp from any to any port 8412:8500`<br><b>Delete a particular rule. The rule number can be retrieved from the ufw status numbered command</b>`sudo ufw delete [rule_number]`


title: TLDR
content:
<b>Upgrade installed packages to the newest available versions</b>`sudo dnf [[up|upgrade]]`<br><b>Search packages via keywords</b>`dnf [[se|search]] [keyword1 keyword2 ...]`<br><b>Display details about a package</b>`dnf [[if|info]] [package]`<br><b>Install a new package (use --assumeyes to confirm all prompts automatically)</b>`sudo dnf [[in|install]] [package1 package2 ...]`<br><b>Remove a package</b>`sudo dnf [[rm|remove]] [package1 package2 ...]`<br><b>List installed packages</b>`dnf [[ls|list]] --installed`<br><b>Find which packages provide a given command</b>`dnf [[wp|provides]] [command]`<br><b>View all past operations</b>`dnf [[hist|history]]`


title: TLDR
content:
<b>List files and directories in the current directory, one per line, with details</b>`vdir`<br><b>List with sizes displayed in human-readable units (KB, MB, GB)</b>`vdir [[-h|--human-readable]]`<br><b>List including hidden files (starting with a dot)</b>`vdir [[-a|--all]]`<br><b>List files and directories sorting entries by size (largest first)</b>`vdir -S`<br><b>List files and directories sorting entries by modification time (newest first)</b>`vdir -t`<br><b>List grouping directories first</b>`vdir --group-directories-first`<br><b>Recursively list all files and directories in a specific directory</b>`vdir [[-R|--recursive]] [path/to/directory]`


title: TLDR
content:
<b>Display the current mask in octal notation</b>`umask`<br><b>Display the current mask in symbolic (human-readable) mode</b>`umask -S`<br><b>Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged)</b>`umask [a+r]`<br><b>Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else</b>`umask [077]`


title: TLDR
content:
<b>Get the properties of all the user limits</b>`ulimit -a`<br><b>Get hard limit for the number of simultaneously opened files</b>`ulimit -H -n`<br><b>Get soft limit for the number of simultaneously opened files</b>`ulimit -S -n`<br><b>Set max per-user process limit</b>`ulimit -u [30]`<br><b>Display help (Bash only)</b>`help ulimit`


title: TLDR
content:
<b>Unmount a filesystem, by passing the path to the source it is mounted from</b>`umount [path/to/device_file]`<br><b>Unmount a filesystem, by passing the path to the target where it is mounted</b>`umount [path/to/mounted_directory]`<br><b>Unmount all mounted filesystems (except the proc filesystem)</b>`umount -a`


title: TLDR
content:
<b>Extract files with original directory structure</b>`unrar x [compressed.rar]`<br><b>Extract files to a specified path with the original directory structure</b>`unrar x [compressed.rar] [path/to/extract]`<br><b>Extract files into current directory, losing directory structure in the archive</b>`unrar e [compressed.rar]`<br><b>Test integrity of each file inside the archive file</b>`unrar t [compressed.rar]`<br><b>List files inside the archive file without decompressing it</b>`unrar l [compressed.rar]`


title: TLDR
content:
<b>Add a symbolic link</b>`sudo update-alternatives --install [path/to/symlink] [command_name] [path/to/command_binary] [priority]`<br><b>Configure a symbolic link for java</b>`sudo update-alternatives --config [java]`<br><b>Remove a symbolic link</b>`sudo update-alternatives --remove [java] [/opt/java/jdk1.8.0_102/bin/java]`<br><b>Display information about a specified command</b>`update-alternatives --display [java]`<br><b>Display all commands and their current selection</b>`update-alternatives --get-selections`


title: TLDR
content:
<b>Extract all files/directories from specific archives into the current directory</b>`unzip [path/to/archive1.zip path/to/archive2.zip ...]`<br><b>Extract files/directories from archives to a specific path</b>`unzip [path/to/archive1.zip path/to/archive2.zip ...] -d [path/to/output]`<br><b>Extract files/directories from archives to stdout alongside the extracted file names</b>`unzip -c [path/to/archive1.zip path/to/archive2.zip ...]`<br><b>Extract an archive created on Windows, containing files with non-ASCII (e.g. Chinese or Japanese characters) filenames</b>`unzip -O [gbk] [path/to/archive1.zip path/to/archive2.zip ...]`<br><b>List the contents of a specific archive without extracting them</b>`unzip -l [path/to/archive.zip]`<br><b>Extract a specific file from an archive</b>`unzip -j [path/to/archive.zip] [path/to/file1_in_archive path/to/file2_in_archive ...]`


title: TLDR
content:
<b>Install a service</b>`update-rc.d [mysql] defaults`<br><b>Enable a service</b>`update-rc.d [mysql] enable`<br><b>Disable a service</b>`update-rc.d [mysql] disable`<br><b>Forcibly remove a service</b>`update-rc.d -f [mysql] remove`


title: TLDR
content:
<b>Refresh database content</b>`sudo updatedb`<br><b>Display file names as soon as they are found</b>`sudo updatedb [[-v|--verbose]]`


title: TLDR
content:
<b>Print kernel name</b>`uname`<br><b>Print all available system information</b>`uname [[-a|--all]]`<br><b>Print system architecture and processor information</b>`uname [[-mp|--machine --processor]]`<br><b>Print kernel name, kernel release and kernel version</b>`uname [[-srv|--kernel-name --kernel-release --kernel-version]]`<br><b>Print system hostname</b>`uname [[-n|--nodename]]`<br><b>Print the current operating system name</b>`uname [[-o|--operating-system]]`<br><b>Display help</b>`uname --help`


title: TLDR
content:
<b>Call the first target specified in the Makefile (usually named "all")</b>`make`<br><b>Call a specific target</b>`make [target]`<br><b>Call a specific target, executing 4 jobs at a time in parallel</b>`make [[-j|--jobs]] 4 [target]`<br><b>Use a specific Makefile</b>`make [[-f|--file]] [path/to/file]`<br><b>Execute make from another directory</b>`make [[-C|--directory]] [path/to/directory]`<br><b>Force making of a target, even if source files are unchanged</b>`make [[-B|--always-make]] [target]`<br><b>Override a variable defined in the Makefile</b>`make [target] [variable]=[new_value]`<br><b>Override variables defined in the Makefile by the environment</b>`make [[-e|--environment-overrides]] [target]`


title: TLDR
content:
<b>Start a game at Level 1</b>`pacman4console`<br><b>Start a game on a certain level (there are nine official levels)</b>`pacman4console --level=[level_number]`<br><b>Start the pacman4console level editor, saving to a specified text file</b>`pacman4consoleedit [path/to/level_file]`<br><b>Play a custom level</b>`pacman4console --level=[path/to/level_file]`


title: TLDR
content:
<b>Show the structure of a Type built-in of the .NET Framework</b>`monop [System.String]`<br><b>List the types in an assembly</b>`monop -r:[path/to/assembly.exe]`<br><b>Show the structure of a Type in a specific assembly</b>`monop -r:[path/to/assembly.dll] [Namespace.Path.To.Type]`<br><b>Only show members defined in the specified Type</b>`monop -r:[path/to/assembly.dll] [[-d|--declared-only]] [Namespace.Path.To.Type]`<br><b>Show private members</b>`monop -r:[path/to/assembly.dll] [[-p|--private]] [Namespace.Path.To.Type]`<br><b>Hide obsolete members</b>`monop -r:[path/to/assembly.dll] [[-f|--filter-obsolete]] [Namespace.Path.To.Type]`<br><b>List the other assemblies that a specified assembly references</b>`monop -r:[path/to/assembly.dll] --refs`


title: TLDR
content:
<b>List interfaces with detailed info</b>`ip [[a|address]]`<br><b>List interfaces with brief network layer info</b>`ip [[-br|-brief]] [[a|address]]`<br><b>List interfaces with brief link layer info</b>`ip [[-br|-brief]] [[l|link]]`<br><b>Display the routing table</b>`ip [[r|route]]`<br><b>Show neighbors (ARP table)</b>`ip [[n|neighbour]]`<br><b>Make an interface up/down</b>`sudo ip [[l|link]] [[s|set]] [ethX] [up|down]`<br><b>Add/Delete an IP address to an interface</b>`sudo ip [[a|address]] [add|delete] [ip]/[mask] dev [ethX]`<br><b>Add a default route</b>`sudo ip [[r|route]] [[a|add]] default via [ip] dev [ethX]`


title: TLDR
content:
<b>Capture a screenshot and save it to the current directory with the current date as the filename</b>`scrot`<br><b>Capture a screenshot and save it as capture.png</b>`scrot [capture.png]`<br><b>Capture a screenshot interactively</b>`scrot --select`<br><b>Capture a screenshot interactively without exiting on keyboard input, press <Esc> to exit</b>`scrot --select --ignorekeyboard`<br><b>Capture a screenshot interactively delimiting the region with a colored line</b>`scrot --select --line color=[x11_color|rgb_color]`<br><b>Capture a screenshot from the currently focused window</b>`scrot --focused`<br><b>Display a countdown of 10 seconds before taking a screenshot</b>`scrot --count --delay [10]`


title: TLDR
content:
<b>Make a simple GET request</b>`lwp-request -m GET [http://example.com/some/path]`<br><b>Upload a file with a POST request</b>`lwp-request -m POST [http://example.com/some/path] < [path/to/file]`<br><b>Make a request with a custom user agent</b>`lwp-request -H 'User-Agent: [user_agent] -m [METHOD] [http://example.com/some/path]`<br><b>Make a request with HTTP authentication</b>`lwp-request -C [username]:[password] -m [METHOD] [http://example.com/some/path]`<br><b>Make a request and print request headers</b>`lwp-request -U -m [METHOD] [http://example.com/some/path]`<br><b>Make a request and print response headers and status chain</b>`lwp-request -E -m [METHOD] [http://example.com/some/path]`


title: TLDR
content:
<b>View all available firewall zones and rules in their runtime configuration state</b>`firewall-cmd --list-all-zones`<br><b>Permanently move the interface into the block zone, effectively blocking all communication</b>`firewall-cmd --permanent --zone [block] --change-interface [enp1s0]`<br><b>Permanently open the port for a service in the specified zone (like port 443 when in the public zone)</b>`firewall-cmd --permanent --zone [public] --add-service [https]`<br><b>Permanently close the port for a service in the specified zone (like port 80 when in the public zone)</b>`firewall-cmd --permanent --zone [public] --remove-service [http]`<br><b>Permanently forward a port for incoming packets in the specified zone (like port 443 to 8443 when entering the public zone)</b>`firewall-cmd --permanent --zone [public] --add-rich-rule 'rule family "[ipv4|ipv6]" forward-port port "[443]" protocol "[udp|tcp]" to-port "[8443]"'`<br><b>Reload firewalld to lose any runtime changes and force the permanent configuration to take effect immediately</b>`firewall-cmd --reload`<br><b>Save the runtime configuration state to the permanent configuration</b>`firewall-cmd --runtime-to-permanent`<br><b>Enable panic mode in case of Emergency. All traffic is dropped, any active connection will be terminated</b>`firewall-cmd --panic-on`


title: TLDR
content:
<b>Compile a package</b>`gradle build`<br><b>Exclude test task</b>`gradle build [[-x|--exclude-task]] [test]`<br><b>Run in offline mode to prevent Gradle from accessing the network during builds</b>`gradle build --offline`<br><b>Clear the build directory</b>`gradle clean`<br><b>Build an Android Package (APK) in release mode</b>`gradle assembleRelease`<br><b>List the main tasks</b>`gradle tasks`<br><b>List all the tasks</b>`gradle tasks --all`


title: TLDR
content:
<b>Start screenfetch</b>`screenfetch`<br><b>Take a screenshot (requires scrot)</b>`screenfetch -s`<br><b>Specify distribution logo</b>`screenfetch -A '[distribution_name]'`<br><b>Specify distribution logo and text</b>`screenfetch -D '[distribution_name]'`<br><b>Strip all color</b>`screenfetch -N`


title: TLDR
content:
<b>Lookup the IP(s) associated with a hostname (A records)</b>`drill [example.com]`<br><b>Lookup the mail server(s) associated with a given domain name (MX record)</b>`drill mx [example.com]`<br><b>Get all types of records for a given domain name</b>`drill any [example.com]`<br><b>Specify an alternate DNS server to query</b>`drill [example.com] @[8.8.8.8]`<br><b>Perform a reverse DNS lookup on an IP address (PTR record)</b>`drill -x [8.8.8.8]`<br><b>Perform DNSSEC trace from root servers down to a domain name</b>`drill -TD [example.com]`<br><b>Show DNSKEY record(s) for a domain name</b>`drill -s dnskey [example.com]`


title: TLDR
content:
<b>Lookup the IP(s) associated with a hostname (A records)</b>`dig +short [example.com]`<br><b>Get a detailed answer for a given domain (A records)</b>`dig +noall +answer [example.com]`<br><b>Query a specific DNS record type associated with a given domain name</b>`dig +short [example.com] [A|MX|TXT|CNAME|NS]`<br><b>Specify an alternate DNS server to query and optionally use DNS over TLS (DoT)</b>`dig [+tls] @[1.1.1.1|8.8.8.8|9.9.9.9|...] [example.com]`<br><b>Perform a reverse DNS lookup on an IP address (PTR record)</b>`dig -x [8.8.8.8]`<br><b>Find authoritative name servers for the zone and display SOA records</b>`dig +nssearch [example.com]`<br><b>Perform iterative queries and display the entire trace path to resolve a domain name</b>`dig +trace [example.com]`<br><b>Query a DNS server over a non-standard [p]ort using the TCP protocol</b>`dig +tcp -p [port] @[dns_server_ip] [example.com]`


title: TLDR
content:
<b>Display network info for an IP address</b>`ipcalc [192.168.0.1]`<br><b>Display network info using CIDR notation</b>`ipcalc [192.168.0.1]/[24]`<br><b>Display network info using a dotted decimal netmask</b>`ipcalc [192.168.0.1] [255.255.255.0]`<br><b>Suppress bitwise output</b>`ipcalc [[-b|--nobinary]] [192.168.0.1]`<br><b>Split a network into specified sized blocks</b>`ipcalc [[-s|--split]] [size1 size2 size3 ...] [192.168.0.1]`<br><b>Display version</b>`ipcalc [[-v|--version]]`


title: TLDR
content:
<b>List services with runlevel</b>`chkconfig --list`<br><b>Show a service's runlevel</b>`chkconfig --list [ntpd]`<br><b>Enable service at boot</b>`chkconfig [sshd] on`<br><b>Enable service at boot for runlevels 2, 3, 4, and 5</b>`chkconfig --level [2345] [sshd] on`<br><b>Disable service at boot</b>`chkconfig [ntpd] off`<br><b>Disable service at boot for runlevel 3</b>`chkconfig --level [3] [ntpd] off`


title: TLDR
content:
<b>Create a package.json file with default values (omit --yes to do it interactively)</b>`npm init [[-y|--yes]]`<br><b>Download all the packages listed as dependencies in package.json</b>`npm [[i|install]]`<br><b>Download a specific version of a package and add it to the list of dependencies in package.json</b>`npm [[i|install]] [package_name]@[version]`<br><b>Download the latest version of a package and add it to the list of dev dependencies in package.json</b>`npm [[i|install]] [package_name] [[-D|--save-dev]]`<br><b>Download the latest version of a package and install it globally</b>`npm [[i|install]] [package_name] [[-g|--global]]`<br><b>Uninstall a package and remove it from the list of dependencies in package.json</b>`npm [[r|uninstall]] [package_name]`<br><b>List all locally installed dependencies</b>`npm [[ls|list]]`<br><b>List all top-level globally installed packages</b>`npm [[ls|list]] [[-g|--global]] --depth [0]`


title: TLDR
content:
<b>Execute the ls program literally, even if an ls alias exists</b>`command [ls]`<br><b>Find and execute a command using a default $PATH (/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc) that guarantees to find all standard utilities</b>`command -p [command_name]`<br><b>Display the path to the executable or the alias definition of a specific command</b>`command -v [command_name]`


title: TLDR
content:
<b>Synchronize list of packages and versions available. This should be run first, before running subsequent aptitude commands</b>`sudo aptitude update`<br><b>Install a new package and its dependencies</b>`sudo aptitude install [package]`<br><b>Search for a package</b>`aptitude search [package]`<br><b>Search for an installed package (?installed is an aptitude search term)</b>`aptitude search '?installed([package])'`<br><b>Remove a package and all packages depending on it</b>`sudo aptitude remove [package]`<br><b>Upgrade installed packages to the newest available versions</b>`sudo aptitude upgrade`<br><b>Upgrade installed packages (like aptitude upgrade) including removing obsolete packages and installing additional packages to meet new package dependencies</b>`sudo aptitude full-upgrade`<br><b>Put an installed package on hold to prevent it from being automatically upgraded</b>`sudo aptitude hold '?installed([package])'`


title: TLDR
content:
<b>Create a new user with a default home directory and prompt the user to set a password</b>`adduser [username]`<br><b>Create a new user without a home directory</b>`adduser --no-create-home [username]`<br><b>Create a new user with a home directory at the specified path</b>`adduser --home [path/to/home] [username]`<br><b>Create a new user with the specified shell set as the login shell</b>`adduser --shell [path/to/shell] [username]`<br><b>Create a new user belonging to the specified group</b>`adduser --ingroup [group] [username]`


title: TLDR
content:
<b>Print the fifth column (a.k.a. field) in a space-separated file</b>`awk '{print $5}' [path/to/file]`<br><b>Print the second column of the lines containing "foo" in a space-separated file</b>`awk '/[foo]/ {print $2}' [path/to/file]`<br><b>Print the last column of each line in a file, using a comma (instead of space) as a field separator</b>`awk -F ',' '{print $NF}' [path/to/file]`<br><b>Sum the values in the first column of a file and print the total</b>`awk '{s+=$1} END {print s}' [path/to/file]`<br><b>Print every third line starting from the first line</b>`awk 'NR%3==1' [path/to/file]`<br><b>Print different values based on conditions</b>`awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' [path/to/file]`<br><b>Print all the lines which the 10th column value is between a min and a max</b>`awk '($10 >= [min_value] && $10 <= [max_value])'`<br><b>Print table of users with UID >=1000 with header and formatted output, using colon as separator (%-20s mean: 20 left-align string characters, %6s means: 6 right-align string characters)</b>`awk 'BEGIN {FS=":";printf "%-20s %6s %25s\n", "Name", "UID", "Shell"} $4 >= 1000 {printf "%-20s %6d %25s\n", $1, $4, $7}' /etc/passwd`


title: TLDR
content:
<b>List the sizes of a directory and any subdirectories, in the given unit (B/KiB/MiB)</b>`du -[b|k|m] [path/to/directory]`<br><b>List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size)</b>`du [[-h|--human-readable]] [path/to/directory]`<br><b>Show the size of a single directory, in human-readable units</b>`du [[-sh|--summarize --human-readable]] [path/to/directory]`<br><b>List the human-readable sizes of a directory and of all the files and directories within it</b>`du [[-ah|--all --human-readable]] [path/to/directory]`<br><b>List the human-readable sizes of a directory and any subdirectories, up to n levels deep</b>`du [[-h|--human-readable]] [[-d|--max-depth]] [n] [path/to/directory]`<br><b>List the human-readable size of all .jpg files in current directory, and show a cumulative total at the end</b>`du [[-ch|--total --human-readable]] *.jpg`<br><b>List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space)</b>`du [[-ah|--all --human-readable]] [[-t|--threshold]] [1G|1024M|1048576K] .[^.]* *`


title: TLDR
content:
<b>Compute a checksum with BSD-compatible algorithm and 1024-byte blocks</b>`sum [path/to/file]`<br><b>Compute a checksum with System V-compatible algorithm and 512-byte blocks</b>`sum [[-s|--sysv]] [path/to/file]`


title: TLDR
content:
<b>Create a new user</b>`sudo useradd [username]`<br><b>Create a new user with the specified user ID</b>`sudo useradd [[-u|--uid]] [id] [username]`<br><b>Create a new user with the specified shell</b>`sudo useradd [[-s|--shell]] [path/to/shell] [username]`<br><b>Create a new user belonging to additional groups (mind the lack of whitespace)</b>`sudo useradd [[-G|--groups]] [group1,group2,...] [username]`<br><b>Create a new user with the default home directory</b>`sudo useradd [[-m|--create-home]] [username]`<br><b>Create a new user with the home directory filled by template directory files</b>`sudo useradd [[-k|--skel]] [path/to/template_directory] [[-m|--create-home]] [username]`<br><b>Create a new system user without the home directory</b>`sudo useradd [[-r|--system]] [username]`


title: TLDR
content:
<b>View documentation for the packaging solution</b>`tldr snap.pkg`<br><b>View documentation for the European Space Agency Earth observation data processing tool</b>`tldr snap.esa`


title: TLDR
content:
<b>Start a new screen session</b>`screen`<br><b>Start a new named screen session</b>`screen -S [session_name]`<br><b>Start a new daemon and log the output to screenlog.x</b>`screen -dmLS [session_name] [command]`<br><b>Show open screen sessions</b>`screen -ls`<br><b>Reattach to an open screen</b>`screen -r [session_name]`<br><b>Detach from inside a screen</b>`<Ctrl a><d>`<br><b>Kill the current screen session</b>`<Ctrl a><k>`<br><b>Kill a detached screen</b>`screen -X -S [session_name] quit`


title: TLDR
content:
<b>Edit the crontab file for the current user</b>`crontab -e`<br><b>Edit the crontab file for a specific user</b>`sudo crontab -e -u [user]`<br><b>Replace the current crontab with the contents of the given file</b>`crontab [path/to/file]`<br><b>View a list of existing cron jobs for current user</b>`crontab -l`<br><b>Remove all cron jobs for the current user</b>`crontab -r`<br><b>Sample job which runs at 10:00 every day (* means any value)</b>`0 10 * * * [command_to_execute]`<br><b>Sample crontab entry, which runs a command every 10 minutes</b>`*/10 * * * * [command_to_execute]`<br><b>Sample crontab entry, which runs a certain script at 02:30 every Friday</b>`30 2 * * Fri /[path/to/script.sh]`


title: TLDR
content:
<b>Show all mounted filesystems</b>`mount`<br><b>Mount a device to a directory</b>`mount [[-t|--types]] [filesystem_type] [path/to/device_file] [path/to/target_directory]`<br><b>Create a specific directory if it does not exist and mount a device to it</b>`mount [[-m|--mkdir]] [path/to/device_file] [path/to/target_directory]`<br><b>Mount a device to a directory for a specific user</b>`mount [[-o|--options]] uid=[user_id],gid=[group_id] [path/to/device_file] [path/to/target_directory]`<br><b>Mount a CD-ROM device (with the filetype ISO9660) to /cdrom (readonly)</b>`mount [[-t|--types]] [iso9660] [[-o|--options]] ro [/dev/cdrom] [/cdrom]`<br><b>Mount all the filesystem defined in /etc/fstab</b>`mount [[-a|--all]]`<br><b>Mount a specific filesystem described in /etc/fstab (e.g. /dev/sda1 /my_drive ext2 defaults 0 2)</b>`mount [/my_drive]`<br><b>Mount a directory to another directory</b>`mount [[-B|--bind]] [path/to/old_dir] [path/to/new_dir]`


title: TLDR
content:
<b>Display the file header information</b>`objdump [[-f|--file-headers]] [path/to/binary]`<br><b>Display all header information</b>`objdump [[-x|--all-headers]] [path/to/binary]`<br><b>Display the disassembled output of executable sections</b>`objdump [[-d|--disassemble]] [path/to/binary]`<br><b>Display the disassembled executable sections in Intel syntax</b>`objdump [[-M|--disassembler-options]] intel [[-d|--disassemble]] [path/to/binary]`<br><b>Display the symbol table</b>`objdump [[-t|--syms]] [path/to/binary]`<br><b>Display a complete binary hex dump of all sections</b>`objdump [[-s|--full-contents]] [path/to/binary]`


title: TLDR
content:
<b>Show only the file name from a path</b>`basename [path/to/file]`<br><b>Show only the rightmost directory name from a path</b>`basename [path/to/directory]`<br><b>Show only the file name from a path, with a suffix removed</b>`basename [path/to/file] [suffix]`


title: TLDR
content:
<b>Give a description of the type of the specified file</b>`file [path/to/file]`<br><b>Look inside a zipped file and determine the file type(s) inside</b>`file [[-z|--uncompress]] [path/to/file.zip]`<br><b>Allow file to work with special or device files</b>`file [[-s|--special-files]] [path/to/file]`<br><b>Don't stop at first file type match; keep going until the end of the file</b>`file [[-k|--keep-going]] [path/to/file]`<br><b>Determine the MIME encoding type of a file</b>`file [[-i|--mime]] [path/to/file]`


title: TLDR
content:
<b>List the status of all hosts within a range</b>`fping [192.168.1.{1..254]}`<br><b>List alive hosts within a subnet generated from a netmask</b>`fping [[-a|--alive]] [[-g|--generate]] [192.168.1.0/24]`<br><b>List alive hosts within a subnet generated from an IP range and prune per-probe results</b>`fping [[-q|--quiet]] [[-a|--alive]] [[-g|--generate]] [192.168.1.1] [192.168.1.254]`<br><b>List unreachable hosts within a subnet generated from a netmask</b>`fping [[-u|--unreach]] [[-g|--generate]] [192.168.1.0/24]`


title: TLDR
content:
<b>List all installed packages</b>`dpkg-query [[-l|--list]]`<br><b>List installed packages matching a pattern</b>`dpkg-query [[-l|--list]] '[libc6*]'`<br><b>List all files installed by a package</b>`dpkg-query [[-L|--listfiles]] [libc6]`<br><b>Show information about a package</b>`dpkg-query [[-s|--status]] [libc6]`<br><b>Search for packages that own files matching a pattern</b>`dpkg-query [[-S|--search]] [/etc/ld.so.conf.d]`


title: TLDR
content:
<b>Start an interactive editor session with an empty document</b>`ed`<br><b>Start an interactive editor session with an empty document and a specific prompt</b>`ed [[-p|--prompt]] '[> ]'`<br><b>Start an interactive editor session with user-friendly errors</b>`ed [[-v|--verbose]]`<br><b>Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt</b>`ed [[-q|--quiet]] [[-s|--script]]`<br><b>Start an interactive editor session without exit status change when command fails</b>`ed [[-l|--loose-exit-status]]`<br><b>Edit a specific file (this shows the byte count of the loaded file)</b>`ed [path/to/file]`<br><b>Replace a string with a specific replacement for all lines</b>`,s/[regex]/[replacement]/g<Enter>`<br><b>Exit ed</b>`q<Enter>`


title: TLDR
content:
<b>Start mitmproxy with default settings (will listen on port 8080)</b>`mitmproxy`<br><b>Start mitmproxy bound to a custom address and port</b>`mitmproxy --listen-host [ip_address] [[-p|--listen-port]] [port]`<br><b>Start mitmproxy using a script to process traffic</b>`mitmproxy [[-s|--scripts]] [path/to/script.py]`<br><b>Export the logs with SSL/TLS master keys to external programs (wireshark, etc.)</b>`SSLKEYLOGFILE="[path/to/file]" mitmproxy`<br><b>Specify mode of operation of the proxy server (regular is the default)</b>`mitmproxy [[-m|--mode]] [regular|transparent|socks5|...]`<br><b>Set the console layout</b>`mitmproxy --console-layout [horizontal|single|vertical]`<br><b>Save all proxied traffic to a file for later analysis</b>`mitmproxy [[-w|--save-stream-file]] [path/to/dump.mitm]`<br><b>Replay a previously saved HTTP flow file</b>`mitmproxy [[-nr|--no-server --rfile]] [path/to/dump.mitm]`


title: TLDR
content:
<b>Halt the system</b>`halt`<br><b>Power off the system (same as poweroff)</b>`halt [[-p|--poweroff]]`<br><b>Reboot the system (same as reboot)</b>`halt --reboot`<br><b>Halt immediately without contacting the system manager</b>`halt [[-f|--force]]`<br><b>Write the wtmp shutdown entry without halting the system</b>`halt [[-w|--wtmp-only]]`


title: TLDR
content:
<b>Recursively find files matching a specific pattern in the current directory</b>`fd "[string|regex]"`<br><b>Find files that begin with a specific string</b>`fd "[^string]"`<br><b>Find files with a specific extension</b>`fd [[-e|--extension]] [txt]`<br><b>Find files in a specific directory</b>`fd "[string|regex]" [path/to/directory]`<br><b>Include ignored and hidden files in the search</b>`fd [[-H|--hidden]] [[-I|--no-ignore]] "[string|regex]"`<br><b>Execute a command on each search result returned</b>`fd "[string|regex]" [[-x|--exec]] [command]`


title: TLDR
content:
<b>Create an fsdax mode namespace</b>`ndctl create-namespace --mode=[fsdax]`<br><b>Change the mode of a namespace to raw</b>`ndctl create-namespace --reconfigure=[namespaceX.Y] --mode=[raw]`<br><b>Check a sector mode namespace for consistency, and repair if needed</b>`ndctl check-namespace --repair [namespaceX.Y]`<br><b>List all namespaces, regions, and buses (including disabled ones)</b>`ndctl list --namespaces --regions --buses --idle`<br><b>List a specific namespace and include lots of additional information</b>`ndctl list -vvv --namespace=[namespaceX.Y]`<br><b>Run a monitor to watch for SMART health events for NVDIMMs on the ACPI.NFIT bus</b>`ndctl monitor --bus=[ACPI.NFIT]`<br><b>Remove a namespace (when applicable) or reset it to an initial state</b>`ndctl destroy-namespace --force [namespaceX.Y]`


title: TLDR
content:
<b>Create an empty Mercurial repository</b>`hg init`<br><b>Clone a remote Mercurial repository from the internet</b>`hg clone [https://example.com/repo]`<br><b>View the status of a local repository</b>`hg status`<br><b>Add all new files to the next commit</b>`hg add`<br><b>Commit changes to version history</b>`hg commit [[-m|--message]] [message_text]`<br><b>Push local changes to a remote repository</b>`hg push`<br><b>Pull any changes made to a remote</b>`hg pull`<br><b>Reset everything the way it was in the latest commit</b>`hg update [[-C|--clean]]; hg purge`


title: TLDR
content:
<b>Send mail (the content should be typed after the command, and ended with <Ctrl d>)</b>`mailx [[-s|--subject]] "[subject]" [to_addr]`<br><b>Send mail with content passed from another command</b>`echo "[content]" | mailx [[-s|--subject]] "[subject]" [to_addr]`<br><b>Send mail with content read from a file</b>`mailx < [content.txt] [[-s|--subject]] "[subject]" [to_addr]`<br><b>Send mail to a recipient and CC to another address</b>`mailx [[-s|--subject]] "[subject]" [[-c|--cc]] [cc_addr] [to_addr]`<br><b>Send mail specifying the sender address</b>`mailx [[-s|--subject]] "[subject]" [[-r|--from-address]] [from_addr] [to_addr]`<br><b>Send mail with an attachment</b>`mailx [[-a|--attach]] [path/to/file] [[-s|--subject]] "[subject]" [to_addr]`


title: TLDR
content:
<b>Show status of all jobs</b>`jobs`<br><b>Show status of a particular job</b>`jobs %[job_id]`<br><b>Show status and process IDs of all jobs</b>`jobs -l`<br><b>Show process IDs of all jobs</b>`jobs -p`


title: TLDR
content:
<b>Assemble a file, writing the output to a.out</b>`as [path/to/file.s]`<br><b>Assemble the output to a given file</b>`as [path/to/file.s] -o [path/to/output_file.o]`<br><b>Generate output faster by skipping whitespace and comment preprocessing. (Should only be used for trusted compilers)</b>`as -f [path/to/file.s]`<br><b>Include a given path to the list of directories to search for files specified in .include directives</b>`as -I [path/to/directory] [path/to/file.s]`


title: TLDR
content:
<b>Check if PulseAudio is running (a non-zero exit code means it is not running)</b>`pulseaudio --check`<br><b>Start the PulseAudio daemon in the background</b>`pulseaudio --start`<br><b>Kill the running PulseAudio daemon</b>`pulseaudio [[-k|--kill]]`<br><b>List available modules</b>`pulseaudio --dump-modules`<br><b>Load a module into the currently running daemon with the specified arguments</b>`pulseaudio [[-L|--load]] "[module_name] [arguments]"`


title: TLDR
content:
<b>Display the commands history list with line numbers</b>`history`<br><b>Display the last 20 commands (in Zsh it displays all commands starting from the 20th)</b>`history 20`<br><b>Display history with timestamps in different formats (only available in Zsh)</b>`history -[d|f|i|E]`<br><b>[c]lear the commands history list</b>`history -c`<br><b>Over[w]rite history file with history of current Bash shell (often combined with history -c to purge history)</b>`history -w`<br><b>[d]elete the history entry at the specified offset</b>`history -d [offset]`<br><b>Add a command to history without running it</b>`history -s [command]`<br><b>Run a command without adding it to history by adding a leading space</b>`<Space>[command]`


title: TLDR
content:
<b>Toggle play/pause</b>`mpc toggle`<br><b>Stop playing</b>`mpc stop`<br><b>Show information about the currently playing song</b>`mpc status`<br><b>Play the next song</b>`mpc next`<br><b>Play the previous song</b>`mpc prev`<br><b>Seek n seconds forward (+) or backward (-)</b>`mpc [+n|-n]`


title: TLDR
content:
<b>Check that Lynis is up-to-date</b>`sudo lynis update info`<br><b>Run a security audit of the system</b>`sudo lynis audit system`<br><b>Run a security audit of a Dockerfile</b>`sudo lynis audit dockerfile [path/to/dockerfile]`


title: TLDR
content:
<b>Open a file</b>`most [path/to/file]`<br><b>Open several files</b>`most [path/to/file1 path/to/file2 ...]`<br><b>Open a file at the first occurrence of "string"</b>`most [path/to/file] +/[string]`<br><b>Move through opened files</b>`<:><n>[<ArrowUp>|<ArrowDown>]`<br><b>Jump to the 100th line</b>`<j>[100]<Enter>`<br><b>Edit current file</b>`<e>`<br><b>Split the current window in half</b>`<CTRL x><o>`<br><b>Exit</b>`<q>`


title: TLDR
content:
<b>Display all available stream info for a media file</b>`ffprobe [[-v|-loglevel]] error -show_streams [input.mp4]`<br><b>Display media duration</b>`ffprobe [[-v|-loglevel]] error -show_entries format=duration [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]`<br><b>Display the frame rate of a video</b>`ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=avg_frame_rate [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]`<br><b>Display the width or height of a video</b>`ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=[width|height] [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]`<br><b>Display the average bit rate of a video</b>`ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=bit_rate [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]`


title: TLDR
content:
<b>[a]rchive a file or directory</b>`7zr a [path/to/archive.7z] [path/to/file_or_directory]`<br><b>Encrypt an existing archive (including file names)</b>`7zr a [path/to/encrypted.7z] -p[password] -mhe=[on] [path/to/archive.7z]`<br><b>E[x]tract an archive preserving the original directory structure</b>`7zr x [path/to/archive.7z]`<br><b>E[x]tract an archive to a specific directory</b>`7zr x [path/to/archive.7z] -o[path/to/output]`<br><b>E[x]tract an archive to stdout</b>`7zr x [path/to/archive.7z] -so`<br><b>[l]ist the contents of an archive</b>`7zr l [path/to/archive.7z]`<br><b>Set the level of compression (higher means more compression, but slower)</b>`7zr a [path/to/archive.7z] -mx=[0|1|3|5|7|9] [path/to/file_or_directory]`


title: TLDR
content:
<b>Synchronize IMAP account between host1 and host2</b>`imapsync --host1 [host1] --user1 [user1] --password1 [secret1] --host2 [host2] --user2 [user2] --password2 [secret2]`


title: TLDR
content:
<b>View current configuration</b>`sudo nft list ruleset`<br><b>Add a new table with family "inet" and table "filter"</b>`sudo nft add table [inet] [filter]`<br><b>Add a new chain to accept all inbound traffic</b>`sudo nft add chain [inet] [filter] [input] \{ type [filter] hook [input] priority [0] \; policy [accept] \; \}`<br><b>Add a new rule to accept several TCP ports</b>`sudo nft add rule [inet] [filter] [input] [tcp] [dport \{ telnet, ssh, http, https \} accept]`<br><b>Add a NAT rule to translate all traffic from the 192.168.0.0/24 subnet to the host's public IP</b>`sudo nft add rule [nat] [postrouting] ip saddr [192.168.0.0/24] [masquerade]`<br><b>Show rule handles</b>`sudo nft --handle --numeric list chain [family] [table] [chain]`<br><b>Delete a rule</b>`sudo nft delete rule [inet] [filter] [input] handle [3]`<br><b>Save current configuration</b>`sudo nft list ruleset > [/etc/nftables.conf]`


title: TLDR
content:
<b>E[x]tract all members from an archive</b>`ar x [path/to/file.a]`<br><b>Lis[t] contents in a specific archive</b>`ar t [path/to/file.ar]`<br><b>[r]eplace or add specific files to an archive</b>`ar r [path/to/file.deb] [path/to/debian-binary path/to/control.tar.gz path/to/data.tar.xz ...]`<br><b>In[s]ert an object file index (equivalent to using ranlib)</b>`ar s [path/to/file.a]`<br><b>Create an archive with specific files and an accompanying object file index</b>`ar rs [path/to/file.a] [path/to/file1.o path/to/file2.o ...]`


title: TLDR
content:
<b>Set the fuck alias to thefuck tool</b>`eval "$(thefuck --alias)"`<br><b>Try to match a rule for the previous command</b>`fuck`<br><b>Confirm the first choice immediately (correct argument depends on level of annoyance)</b>`fuck --[yes|yeah|hard]`


title: TLDR
content:
<b>Scan the top 1000 ports of a remote host with various [v]erbosity levels</b>`nmap -v[1|2|3] [ip_or_hostname]`<br><b>Run a ping sweep over an entire [s]ub[n]et or individual hosts very aggressively</b>`nmap -T5 -sn [192.168.0.0/24|ip_or_hostname1,ip_or_hostname2,...]`<br><b>Enable OS detection, version detection, script scanning, and traceroute of hosts from a file</b>`sudo nmap -A -iL [path/to/file.txt]`<br><b>Scan a specific list of [p]orts (use -p- for all ports from 1 to 65535)</b>`nmap -p [port1,port2,...] [ip_or_host1,ip_or_host2,...]`<br><b>Perform service and version detection of the top 1000 ports using default NSE scripts, writing results (-oA) to output files</b>`nmap -sC -sV -oA [top-1000-ports] [ip_or_host1,ip_or_host2,...]`<br><b>Scan target(s) carefully using default and safe NSE scripts</b>`nmap --script "default and safe" [ip_or_host1,ip_or_host2,...]`<br><b>Scan for web servers running on standard [p]orts 80 and 443 using all available http-* NSE scripts</b>`nmap --script "http-*" [ip_or_host1,ip_or_host2,...] -p 80,443`<br><b>Attempt evading IDS/IPS detection by using an extremely slow scan (-T0), [D]ecoy source addresses, [f]ragmented packets, random data and other methods</b>`sudo nmap -T0 -D [decoy_ip1,decoy_ip2,...] --source-port [53] -f --data-length [16] -Pn [ip_or_host]`


title: TLDR
content:
<b>Synchronize list of packages and versions available</b>`sudo zypper [[ref|refresh]]`<br><b>Install a new package</b>`sudo zypper [[in|install]] [package]`<br><b>Remove a package</b>`sudo zypper [[rm|remove]] [package]`<br><b>Upgrade installed packages to the newest available versions</b>`sudo zypper [[up|update]]`<br><b>Search package via keyword</b>`zypper [[se|search]] [keyword]`<br><b>Show information related to configured repositories</b>`zypper [[lr|repos]] --sort-by-priority`


title: TLDR
content:
<b>Remove the variable foo, or if the variable doesn't exist, remove the function foo</b>`unset [foo]`<br><b>Remove the variables foo and bar</b>`unset -v [foo] [bar]`<br><b>Remove the function my_func</b>`unset -f [my_func]`


title: TLDR
content:
<b>Synchronize and update all packages (including AUR)</b>`yaourt -Syua`<br><b>Install a new package (includes AUR)</b>`yaourt -S [package]`<br><b>Remove a package and its dependencies (includes AUR packages)</b>`yaourt -Rs [package]`<br><b>Search the package database for a keyword (including AUR)</b>`yaourt -Ss [query]`<br><b>List installed packages, versions, and repositories (AUR packages will be listed under the repository name local)</b>`yaourt -Q`


title: TLDR
content:
<b>Check quotas on all mounted non-NFS filesystems</b>`sudo quotacheck --all`<br><b>Force check even if quotas are enabled (this can cause damage or loss to quota files)</b>`sudo quotacheck --force [mountpoint]`<br><b>Check quotas on a given filesystem in debug mode</b>`sudo quotacheck --debug [mountpoint]`<br><b>Check quotas on a given filesystem, displaying the progress</b>`sudo quotacheck --verbose [mountpoint]`<br><b>Check user quotas</b>`sudo quotacheck --user [user] [mountpoint]`<br><b>Check group quotas</b>`sudo quotacheck --group [group] [mountpoint]`


title: TLDR
content:
<b>List all Docker containers (running and stopped)</b>`docker ps [[-a|--all]]`<br><b>Start a container from an image, with a custom name</b>`docker run --name [container_name] [image]`<br><b>Start or stop an existing container</b>`docker [start|stop] [container_name]`<br><b>Pull an image from a Docker registry</b>`docker pull [image]`<br><b>Display the list of already downloaded images</b>`docker images`<br><b>Open an interactive tty with Bourne shell (sh) inside a running container</b>`docker exec [[-it|--interactive --tty]] [container_name] [sh]`<br><b>Remove stopped containers</b>`docker rm [container1 container2 ...]`<br><b>Fetch and follow the logs of a container</b>`docker logs [[-f|--follow]] [container_name]`


title: TLDR
content:
<b>Analyze the current working directory</b>`ncdu`<br><b>Colorize output</b>`ncdu --color [dark|off]`<br><b>Analyze a given directory</b>`ncdu [path/to/directory]`<br><b>Save results to a file</b>`ncdu -o [path/to/file]`<br><b>Exclude files that match a pattern, argument can be given multiple times to add more patterns</b>`ncdu --exclude '[*.txt]'`


title: TLDR
content:
<b>List hosts belonging to a group</b>`ansible [group] --list-hosts`<br><b>Ping a group of hosts by invoking the ping module</b>`ansible [group] [[-m|--module-name]] ping`<br><b>Display facts about a group of hosts by invoking the setup module</b>`ansible [group] [[-m|--module-name]] setup`<br><b>Execute a command on a group of hosts by invoking command module with arguments</b>`ansible [group] [[-m|--module-name]] command [[-a|--args]] '[my_command]'`<br><b>Execute a command with administrative privileges</b>`ansible [group] [[-b|--become]] --ask-become-pass [[-m|--module-name]] command [[-a|--args]] '[my_command]'`<br><b>Execute a command using a custom inventory file</b>`ansible [group] [[-i|--inventory]] [inventory_file] [[-m|--module-name]] command [[-a|--args]] '[my_command]'`<br><b>List the groups in an inventory</b>`ansible localhost [[-m|--module-name]] debug [[-a|--args]] '[var=groups.keys()]'`


title: TLDR
content:
<b>Display a simple message</b>`whiptail --title "[title]" --msgbox "[message]" [height_in_chars] [width_in_chars]`<br><b>Display a boolean choice, returning the result through the exit code</b>`whiptail --title "[title]" --yesno "[message]" [height_in_chars] [width_in_chars]`<br><b>Customise the text on the yes/no buttons</b>`whiptail --title "[title]" --yes-button "[text]" --no-button "[text]" --yesno "[message]" [height_in_chars] [width_in_chars]`<br><b>Display a text input box</b>`[result_variable_name]="$(whiptail --title "[title]" --inputbox "[message]" [height_in_chars] [width_in_chars] [default_text] 3>&1 1>&2 2>&3)"`<br><b>Display a password input box</b>`[result_variable_name]="$(whiptail --title "[title]" --passwordbox "[message]" [height_in_chars] [width_in_chars] 3>&1 1>&2 2>&3)"`<br><b>Display a multiple-choice menu</b>`[result_variable_name]=$(whiptail --title "[title]" --menu "[message]" [height_in_chars] [width_in_chars] [menu_display_height] ["value_1" "display_text_1" "value_2" "display_text_2" ...] 3>&1 1>&2 2>&3)`


title: TLDR
content:
<b>Open alpine normally</b>`alpine`<br><b>Open alpine directly to the message composition screen to send an email to a given email address</b>`alpine [email@example.net]`<br><b>Quit alpine</b>`<q><y>`


title: TLDR
content:
<b>Open a file</b>`vim [path/to/file]`<br><b>Open a file at a specified line number</b>`vim +[line_number] [path/to/file]`<br><b>View Vim's help manual</b>`<:>help<Enter>`<br><b>Save and quit the current buffer</b>`[<Esc><Z><Z>|<Esc><:>x<Enter>|<Esc><:>wq<Enter>]`<br><b>Enter normal mode and undo the last operation</b>`<Esc><u>`<br><b>Search for a pattern in the file (press <n>/<N> to go to next/previous match)</b>`</>[search_pattern]<Enter>`<br><b>Perform a regex substitution in the whole file</b>`<:>%s/[regex]/[replacement]/g<Enter>`<br><b>Display the line numbers</b>`<:>set nu<Enter>`


title: TLDR
content:
<b>Search a single directory</b>`fdupes [path/to/directory]`<br><b>Search multiple directories</b>`fdupes [directory1] [directory2]`<br><b>Search a directory recursively</b>`fdupes [[-r|--recurse]] [path/to/directory]`<br><b>Search multiple directories, one recursively</b>`fdupes [path/to/irectory1] [[-R|--recurse:]] [path/to/directory2]`<br><b>Search recursively, considering hardlinks as duplicates</b>`fdupes [[-rH|--recurse --hardlinks]] [path/to/directory]`<br><b>Search recursively for duplicates and display interactive prompt to pick which ones to keep, deleting the others</b>`fdupes [[-rd|--recurse --delete]] [path/to/directory]`<br><b>Search recursively and delete duplicates without prompting</b>`fdupes [[-rdN|--recurse --delete --noprompt]] [path/to/directory]`


title: TLDR
content:
<b>View chains, rules, packet/byte counters and line numbers for the filter table</b>`sudo iptables [[-vnL --line-numbers|--verbose --numeric --list --line-numbers]]`<br><b>Set chain policy rule</b>`sudo iptables [[-P|--policy]] [chain] [rule]`<br><b>Append rule to chain policy for IP</b>`sudo iptables [[-A|--append]] [chain] [[-s|--source]] [ip] [[-j|--jump]] [rule]`<br><b>Append rule to chain policy for IP considering protocol and port</b>`sudo iptables [[-A|--append]] [chain] [[-s|--source]] [ip] [[-p|--protocol]] [tcp|udp|icmp|...] --dport [port] [[-j|--jump]] [rule]`<br><b>Add a NAT rule to translate all traffic from the 192.168.0.0/24 subnet to the host's public IP</b>`sudo iptables [[-t|--table]] [nat] [[-A|--append]] [POSTROUTING] [[-s|--source]] [192.168.0.0/24] [[-j|--jump]] [MASQUERADE]`<br><b>Delete chain rule</b>`sudo iptables [[-D|--delete]] [chain] [rule_line_number]`


title: TLDR
content:
<b>Run on server</b>`iperf [[-s|--server]]`<br><b>Run on server using UDP mode and set server port to listen on 5001</b>`iperf [[-u|--udp]] [[-s|--server]] [[-p|--port]] [5001]`<br><b>Run on client</b>`iperf [[-c|--client]] [server_address]`<br><b>Run on client every 2 seconds</b>`iperf [[-c|--client]] [server_address] [[-i|--interval]] [2]`<br><b>Run on client with 5 parallel threads</b>`iperf [[-c|--client]] [server_address] [[-P|--parallel]] [5]`<br><b>Run on client using UDP mode</b>`iperf [[-u|--udp]] [[-c|--client]] [server_address] [[-p|--port]] [5001]`


title: TLDR
content:
<b>Mark a package as automatically installed</b>`sudo apt-mark auto [package]`<br><b>Hold a package at its current version and prevent updates to it</b>`sudo apt-mark hold [package]`<br><b>Allow a package to be updated again</b>`sudo apt-mark unhold [package]`<br><b>Show manually installed packages</b>`apt-mark showmanual`<br><b>Show held packages that aren't being updated</b>`apt-mark showhold`


title: TLDR
content:
<b>Generate by directly inputting text</b>`figlet [input_text]`<br><b>Use a custom [f]ont file</b>`figlet -f [path/to/font_file.flf] [input_text]`<br><b>Use a [f]ont from the default font directory (the extension can be omitted)</b>`figlet -f [font_filename] [input_text]`<br><b>Pipe command output through FIGlet</b>`[command] | figlet`<br><b>Show available FIGlet fonts</b>`showfigfonts [optional_string_to_display]`<br><b>Use the full width of the [t]erminal and [c]enter the input text</b>`figlet -t -c [input_text]`<br><b>Display all characters at full [W]idth to avoid overlapping</b>`figlet -W [input_text]`


title: TLDR
content:
<b>List all shell built-ins, aliases, functions and executables that you could run</b>`compgen -c`<br><b>List all commands that you could run that start with a specified string and save results to COMPREPLY</b>`compgen -V COMPREPLY -c [str]`<br><b>Match against a wordlist</b>`compgen -W "[apple orange banana]" [a]`<br><b>List all aliases</b>`compgen -a`<br><b>List all functions that you could run</b>`compgen -A function`<br><b>Show shell reserved keywords</b>`compgen -k`<br><b>See all available commands/aliases starting with ls</b>`compgen -ac [ls]`<br><b>List all users on the system</b>`compgen -u`


title: OPTIONS
content:
-h, --help
          show this help message and exit

   -d, --doctests_only
          Fix up doctests only

   -f FIX, --fix=FIX
          Each FIX specifies a transformation; default: all

   -j PROCESSES, --processes=PROCESSES
          Run 2to3 concurrently

   -x NOFIX, --nofix=NOFIX
          Prevent a transformation from being run

   -l, --list-fixes
          List available transformations

   -p, --print-function
          Modify the grammar so that print() is a function

   -v, --verbose
          More verbose logging

   --no-diffs
          Don't show diffs of the refactoring

   -w, --write
          Write back modified files

   -n, --nobackups
          Don't write backups for modified files


title: TLDR
content:
<b>List sessions</b>`abduco`<br><b>[A]ttach to a session, creating it if it doesn't exist</b>`abduco -A [name] [bash]`<br><b>[A]ttach to a session with dvtm, creating it if it doesn't exist</b>`abduco -A [name]`<br><b>Detach from a session</b>`<Ctrl \>`<br><b>[A]ttach to a session in [r]ead-only mode</b>`abduco -Ar [name]`


title: TLDR
content:
<b>Search for files containing a string or regex in the current directory recursively</b>`ack "[search_pattern]"`<br><b>Search for a case-insensitive pattern</b>`ack [[-i|--ignore-case]] "[search_pattern]"`<br><b>Search for lines matching a pattern, printing only the matched text and not the rest of the line</b>`ack [[-o|--output '$&']] "[search_pattern]"`<br><b>Limit search to files of a specific type</b>`ack [[-t|--type]] [ruby] "[search_pattern]"`<br><b>Do not search in files of a specific type</b>`ack [[-t|--type]] no[ruby] "[search_pattern]"`<br><b>Count the total number of matches found</b>`ack [[-c|--count]] [[-h|--no-filename]] "[search_pattern]"`<br><b>Print the file names and the number of matches for each file only</b>`ack [[-c|--count]] [[-l|--files-with-matches]] "[search_pattern]"`<br><b>List all the values that can be used with --type</b>`ack --help-types`


