Compsmag is supported by its audience. When you buy through links on our website, we may earn an affiliate commission fee. Learn more

Using Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

Using Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

Check tutorial of Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

So after a lot of requests from our users here is a guide about Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal.

Mac users with a unix background may appreciate to know how to implement the equivalent of the Unix “tree” command in macOS and Mac OS X. There are actually a few different ways to display a folder tree in Mac OS X’s Terminal, we’ll go through a simple boomequivalent handle that is reached through an alias, just like how to install native ‘tree’ on a Mac, just like you see in Ubuntu or elsewhere in Linux.

This is clearly intended for command line users, but if you spend more time in the Mac’s Finder you would appreciate having files and folder contents there recursively, which can be similar, but clearly no folder tree on the Terminal shows.

Create a tree equivalent to folder trees in Terminal for Mac OS X.

With a simple alias, you can view directory trees from the Mac OS command line:

  1. Launch Terminal or iTerm if you haven’t already
  2. Open your .bashrc or .zshrc profile in your favorite text editor, we use nano because nano is simple:
  3. nano .zshrc

  4. On a new line, paste the following alias:
  5. alias tree = ”find. print | sed -e ‘s;* /; | ____; g; s; ____ |; |; g ‘”

  6. Hit Control + O and Control + X to save and exit nano (or quit vim or emacs as usual), your folder tree printing command is now ready to use

View the folder tree on the Mac with the tree alias

Open a new Terminal or reload your Terminal profile and you are ready to use the new one boomalias.

Directory tree with ‘boom’on the Mac

Now that your alias has been implemented, you can ‘boom’command to show the hierarchical structure of the current working directory or directory on the command line. For example, if you are at the root / of a Mac and press’boom’displays the hierarchical structure of everything on the Mac (this takes a while and is not recommended, but provides a demonstration of how it works)

boom

The tree command is really best used in subdirectories with some level of containment, otherwise you will dump the entire file system structure out of the current working directory.

Macboom-equivalent command line shows folder structure

Install ‘Tree’ for the Mac command line

If you have some more control over ‘boom’like the ability to specify a folder, or if you just want the exact’boom’equivalent that comes from the unix world, you can use homebrew or macports to edit the boom Install directly in macOS and Mac OS X:

Install ‘Tree’ with Homebrew:

brew install boom

Install ‘Tree’ with MacPorts:

sudo port installation tree

I prefer Homebrew, but use whatever works for you. Once installed from either, typing ‘boom’show the folder tree of every folder on the Mac.

Note: To avoid conflicts, you don’t want to use an alias in the tree structure in the first step and then install the tree command as well. You can implement both, but you probably want to rename the alias to ‘treed’ or something similar.

Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal Guide is free?

Starting from: Free
This guide is a free model
Free Trial: May be included, please check on the official site, we mentioned above.
The Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal tutorial price is Free or Freemium. This means you can truly enjoy the Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal guide.

The Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal guide gives you an easy-to-use and efficient management and Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal allows you to focus on the most important things. It’s friendly guide to use maybe you will love it and Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal tutorial can be used on Linux, Windows or android devices.

Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal: benefits

  • The Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal tutorial is free .
  • Helps many users follow up with interest in a timely manner.
  • The price of the Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal guide is free.

Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal: FAQ

Tutorial Summary: Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal

In this guide, we told you about Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal; please read all steps so that you understand Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal in case if you need any assistance from us, then contact us.

How this tutorial helping you?

So in this guide, we discuss the Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal, which undoubtedly helps you.

What is actual time in which this method complete?

The time to complete the Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal tutorial is 10+ minutes.

What are the supported Device?

Apple

What are the supported Operating system?

mac OS


Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal Tutorial: final note

For our visitors: If you have any queries regards the Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal, then please ask us through the comment section below or directly contact us.
Education: This guide or tutorial is just for educational purposes.
Misinformation: If you want to correct any misinformation about the guide “Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal”, then kindly contact us.
Want to add an alternate method: If anyone wants to add the more methods to the guide Using a Mac Equivalent of Unix “tree” Command to View Folder Trees at Terminal, then kindly contact us.
Our Contact: Kindly use our contact page regards any help. You may also use our social and accounts by following the Whatsapp, Facebook, and Twitter for your questions. We always love to help you. We answer your questions within 24-48 hours (Weekend off).
Channel: If you want the latest software updates and discussion about any software in your pocket, then here is our Telegram channel.

Compsmag