Linux / Unix: Find Hidden Directories, Files and Folders

last updated in Categories

I‘m a new Unix user and trying to find the hidden directory called .movies but I do not know where it is on the file system. How do I find a hidden folder or directories under Unix like operating systems?

You can use the find command to locate files. The syntax is:

find /path/to/search -name "folder"
find /path/to/search -name "dir1"
find /path/to/search -name ".dir2"
find /path/to/search -name "filename.txt"
find /path/to/search -name "dir*"

Open the command prompt (bash shell). To search the hidden folder called .movies in your own home directory, enter:

find $HOME -name ".movies"

Or

find ~ -name ".movies"

To search the entire hard disk, enter:

su - 
find / -name ".movies"

OR use sudo directly

sudo find / -name ".movies"

To match case insensitive directories name i.e. find .movies, .Movies, .MOVES and so on, enter:

sudo find / -iname ".movies"

Get 15% off on Linux Foundation certified SysAdmin, Progamming, Kubernetes/Containers and Open Stack certification & course. Use "SPLASH15" coupon code. Offer expires on August 27, 2018
training.linuxfoundation.org

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

1 comment

  1. For those systems that support it (most), the ‘locate’ command is very fast, since it uses a hashed database of locations which is updated nightly.

    Have a question? Post it on our forum!