is there a nice way to combine:
ls -R | grep "^[.]/" | sed -e "s/:$//" -e "s/[^\/]*\//--/g" -e "s/^/ |/"
(displays directory as tree)
with
du -h ... (for each listed dir)
Without installing any extra package, like tree, dutree ?
is there a nice way to combine:
ls -R | grep "^[.]/" | sed -e "s/:$//" -e "s/[^\/]*\//--/g" -e "s/^/ |/"
(displays directory as tree)
with
du -h ... (for each listed dir)
Without installing any extra package, like tree, dutree ?
I think, you should revert the order of du -h with tac and then put some formatting with sed. This one should work for "normal" directory names (without control characters):
du -h | tac | sed 's_[^/[:cntrl:]]*/_--_g;s/-/|/'
Or use find -exec:
find . -type d -exec du -sm {} \; | sed 's_[^/[:cntrl:]]*/_--_g;s/-/|/'