Once installed from either, typing ‘tree’ will display the folder tree of any directory on the Mac. My preference is towards Homebrew but use whichever works for you. If you want a little more control over ‘tree’ like the ability to specify a directory, or you just want the exact ‘tree’ equivalent that comes from the unix world, you can use homebrew or macports to install tree directly in macOS and Mac OS X: Installing ‘tree’ for the Mac Command Line The tree command is really best used in subdirectories with some level of containment otherwise you’ll be dumping the structure of the entire filesystem outward from the present working directory. For example, if you’re in the root / of a Mac and hit ‘tree’, you will display the hierarchical structure of everything on the Mac (this will take a while and is not recommended, but offers a demonstration of how it works) Now that you have your alias implemented, you can use the ‘tree’ command to show the hierarchical structure of the present working folder or directory at the command line. Showing Directory Tree Structure with ‘tree’ on the Mac Open a new Terminal or reload your Terminal profile and you’re ready to use the new tree alias. Hit Control+O and Control+X to save and exit out of nano (or quit from vim or emacs as usual), your tree command for printing directory trees is now ready to use.On a new line, paste the following alias:Īlias tree="find.zshrc profile in your preferred text editor, we’re using nano because nano is easy: Launch Terminal or iTerm if you haven’t done so already. Terminal for macs for mac os#Make a tree Equivalent to View Folder Trees in Terminal for Mac OS XĪ simple alias will allow you to view folder trees from the command line of Mac OS: This is obviously aimed at command line users, but if you spend more time in the Finder of the Mac you might appreciate listing files and folder contents recursively there, which can be similar but is obviously not displaying a directory tree at the Terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |