Questions tagged [tree]

the command line tool for displaying a directory structure in a tree form

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

find file on/with tree

I really like tree, however would like to combine it with something like find... in particular, I would like to be able to pass to it (or a similar script) as a parameter some file to find e.g. *.c so ...
  • 449
1 vote
1 answer
73 views

How to control output of 'tree -F' command?

I'm using the 'tree' command to create a text file that I parse in Libre Office Calc: tree -ifsD --timefmt "%Y-%m-%d %T" $PWD > dirlist_tree.txt I added the '-F' option to add a '/' to ...
  • 11
0 votes
1 answer
87 views

tree command failing strangely with some patterns [duplicate]

I have the following directory: ❯ tree -p . └── [drwxr-xr-x] dir ├── [-rw-r--r--] a.ml ├── [-rw-r--r--] a.o ├── [-rw-r--r--] b.ml └── [-rw-r--r--] b.o If I try to filter tree can'...
  • 103
2 votes
1 answer
136 views

why is output different of counting files?

I just want to count all the files in a directory. I used two method what I found: tree /home/bkp Whit this method the output is 2177879 file. find /home/bkp -type f | wc -l And with that one is ...
0 votes
1 answer
35 views

My user folder is inside a random folder

Somehow I got the following file structure in ~/ ~ └── todo_app └── ~ I really don't know how this hapenned and how to solve it. cd ~ just goes to ~ and not ~/todo_app/~.
  • 121
1 vote
1 answer
206 views

Can't run command installed with apt after removing the snap of that package

I wanted to install the tree command to look at /var/www. I can ls /var/www and the directories it contains. Permissions on those directories are set to 755. I ran sudo snap install tree thereafter ...
  • 131
1 vote
1 answer
1k views

How to install tree on Ubuntu without sudo right?

I'm using a server of my lab which I do not have sudo right. I want to show tree of specific file, so I want to install tree via apt install tree or snap install tree but it shows error: access ...
0 votes
2 answers
285 views

How can you parse the output of "tree" by levels?

I have a raspberry pi attached to an external hdd as a small NAS for my home. I want to monitor the disk usage by directory, but with how slow the pi and the usb2 connections are and how big is the ...
  • 747
1 vote
1 answer
294 views

Is there a working Xtree or equivalent for 20.04 LTS?

There are times when I want the capabilities of xtree, unixtree, etc., that shows a "graphical" display of a directory hierarchy. I have installed KDE dolphin that more or less has this ...
3 votes
1 answer
56 views

How many files do I have?

If I as root in Nautilus at the top directory open the properties I get: Name: / Type: Folder (inode/directory) Contents: 1 560 503 items, totalling 414,8 GB Trying root@nilx:/# locate * | wc I get ...
  • 121
4 votes
1 answer
3k views

Print size of directory content with tree command, but exclude files from report

I often use du --max-depth=n -h | sort --human-numeric-sort Now I want to use tree, in a similar manner. I found here a partial answer tree -sh --sort=size --du where --du makes tree reporting the ...
3 votes
0 answers
122 views

Explain difference in non-hidden file count when using Nautilus vs. using other tools such as tree and how to independently calculate former count?

I recently have been backing up my files from a laptop and as part of that have opted to move a folder that at first seemed to be of size 107.6 GB from one hard drive to another. As I was copying, I ...
  • 131
0 votes
1 answer
37 views

Recursively count all files ignoring certain directory paths

