Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 24556  / 3 Years ago, tue, may 11, 2021, 3:59:21

I have a folder tree that looks like this



main/                             
main/34532-23423632-2354/what-i-want/sth/other/blah-blah
main/54634-56345634-3422/what-i-want/sth/
....
main/54356-34225675-2345/what-i-want/


I want it to show the tree up to the folder what I want. Because the folders sth, other and so on contain many other things that are useless.



I just want to see what's inside each folder named xxxx-xxxxxxxx-xxxxx.



Is there any way?


More From » directory

 Answers
5

If you want to display only a list of filenames and directory names, tree command is very convenient.



This is not installed by default, you have to install this:



sudo apt-get install tree


Then, you can see the tree structure by using the below command:



tree -L 2 main/


option -L : will set the directory depth number.



Example screenshot:



enter image description here


[#36988] Wednesday, May 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antoccasiona

Total Points: 430
Total Questions: 127
Total Answers: 131

Location: Netherlands
Member since Sat, Jun 26, 2021
3 Years ago
antoccasiona questions
Sat, Oct 23, 21, 22:34, 3 Years ago
Sat, Sep 24, 22, 09:39, 2 Years ago
Sun, Jan 15, 23, 11:08, 1 Year ago
;