tree is a handy little tool to visualise structures in a file system, from the command line. Here’s a basic Django project that we want to inspect:
tree
Tree’s not usually installed by default, but is in most distro’s package managers.
On Debian or Ubuntu based systems:
sudo apt-get install tree
And on Redhat, Fedora or CentOS based systems:
sudo yum install tree
Show only the directories:
tree -d
Show all files including hidden dot files:
tree -a
Limit the level or depth of recursion:
tree -L 2
You can filter files by pattern. It’s not quite regex power, but you can use:
* for none or more characters.
? for one character.
[] for character classes:
tree -P "*s.py"
And, of course, you can mix multiple options together:
tree -daL 2
Tags: Linux
Posted on 06 May 2013. blog comments powered by DisqusRecent Posts:
How to monitor the progress of a dd process, even after it has started.
Monitoring frequency drift on the RTL SDR dongle
High entropy passwords are serious business! Here some little helpers to create better ones.
Running Linux and need to look busy quick? Try this little bit of command line fun :)
Bash scripts and command line examples are often littered with ampersands. Here's what they do.