tree
# Also output directories but not hidden files
.
├── Directory1
├── Directory2
├── File1
└── File2
tree -a
# Also output hidden files and hidden directories
.
├── Directory1
├── Directory2
├── File1
├── File2
├── .Hidden_Directory1
├── .Hidden_Directory2
├── .Hidden_File1
└── .Hidden_File2
find -type f
# Files and hidden files
./File1
./File2
./.Hidden_File1
./.Hidden_File2
tree -aifF | grep -v '/$'
# Output files and hidden files
.
./File1
./File2
./.Hidden_File1
./.Hidden_File2
Source : How to make tree output only files?
The -i and -f arguments cause tree to output full paths on each
line, rather than indenting. The -F argument causes it to append an
/ to directory names, which are filtered out by the inverted grep
(grep -v '/$').
man tree
-f Prints the full path prefix for each file.
-i Makes tree not print the indentation lines, useful when
used in conjunction with the -f option. Also removes as much
whitespace as possible when used with the -J or -x options.
tree -dandfindwith-type dfor directories, and you get 2 completely different results as well. The question would be though, which one has the bug? – Terrance Sep 15 '21 at 22:17tree -d306647 and withfind306760. I think I don't start to count manually :-D :) – Márton Stark Sep 16 '21 at 06:32ls -alR | grep -c '^-'to count files and compare the result with tree and find (if you didn't add files to the directory since).tree -ad(also count hidden directories) is equal tofind -type dthat could explain the difference between the two. However, I don't understand whytree /home/bkpoutput is greater thanfind. Is this an automatic backup folder or do you think file count may have change between the two commands? – Gounou Sep 16 '21 at 12:44tree -adandfind . -type dboth come up with different totals. Thefindcommand will usually come up with a lower count though. – Terrance Sep 16 '21 at 13:13