Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [tree]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
6 views

Autocompletion not working for pass password manager in zsh in linux

I already used pass program for password managing on MacOS with zsh (where the autocompletion worked flawlessly out of the box) and now trying to move on linux on a raspberry pi 4b 4GB, installed zsh ...
user avatar
  • 327
1 vote
2 answers
26 views

How to use the tree command to expand only selected folder(s)?

I'm creating a script that generates a project folder into another folder along with some other module folders. I want to show how the generated project folder structure looks in the final tree but ...
user avatar
  • 166
0 votes
0 answers
14 views

Format the file date according to ISO-8601 in tree -D and accumulate the sizes of files in a directory

It is well known that tree -hD can show the file size with each file or directory and the file change date of each file or directory. However, for a directory, it always shows 4.0K which of course is ...
user avatar
1 vote
0 answers
16 views

tree command how to omit too many subfolders?

I want to preview the structure of a folder with tree -d. However, some subfolder has too many subfolders, which prevent me to preview the whole tree at a glance, so I want a argument such as --...
user avatar
  • 113
0 votes
1 answer
21 views

Creating .info files to be used with tree

man tree1 states: -info Prints file comments found in .info files. See .INFO FILES below for more information on the format of .info files. and further .INFO FILES .info files are similiar to ....
user avatar
  • 273
2 votes
2 answers
51 views

How to create a file for every directory on a tree?

For the following tree structure: . └── dir1 └── dir2 └── dir3 What would be a simple way to create a file (could be empty), for every directory, so the resulting tree will look like: ...
user avatar
0 votes
1 answer
52 views

tree command with icons

We all love the tree command, but it would be amazing to have the icons next to the files, as both the file browser of VSC or Color Ls have. Does anyone know any way to implement it?
user avatar
0 votes
1 answer
45 views

Display `grep -lr` results as a tree

I'm searching a large number of text files which are organized in various subdirectories. I can run a command such as grep -lr foobar ./, and I get results like the following: ./dirA/dirA.A/abc.txt ./...
user avatar
  • 201
0 votes
1 answer
20 views

How Do I Get `tree` to Selectively Exclude Contents of Directories?

I'm using tree on a directory which has -- among other things -- some Audacity projects in it. Each Audacity project is some file X.aup, along side a directory X_data, which contains a few sub-...
user avatar
3 votes
1 answer
62 views

Print structured list to command-line (tree like)

If I have a text-file with a structured list like this: #linux ##audio ###sequenzer ####qtractor ###drummachine ####hydrogen ##scores ###lilypond ###musescore ##bureau ###kalender ####calcurse ###...
user avatar
  • 4,760
0 votes
1 answer
340 views

What does the output `d?????????` in `ls -l` mean? [duplicate]

What is the situation why ls -l returns a list of subdirectories in the form below? d????????? ? ? ? ? ? Subdirectory A tree launched on that directory returns 0 directories, 0 files for ...
user avatar
0 votes
3 answers
44 views

tree command: Can you prevent the formatting dependancy on the final item?

I am using tree and diff to compare a local directory with a USB backup version of the same directory, and to identify noteworthy / discardable differences. $ cd home/dir/ $ tree --charset=ascii -af . ...
user avatar
0 votes
0 answers
40 views

What does this wecho command do?

I found a script that makes a file list. The list looks like this /home/usr/example_directory /home/usr/example_directory/file1.txt /home/usr/example_directory/file2.txt /home/usr/different_directory /...
user avatar
  • 23
-1 votes
1 answer
618 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 (...
user avatar
  • 559
0 votes
1 answer
18 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 ...
user avatar
  • 133
0 votes
1 answer
41 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 ...
user avatar
-1 votes
1 answer
162 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 ...
user avatar
  • 3
0 votes
1 answer
150 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 │   ├── ./...
user avatar
2 votes
1 answer
304 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 ...
user avatar
  • 31
0 votes
1 answer
65 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/...
user avatar
1 vote
0 answers
265 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 ...
user avatar
0 votes
1 answer
493 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 \ --...
user avatar
0 votes
2 answers
147 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 ...
user avatar
3 votes
1 answer
542 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 ...
user avatar
  • 4,368
0 votes
2 answers
422 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 &...
user avatar
1 vote
2 answers
44 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 ...
user avatar
3 votes
5 answers
4k 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 ...
user avatar
2 votes
3 answers
431 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.-...
user avatar
2 votes
2 answers
245 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:...
user avatar
  • 975
1 vote
1 answer
96 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 *...
user avatar
  • 331
2 votes
1 answer
523 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 ...
user avatar
  • 23
1 vote
2 answers
2k 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 ...
user avatar
  • 241
0 votes
1 answer
44 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 | ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
-1 votes
2 answers
321 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 │  ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
2 votes
2 answers
453 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-...
user avatar
3 votes
1 answer
316 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 ...
user avatar
3 votes
2 answers
807 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 ...
user avatar
3 votes
1 answer
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 ...
user avatar
0 votes
0 answers
30 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 ...
user avatar
  • 3,418
3 votes
1 answer
315 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 -...
user avatar
  • 33
0 votes
2 answers
182 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 "...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 13
5 votes
4 answers
4k 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. ...
user avatar
0 votes
1 answer
124 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. ...
user avatar
1 vote
2 answers
111 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 └...
user avatar
2 votes
1 answer
957 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 ...
user avatar
2 votes
0 answers
108 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 ...
user avatar
  • 1,697
1 vote
1 answer
46 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 │   ├── [...
user avatar
  • 26.1k