23

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?

34

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).
  • I read the man page , maybe I somehow skipped it. (accepting answer in 12 mins) – Sumeet Deshmukh May 14 '17 at 10:02
  • 4
    @SumeetDeshmukh I find man pages often cause me to fall asleep before I understand anything :) – Zanna May 14 '17 at 10:03
  • @SumeetDeshmukh man tree the first thing I did after reading your question – Yoginee Pingale May 14 '17 at 10:04
  • 1
    Luckily you can search man pages by typing / and your search term – grooveplex May 14 '17 at 10:19
  • 1
    @grooveplex I never knew that -- did you learn that by typing man less – cat May 14 '17 at 16:36
3

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

gvfs-tree -h

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.