Mac OS x terminal uses the tree command column directory

Source: Internet
Author: User

[Turn]http://blog.csdn.net/jeanphorn/article/details/46550619

1. Description of the problem

It is believed that many users who have used Linux have used tree commands, which can display the directory structure as clearly as the Windows File Manager. But there is not the system itself, if necessary, Ubuntu can be installed under the following command.

  sudo apt-get install tree



So in Mac OS X system if you want to use tree This command, you can refer to the following solution.

2. Solution

First, go to the home directory (available commands cd $home ), use the VIM command to create a . BASHRC file, and add the following line of code inside it:

  alias tree="find . -print | sed -e ‘s;[^/]*/;|____;g;s;____|; |;g‘"

After saving the exit, use the source .bashrc command to update the script resources, this is again under the terminal to try the tree command, see if it is successful!! ^_^
  

Mac OS x terminal uses the tree command column directory

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.