Listing of Folder and Files structure on a Mac

Following a previous thread: https://discussions.apple.com/thread/5399400

I tried this.

find ~/Documents -print | sed -e 's;[^/]*/;|--->;g;s;--->|; |;g' > ~/Desktop/Tree.txt


However, I am trying to list Folders and Files in an external drive /Volumes/LaCie-2/AUDIOBOOKS

I have tried to substitute ~/Volumes/LaCie-2/AUDIOBOOKS for ~/Documents in the above, and it did not work. I also tried it without the initial tilde and that gave me a listing of files in my main hard drive


Does anyone have a workaround for an external drive? Thanks for any assistance.


iMac 27", macOS 10.13

Posted on Jul 19, 2019 1:55 PM

Reply

Similar questions

4 replies

Jul 19, 2019 4:25 PM in response to BrianForbesColgate

The best tool for what you want is a free, third-party package named tree which you would install via a package manager (e.g. homebrew). It would also require that you have either Xcode, or the Xcode command-line compiler tools in order for the package manager to build tree from its source code. Alot of work to get a tree diagram if you don't already have the required tools in place.


I have some AppleScript code that generates a file and folder hierarchy diagram for local folder structure, and USB mounted drives. It will prompt you for the location, and generate a PDF of the structure.


Because the code is too large (102 lines), the hosting software will not permit my posting it here. I will need to provide it via my Google Drive shared folder location in a follow-up post.


Here is a sample, partial output:



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Listing of Folder and Files structure on a Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.