How to use “tree” command to list directory with tree structure on Linux


Tree command is a application in UNIX/Linux OS that can help you list all files/directories at specific path directory with the format view of tree style. This command can scan recursively sub directory to find all files for listing. It’s very help ful for you, trust me.

Installing and using command tree command on Linux

1. Installing application command ‘tree’

– Default, ‘tree’ is not installed in Linux/UNIX so you can have it with below steps.


+ Ubuntu/Debian

2. Syntax command


2.1 Basic default mode command

2.1 List include all hidden files

– In default mode of ‘tree‘, it will not list information of hidden files (files begin with dot ‘.‘ of name file). So you can use option ‘-a’ to see that.

2.2 Limit the number sub-directory will be listed (scanned)

– You want to limit the number sub-directory that ‘tree’ will scan information, you can use option ‘-L <number>‘.

2.3 Just list directory, no files

2.4 Manual

– Find more information about this command ‘tree‘ on Linux, use command ‘manual‘.

Now you know additional command like ‘tree‘ to help you list files/directories on server at a specific directory path with beautiful style view is ‘tree‘. Thank you !