Thursday, June 11, 2015

dir2txt via terminal


Change in terminal to desired folder  cd /path/to/folder
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' > ~/filename.txt

source: http://www.cnet.com/news/terminal-fun-options-for-printing-folder-and-subfolder-contents/

No comments:

Blog Archive