aleung
3/8/2017 - 4:12 AM

One line shell scripts

One line shell scripts

# 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='/'
# size of immediate sub-folders

du -d1 -BM | sort -g