Questions tagged [tree]
The tree tag has no summary.
118 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
9
votes
5
answers
2k
views
Is there a command to recreate directory trees?
I created a 'cron' subdirectory in /var/log/ . It is: /var/log/cron
Within /var/log/cron I've created numerous sub-directories to store my log files for cron jobs. I am wondering if there is a way ...
5
votes
2
answers
227
views
How to show directory sizes in tree format with correct values and depth control
I can't solve what I want using the tree, du, or df commands.
I'm using:
du version 9.6
tree version 2.2.1
What I want:
For the current directory, list all directories recursively to a depth of 3, ...
2
votes
0
answers
173
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
...
-2
votes
1
answer
83
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ドル ~ ...
0
votes
1
answer
123
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 ...
4
votes
1
answer
310
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/
├── [ ...
4
votes
1
answer
543
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-...
1
vote
1
answer
27
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:...
0
votes
1
answer
157
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": &...
0
votes
2
answers
2k
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 ...
1
vote
1
answer
1k
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 ...
2
votes
0
answers
53
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
| | | |-- ...
3
votes
1
answer
175
views
get field from tree with fzf
I've tried something like this
tree -C | fzf --ansi | awk -F'|' '{print $NF}'
├── repo.git/
│ ├── folder/
│ │ ├── subfolder/
│ │ │ ├── output.0
│ │ │ └── traces.1
│ │ ├── ...
0
votes
1
answer
70
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.
4
votes
1
answer
4k
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 ...