Skip to content

Instantly share code, notes, and snippets.

@slabad
Created September 30, 2021 15:05
Show Gist options
  • Save slabad/342749aab8d3e9e6d8f076d35293dcbd to your computer and use it in GitHub Desktop.
Save slabad/342749aab8d3e9e6d8f076d35293dcbd to your computer and use it in GitHub Desktop.
Bash Cheat Sheet #bash
#To display the largest folders/files including the sub-directories, run:
du -Sh | sort -rh | head -5
#du command: Estimate file space usage.
#-h : Print sizes in human-readable format (e.g., 10MB).
#-S : Do not include the size of subdirectories.
#-s : Display only a total for each argument.
#sort command : sort lines of text files.
#-r : Reverse the result of comparisons.
#-h : Compare human readable numbers (e.g., 2K, 1G).
#head : Output the first part of files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment