Create Graphical View Of Folders In Terminal 4


Create Graphical View Of Folders In Terminal


This is a rather cool unix/linux trick that is used to create a graphical representation of the current sub-directories in the current folder. For example you get a a cool text view of all of the folders within Terminal. For example if you look at the image below you should get a better idea of what I am on about.

Its simple to do and is rather cool.

Open up Terminal from Utilities, and change the directory to something that doesn’t have to many sub folders. You could do this on your root folder but you would be here for every as it maps every single folder and sub folder etc. To change the folder you are in within Terminal type something similar to the following, you will have to change it based on what you have installed on your computer.

cd /Users/James/Stuff

This should change the folder to something more manageable for this quick demo. Then copy and paste the following line.

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

This opens and runs a small program called tree, it analyzes the folders and sub-folders and graphs them on screen.

Pretty cool if you use Terminal a lot. I don’t so it isn’t that much use to me.

If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips