Questions tagged [tree]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
40 views

ls to recurse, showing full path

There are obviously many ways to do the same job in Linux, but I recently needed to for i in xxx through a list of each item, recursively in a tree. I found a solution with tree by doing tree -fail (...
0
votes
1answer
13 views

tree: Is there a way to maintain visibility of outer level directory labels when scrolling?

When you generate a tree for a large directory base with innumerable sub-directories and associated files, with -a option, often you get a large file with thousands of lines. While traversing the tree ...
0
votes
1answer
40 views

How to detect which files are created when running a command

I'm trying to understand what files or build artifacts are created by the build system of a C++ project. There are 3 steps to building this project: ./autogen.sh ./configure make Is there a way I ...
-1
votes
1answer
62 views

Directory structure for large amount of files [closed]

I have millions of files which filenames are SHA256 hashes of the content. Due to performance reasons I do not want to store them in a single directory. My idea is to have directory structure based on ...
0
votes
1answer
51 views

How to use tree with grep and find to locate files by name?

How can I use tree and either grep or find in conjunction to find, for example, csv files using ".csv" as a file extension: ├── ./Videos ├── ./vscode │   ├── ./vscode/foo.csv │   ├── ./...
1
vote
1answer
56 views

Efficiently turn a directory tree into a new filesystem on zfs

I "inherited" management of a system, whose "/opt" (and some other large directory trees) are stored in the root file system. My wish now is to create a new filesystem in the rpool ...
0
votes
1answer
51 views

Print only files, directories containing files and empty directories

I am trying to index some LTO tapes (and some hard disks as well) and would like a simple output, stored in a text file. Something like the example below: ... /home/norg/Desktop/empty\ dir/ /home/norg/...
1
vote
0answers
145 views

Show files modified after a particular date ('find') in hierarchical format ('tree')

I'm trying to view files modified before or after a certain date using the hierarchical output of the Unix tree command. For example, I know that one can use tree to sort files chronologically and ...
0
votes
1answer
96 views

How to find files greater than a size in linux [duplicate]

I want to find user, size, modified date and full file path of all files in sub-directories starting from a dir. I have got to following so far: nohup sudo \ tree /work/mydir \ -sufiD \ --noreport \ --...
0
votes
2answers
112 views

Tree structures and directories [closed]

I need to draw the tree structure of the following code. cd /; mkdir a b c a/a b/a; cd a; mkdir ../e ../a/f ../b/a/g; cd../b/./; mkdir /a/k a/b ../a/./b /c I know that: cd /; (goes to root) , mkdir ...
3
votes
1answer
261 views

`tree` horizontal display

Is there an alternative to tree command (or some way using the tree command itself) to print the directory structure horizontally? Quite often, I have a tree structure, for which I have to scroll a ...
0
votes
2answers
210 views

What is a “path name component”? [duplicate]

I am not sure I correctly understood what is a path name component (or perhaps better written; path name-component) which I understand to be commonly abbreviated simply as "component" in the Unix &...
1
vote
2answers
32 views

What is the most basic “depth” of any “container file”?

I use the term "container file" to describe any file which practically contains one file or two or more files. Some examples would be a tar archive or a directory. Let's say I open a tar archive with ...
0
votes
5answers
2k views

How to draw a continuous line in terminal?

I've been searching for this for a while and didn't get a satisfactory answer for it. I've taken this screenshot from the output of Gnu/Linux's tree command. I want to know how to draw or print ...
2
votes
3answers
122 views

List files recursively, in alphabetical order and without lines that show exclusively folder names

How to list files recursively, in alphabetical order and without lines that show exclusively folder names? For example, I can get the following output with tree --dirsfirst -fihan * -o filelist: 00.-...
2
votes
2answers
156 views

Easiest way to get `+` indented `tree` output

I need to replace indentation in tree output with + signs so that instead of this: $ tree --noreport dir dir ├── dir1 │ ├── file1 │ └── file2 └── dir2 ├── file1 └── file2 it'd print this:...
1
vote
1answer
64 views

Confused about “tree” not finding a file

Why the last tree is not finding fstab? tree /etc -P fstab --prune /etc └── fstab 0 directories, 1 file . tree /etc -P fsta* --prune /etc └── fstab 0 directories, 1 file . tree /etc -P *...
2
votes
1answer
208 views

du + tree command (without tree installation)

is there a nice way to combine: ls -R | grep "^[.]/" | sed -e "s/:$//" -e "s/[^\/]*\//--/g" -e "s/^/ |/" (displays directory as tree) with du -h ... (for each listed dir) Without installing any ...
1
vote
2answers
919 views

Exclude subdirectory pattern for the tree command not working

I'm trying to use the tree command to list my current git directory. I want to exclude every files that match a gitignore pattern. The solution found here seems promising. Unfortunately it seems ...
0
votes
1answer
39 views

Copying files from specific subsubdirectories based on subdirectory name into single directory then renaming

So here's an excerpt of my directory tree: |-- 20070214_014700.a | |-- info | |-- processed | |-- HH.EL..BHZ | |-- AZ.AS..HHZ | |-- (hundreds more) | |-- raw | ...
0
votes
1answer
24 views

How to get an output results as text to more than one location at once? [duplicate]

Is there a way that I can get a resulted output to multiple locations at the same time. ls -RsgorCh >> /Users/User1/Text1.txt will print the output as a text file in the given location. I want ...
-1
votes
2answers
187 views

How to shorten image sequence output in tree command?

I'm in a directory where running tree command produces something like this: ├── directory1 │  └── image_sequence │  ├── image.0001.jpg │  ├── image.0002.jpg │  ├── image.0003.jpg │  ...
0
votes
1answer
1k views

Using tree with tar.gz file without extracting contents

I am wondering if it's possible to output the contents of a tar.gz file using tree without having to extract the contents of the file to a temp directory then using tree with that directory. I know ...
2
votes
2answers
297 views

How to convert `iptables -S` output to a breadth-first listing

I'm looking for a program that takes the output of iptables -S and converts it to a breadth-first listing. Why? I'm doing some work on a router using VyOS where several layers of tables are pre-...
3
votes
1answer
246 views

Command “tree” vs “tree -R”

So I'm asking myself why there is the "-R" argument for the "tree" command. The manual says "-R Recursively cross down the tree each level directories ...", but I don't see any difference in the ...
2
votes
1answer
521 views

pipe of tar and tree commands?

I would like to see the tree of a big compressed file (specifically only the second level of directories) so I used the following command: tar -tf tarfile | tree -L 2 But it outputs the tree of the ...
3
votes
1answer
1k views

Why can't tree fully list /sys/class/hwmon? And how could I do that?

If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree ...
0
votes
0answers
24 views

Ambiguous output from tree with respect to symbolic links

Whenever I use command line tools, I like to make sure that the output can be interpreted unambiguously. On one of my other machines, I wrote a shell script that would find all of the symbolic links ...
2
votes
1answer
223 views

tree(1) colours not properly interpeted by watch(1) even with --color option

I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree. Except I want colours and can't get it. Here's what I thought should work: watch --color 'tree -...
0
votes
2answers
139 views

Directory tree listing, script does not work in csh?

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' I found a command to display directory tree (see above), it didn't work correctly. It gave error message "...
1
vote
1answer
5k views

Tree command package installation?

I tried to use the tree command in a bootable USB Ubuntu environment but it showed that it is not installed so I tried sudo apt install tree, but it didn't work and reported that it was unable to ...
5
votes
4answers
3k views

Linux Filesystem Tree

Is there a pictorial representation of Linux filesystem, to understand the Linux filesystem. Currently running Ubuntu 16.04 and I want to efficiently re-install, using 2 HDD, 1x250GB and 1x500GB. ...
0
votes
1answer
80 views

How to enable automatically colorize the output of tree without using -C flag in bash all the time?

I am tired of using the -C with the tree all the time. I would like to tweak the tree to colorize files and directories to its automatic behavior so that I don't have to type the -C flag all the time. ...
1
vote
2answers
72 views

Replace fenced block with output of command in bash

I'm attempting to replace a "fenced" block of text with the output from the tree command in linux (specifically in a make file). Here's my input file: some text... [fencetitle] ---- . ├── file1.txt └...
1
vote
1answer
411 views

Make a visually better looking tree [closed]

I am trying to visually show the tree structure of a directory. I know about the tree command and that works for me, but is there a program that takes the tree command output and makes it a bit more ...
2
votes
0answers
88 views

Exclude sub-directories from tree output [duplicate]

I would like to document a directory structure, and installed tree to do so. I don't wish to include files but only directories and symbolic links which point to directories (haven't decided if the ...
1
vote
1answer
44 views

Copying a tree with modes

Suppose my build script creates something like: build ├── [drwxr-xr-x pskocik pskocik ] bin │   └── [-rwxr-xr-x pskocik pskocik ] FOO_bin ├── [drwxr-xr-x pskocik pskocik ] include │   ├── [...
0
votes
1answer
393 views

Create 'tree' output from list of files

I have a large list of directories and filenames in the format drwxr-sr-x hamiltont/hamiltont 0 2015-03-11 23:54 Archive/Directory One/Subdir/ -rw-r--r-- hamiltont/hamiltont 21799 2014-01-10 12:52 ...
5
votes
2answers
3k views

How to combine tree with the directory size?

I am trying to print the space occupied by directories (two levels down). The size listed is not accurate. For instance large_child_folder is 150 GB. How do I get the real directory size? tree -L 2 -...
1
vote
1answer
642 views

Why does 'tree' command ignore directories but not files

tree shows ... │   ├── template_one_file.sh │   ├── template_sed.sh │   ├── testy.sh │   ├── tmp │   │   ├── file1.html.13567_old │   │   ├── file2.html.13567_old │   │   ├── file3.html.13567_old │   ...
0
votes
1answer
333 views

Getting tree to only list files matching a pattern and the directories they are contained in

Is there anyway to get tree to behave such that, when it is run with the -P option, it will not output directories that don't have files matching the pattern somewhere inside of them? As an example, ...
-2
votes
1answer
213 views

What's the difference between the `tree -L 1 /` with `tree -L 1`?

In Linux I use the tree command to show the directory construction. If I use tree -L 1 / in root directory: [root@localhost /]# tree -L 1 / / ├── a.out ├── bin -> usr/bin ├── boot ├── dev ├── etc ...
0
votes
2answers
62 views

Statistics for project filestypes [closed]

I learnt that there was a command cloc to count lines of code. Now I wonder if it the file types are accurate? Should I look a the cloc project to know how file types are detected? The reason I wonder ...
0
votes
1answer
869 views

linux/unix tree diagram

I have a picture of a tree diagram for linux/unix terminal. Just to verify the color scheme, all the blue labels must be folders, the greens are executable, but what are the black ones? Right under ...
3
votes
1answer
1k views

List directory hierarchy with files before subdirectories

I've been trying to sort output with either tree or find, and end up getting about the same results each time of drilling down to deeper directories before files higher up in the tree. What I'm trying ...
1
vote
1answer
170 views

How can i find biggest folders in tree (fastest way)

I'm writing something for backup. And I'm working with really Big files/folders (1 million++, 100TB++) For improve my speed, at least I need to pick 10 biggest folders in tree and for that, I need to ...
3
votes
1answer
380 views

How exactly are files located under the hood? [closed]

As far as I know, once an inode of a file is found, finding the data is trivial - done by accessing a specific location on the disk, which is stored in the inode. The question however is how exactly ...
1
vote
1answer
178 views

Tree operations (find) using indices (inode numbers) to address files/directories

(removed OS mention, since I need 'general Unix/Linux' solution) Task: perform operation over files/directories, in "find way", but assuming that file/directory pathnames can change in process. ...
-2
votes
1answer
55 views

Removing Folders from Linux Tree View?

Question: Is there a way to remove the display of certain folders from the linux tree command? In my case, I'd like to be able to run something like $ tree . --remove-dir=pictures which will remove ...
0
votes
1answer
577 views

How to sort from smallest to biggest with `tree` command line tool?

Which option should be used with tree command line tool to get sort from biggest to smallest? ├── [4.0K] types2 │   └── [ 116] types2.go ├── [4.0K] types3 │   ├── [ 689] types3.go │   └── [ 0] ...