Questions tagged [tree]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
81 views

Creating files using redirection

I have a task to do for my homework so please help me. I am in a parent directory which itself has 2 directories (let s name them A and B). In this parent directory I have to create a file in B which ...
ioana vlad's user avatar
0 votes
2 answers
223 views

Why does the tree command print NBSP on Ubuntu 22.04

I installed tree v 2.0.2 and in the terminal it displays the output properly but when I send to output to a .txt file it includes a bunch of NBSP ruining the display. It also happens when copying the ...
Dean Schulze's user avatar
0 votes
1 answer
65 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 ...
ntg's user avatar
  • 521
1 vote
1 answer
264 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 ...
BabaG's user avatar
  • 31
0 votes
1 answer
316 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'...
Lhooq's user avatar
  • 103
2 votes
1 answer
203 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 ...
Márton Stark's user avatar
0 votes
1 answer
47 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/~.
Enzo Dtz's user avatar
  • 121
1 vote
1 answer
588 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 ...
NetFool's user avatar
  • 141
2 votes
1 answer
3k 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 ...
Tien's user avatar
  • 33
0 votes
2 answers
516 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 ...
metichi's user avatar
  • 887
1 vote
1 answer
627 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 ...
Yasha Karant's user avatar
3 votes
1 answer
65 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 ...
user37342's user avatar
  • 141
4 votes
1 answer
6k 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 ...
sancho.s ReinstateMonicaCellio's user avatar
3 votes
0 answers
152 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 ...
bzliu94's user avatar
  • 131
0 votes
1 answer
42 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?
Adam Griffiths's user avatar
6 votes
4 answers
14k 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 ...
Sandeep Shiven's user avatar
0 votes
0 answers
65 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 ├── ...
Boris Valderrama's user avatar
1 vote
2 answers
6k 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 ...
cjt's user avatar
  • 143
0 votes
1 answer
925 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 ...
Pedro Morim's user avatar
3 votes
1 answer
20k 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 ...
Francesco Campagna's user avatar
5 votes
2 answers
3k 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 │  ...
Michał Rowicki's user avatar
1 vote
1 answer
268 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.
Jocky Doe's user avatar
  • 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 ...
PanDe's user avatar
  • 101
1 vote
0 answers
462 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 ...
Kalim's user avatar
  • 11
2 votes
1 answer
361 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 ...
Christianus's user avatar
1 vote
1 answer
144 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: #!/...
somejkuser's user avatar
2 votes
0 answers
53 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 ...
mipa's user avatar
  • 21
64 votes
4 answers
40k 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) ...
Sumeet Deshmukh's user avatar
-1 votes
1 answer
480 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 ...
crash's user avatar
  • 1
11 votes
2 answers
18k 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 ...
Edgar Oliveira's user avatar
11 votes
3 answers
3k 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 ...
duhaime's user avatar
  • 618
18 votes
1 answer
9k 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 ...
Bruni's user avatar
  • 10.4k
17 votes
2 answers
51k 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?
betauli's user avatar
  • 191
5 votes
3 answers
12k 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 ...
user avatar
47 votes
1 answer
166k 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?
user avatar
0 votes
1 answer
163 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 ...
j0h's user avatar
  • 14.8k
-5 votes
0 answers
63 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.
OffUser's user avatar
  • 11
1 vote
2 answers
1k 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 ...
cweiske's user avatar
  • 3,307