Skip to content

Instantly share code, notes, and snippets.

@aleung
Last active March 13, 2017 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleung/7efdf54e18bff698b7d06a78c7133583 to your computer and use it in GitHub Desktop.
Save aleung/7efdf54e18bff698b7d06a78c7133583 to your computer and use it in GitHub Desktop.
One line shell scripts
# size of immediate sub-folders
du -d1 -BM | sort -g
# folder tree , also post at http://stackoverflow.com/a/42663008/94148
# folders only
pwd;find . -type d -print 2>/dev/null|awk '!/\.$/ {for (i=1;i<NF-1;i++){printf("│ ")}print "├── "$NF}' FS='/'
# include files
pwd;find . -print 2>/dev/null|sort|awk '!/\.$/ {for (i=1;i<NF-1;i++){printf("│ ")}print "├── "$NF}' FS='/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment