Did you ever need to look up a file and had no idea where it could be? Or did you want to know how a directory and its sub-directories are structured, but didn’t have any overview? This is where
tree comes in.
tree you get a nicely looking directory tree, containing the current directory and all the sub-directories.
tree on Arch, use the command:
Handy, isn’t it? But there’s more to it! If you look up the man page you see that, as an example, you can append the
-lflag to follow symbolic links or append the
-fflag to print the relative file path, which is useful if you need the relative path in your code base. Additionally, if you execute
treefor a large directory with numerous sub-directories you may limit the depth of the sub-directory traversal to e.g. 2 levels via the
tree -L 2 .