I want to recursively count all files contained in root ignoring all files contained in the following directory paths: root/*/build root/*/*/*/build how can I accomplish this?
6 votes
3 answers
9k views

Tree Command not working in some directories

I was learning about virtual environments and projects. While watching videos I encountered 'tree command I installed tree and then run it. But it is not working on other partition of my HDD other ...
0 votes
0 answers
56 views

What should I do with a program directory for its installation?

I downloaded a tar of Ovito, now I don't how to continue. The principal idea is to place this in /opt, but is this a good idea? The directory structure is like the following ovito-2.9.0-x86_64 ├── ...
1 vote
2 answers
4k views

Install latest version of tree command

I installed the tree command today on Ubuntu 18.04 using: $ sudo apt update $ sudo apt install tree The version that was installed is: $ tree --version tree v1.7.0 (c) 1996 - 2014 But I see from ...
  • 133
0 votes
1 answer
737 views

Problem with the tree command [closed]

Previously I had installed the tree command with apt and it worked just fine, but then I formatted my PC and used snap because i thought is was the same thing. Now the command outputs weird strings ...
3 votes
1 answer
18k views

apt --fix-broken install [duplicate]

I am new to this. Just got this message below and I cant figure out how to fix it Reading package lists... Done Building dependency tree Reading state information... Done You might want to run ...
2 votes
1 answer
2k views

Show tree of directory with files content

I would like to print out in terminal tree like one below: $ tree -a . └── .git ├── branches ├── config ├── description ├── HEAD ├── hooks │   ├── applypatch-msg.sample │  ...
1 vote
1 answer
212 views

How to update Tree to 1.7

I've installed tree using the command line sudo apt-get install tree but it installed version 1.6 and I need 1.7 Any suggestion how to achieve that appreciate your kind help.
  • 195
0 votes
1 answer
2k views

Possible to collapse the output of tree -h?

I am trying to add a javascript to tree -h output an HTML file that can collapse all the child elements and would only display the parent elements. I find it difficult to do it with JavaScript because ...
  • 101
1 vote
0 answers
335 views

Output disc space of folders as JSON

I want to output the size of folders to a json file with the following command tree -d -JL 3 --charset utf-8 --du $HOME/share >> discspace.json But the command won't output valid json. Instead ...
  • 11
2 votes
1 answer
283 views

Cron turns off the colorization of tree

I made a bash script which can tree a whole directory structure recursively, putting into every directory a HTML file generated by the aha. The script read the list of directories to be indexed. find ...
1 vote
1 answer
119 views

Not listing .gitkeep file in tree listing command and also unrecognized charset

For some reason when I execute this script i created the file .gitkeep does not show in the tree output and also my declaration of UTF8 for charset is incorrect. Here is my current script code: #!/...
2 votes
0 answers
50 views

How to list contents of compressed files in a hierarchy mode?

Consider we have a file named XX.zip Use command zipinfo -1 XX.zip which shows the below content: XX/ XX/X-Data.txt XX/YY/ XX/YY/Zero.txt I wanna below output instead, assume we have extracted the ...
  • 21
50 votes
4 answers
27k views

How do I make *tree* list hidden files as well?

I'm using this package called tree to list sub directories and files in a given directory. It works fine except it doesn't list hidden files. When I run tree in a folder it returns ├── Zodiac (2007) ...
-1 votes
1 answer
347 views

Which Command is faster among ls -R and tree? [closed]

I want to list all the files in all the directories and save them to a text file to keep a record for various reasons. WHAT I HAVE The D Drive and E Drive both consist of over 500 GB of data and ...
  • 1
11 votes
2 answers
14k views

Save result data command tree [closed]

I need to save all of the results of the command tree in a txt file. The objective is to save this data in a data base for later work in php and html. The main objective is to expose the structure on ...
8 votes
2 answers
2k views

Show n files in each directory with tree command

I have the following directory structure: bocoup_data/ ├── text_reuse │   └── v2 │   └── json │   ├── alignments │   └── texts └── topic_modelling └── v2 └── json I'd ...
  • 568
18 votes
1 answer
8k views

How to print the output of tree to pdf without losing the color?

I use the following command to print a directory structure to a file: tree -h somepath/ > tree_of_somepath.txt tree gives a nice colorized output on the terminal, but as expected this cannot be ...
  • 9,675
16 votes
2 answers
44k views

Is there any command line to show tree view directory? [duplicate]

Many tutorials depict tree-view directory to show how they organize their files. Is there any command line to show such view? Is ls capable to do this?
  • 181
3 votes
3 answers
8k views

How do I use tree to show the path to filenames containing a particular string?

I have got a rather large file system, and let's say that I want to find all the files and directories in a certain area of my file system which contain the String ActionListeener, and to do this I ...
's user avatar
37 votes
1 answer
137k views

How to install "tree" with command-line?

How do I install "tree" via apt-get in Terminal? I have been trying to do apt-get update tree but nothing seems to happen. Is it necessary to include sudo in the command?
's user avatar
0 votes
1 answer
152 views

use tree to make sitemap

Time For my daily Ubuntu lulz. i went to make a site map using "$tree public_html/ > tree.txt" ok, looks good in gedit. put that in my site.. and all the pipes and dashes are garbage. .. have a look ...
  • 14.1k
-5 votes
0 answers
62 views

Nautilus tree view [duplicate]

Where is the Nautilus tree view? List view is just not the same as tree view, so please help me to find the tree view option in Nautilus.
  • 11
1 vote
2 answers
900 views

terminal line height for nice "tree" ascii art display

Applications like tree uses some special characters to display ascii art. Unfortunately, gnome-terminal has a line height higher than the characters, giving spaces between the lines. See the ...
  • 3,201