Skip to main content

Questions tagged [tree]

The tag has no usage guidance.

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

using a .info file for tree where comment should be in the same line as file pattern

I know about the .info file functionality with the tree command and would like to use this in one of my bash scripts. I played around in the terminal and have the following structure: test ...
roediGERhard's user avatar
-2 votes
1 answer
61 views

list tree of a specific proc

I have a command to list the tree of a specific process number. So I did this: ps f -u "${USER}" --pid 1234 -eo command,pid,ppid,tty | awk 'NR <= 1 {print; next} !/awk/ && $0 ~ ...
user avatar
0 votes
1 answer
57 views

Installing tree installed grub - is it something to worry about?

I just installed tree via sudo apt-get install tree and my terminal suddenly decided to update grub. Last week, I installed tree, and a similar thing happened. However, when I restarted my PC later ...
Yimeca's user avatar
  • 3
4 votes
1 answer
213 views

tree command with 'sort=size' seems imperfect

I'm trying to sort by size: % tree -axCF --du --sort=size | grep -e '/$' ├── [ 8658884] 2022-10-09-backup/ ├── [ 5923934] f24-01-22-backup/ ├── [ 5384825] e2023-01-19-backup/ ├── [ ...
Ray Andrews's user avatar
  • 2,527
4 votes
1 answer
441 views

Is there a way to make tree not show the top level?

By default, tree shows this: $ tree . ├── Package.resolved ├── Package.swift ├── Sources │   └── SwiftClientSDK │   ├── OpenAPI.yaml │   ├── SwiftClientSDK.swift │   └── openapi-generator-...
Rick's user avatar
  • 205
1 vote
1 answer
19 views

Tree display hw, hw.cpp & hw.cpp2 in sub-directories

I would like tree to display the hw files in the sub-directories like this: . ├── exp │   └── hw ├── src │   └── hw.cpp2 └── tmp └── hw.cpp $ /usr/bin/tree --noreport . displays all of the files:...
CW Holeman II's user avatar
0 votes
1 answer
84 views

Command "tree -J" returns invalid Json

I gave the command tree -J to my machine, and this is a portion of the output it gave: { "type": "file", "name": &...
Alessandro's user avatar
0 votes
2 answers
751 views

Using 'TREE' for sub-subdirectories

Is it possible to use tree to create several output files without being cd ~/ into the directory I want to create a tree file? For example, I have a directory called parent-dir. Inside of parent-dir ...
linuxuser24569's user avatar
1 vote
1 answer
761 views

tree command to only output file and directory count?

I want to keep only the last line of tree's output or the file+directory count report. Preferably, with the -a switch. An example output I desire: 585 directories, 37722 files Is this possible with ...
Sepp A's user avatar
  • 63
2 votes
0 answers
40 views

Is it possible to colourise the heading lines on bash tree output?

Say I have a directory structure that looks like this: foo |-- bar | |-- 1 | |-- 2 | |-- 3 | |-- baz | | |-- 4 | | |-- 5 | | |-- 6 | | |-- moo | | | |-- 7 | | | |-- ...
Lou's user avatar
  • 225
0 votes
1 answer
46 views

Tree. What is the location of the generated text file?

Ubuntu. Tree. tree -fi /path/to/the/directory >~/file.txt I see the files in terminal but was under the impression that a text file called 'file.txt' would be generated, but I can't find it.
DipSew's user avatar
  • 1
4 votes
1 answer
3k 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 ...
ecjb's user avatar
  • 445
2 votes
2 answers
980 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 ...
m4l490n's user avatar
  • 175
1 vote
0 answers
683 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 --...
DawnSong's user avatar
  • 113
2 votes
2 answers
611 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 ....
Konrad's user avatar
  • 323
3 votes
2 answers
631 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: ...
Diego J. Sanchez's user avatar
-2 votes
2 answers
1k 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?
Salomanuel's user avatar
2 votes
1 answer
685 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 ./...
loneboat's user avatar
  • 241
0 votes
1 answer
342 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-...
MCLooyverse's user avatar
3 votes
1 answer
79 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 ###...
nath's user avatar
  • 5,814
1 vote
1 answer
3k 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 ...
XavierStuvw's user avatar
  • 1,139
0 votes
3 answers
433 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 . ...
WoodrowShigeru's user avatar
0 votes
0 answers
54 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 /...
Ctat41's user avatar
  • 23
-1 votes
1 answer
4k 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 (...
YorSubs's user avatar
  • 641
0 votes
1 answer
32 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 ...
Vinod's user avatar
  • 165
0 votes
1 answer
46 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 ...
justinmoon's user avatar
-1 votes
1 answer
865 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 ...
Petr's user avatar
  • 3
0 votes
1 answer
2k 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 │   ├── ./...
Nicholas Saunders's user avatar
4 votes
1 answer
1k 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 ...
avl42's user avatar
  • 61
0 votes
1 answer
137 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/...
norglis's user avatar
2 votes
0 answers
588 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 ...
altersax's user avatar
0 votes
1 answer
2k 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 \ --...
Abhishek Jain's user avatar
0 votes
2 answers
337 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 ...
Michael Pnrs's user avatar
2 votes
1 answer
1k 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 ...
shivams's user avatar
  • 4,585
0 votes
2 answers
1k 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
89 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
4 votes
5 answers
9k 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 ...
Mahmoud Farouq's user avatar
2 votes
3 answers
1k 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.-...
terminal64's user avatar
2 votes
2 answers
554 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:...
cprn's user avatar
  • 1,025
1 vote
1 answer
216 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 *...
Alex Poca's user avatar
  • 541
2 votes
1 answer
1k 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 ...
xyn's user avatar
  • 23
2 votes
2 answers
3k 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 ...
ogr's user avatar
  • 261
0 votes
1 answer
112 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 | ...
LividNoodle's user avatar
0 votes
1 answer
176 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 ...
Binoyya's user avatar
0 votes
2 answers
746 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 │  ...
Santosh Kumar's user avatar
3 votes
1 answer
3k 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 ...
Schwagmister's user avatar
  • 1,073
2 votes
2 answers
845 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-...
Craig  Hicks's user avatar
3 votes
1 answer
512 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 ...
Denis.Sabolotni's user avatar
3 votes
2 answers
2k 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 ...
Aurelie Navir's user avatar
3 votes
1 answer
2k 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 ...
Stonecraft's user avatar