Skip to main content

Shell scripting

cheatsheets:

bash basics

$? last result

conditions

  • check if file exists:
    [ -f /path/to/file ] && do something
    if [ -f /path/to/file ]; then do something; fi
    

find biggest folders of current directory

du -hs * | sort -rh | head -5