59

I'm using this package called tree to list sub directories and files in a given directory. It works fine except it doesn't list hidden files.

When I run tree in a folder it returns

├── Zodiac (2007)
│   └── Zodiac (2007).mkv
├── Zombieland (2009) H
│   └── Zombieland (2009) H.mkv
└── Zootopia (2016)
    ├── Zootopia (2016).mkv
    └── Zootopia (2016).srt

But it should've returned hidden files named .folder.png in each one of these folders.

Can I make it happen?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Sumeet Deshmukh
  • 8,628
  • 11
  • 55
  • 93

4 Answers4

93

Use tree -a

$ man tree
-a     All files are printed.  By default tree does not print hidden files 
(those beginning with a dot `.').  
In no event does tree print the file system constructs 
`.' (current directory) and `..' (previous directory).
Zanna
  • 69,223
  • 56
  • 216
  • 327
  • I looked at the manual. In my case I wanted to list hidden directories but no files. The `-a` flag says _files_. – Sam Hobbs Feb 04 '23 at 22:04
4

Also gvfs stuff are installed in many systems, you can use them too:

gvfs-tree -h
Ravexina
  • 54,268
  • 25
  • 157
  • 179
1

gvfs-tree has been deprecated in Debian and ubuntu systems use

gio tree -h

0

Using tree -a can often be too verbose. Add -L to limit depth if you just need a good overview of the top-level directory structure including hidden files.

tree -a -L 2