How to hide a file or folder in Linux?

Hiding a folder is a simple way of keeping prying eyes away from your private documents. From a human point of view it’s a good solution; what you can’t see, you don’t know you want. Encrypting a folder can have the opposite effect. The folder is visible and if access is attempted, the need to enter a password positively shouts the message that someone is trying to hide something. This probably explains why there are so many commercial utilities that claim they can securely hide folders.

Hiding a file is pretty simple in Linux ! Its just one step away 🙂

Steps to hide a folder :

  1. Select the folder you wish to hide and rename it by either clicking F2 in keyboard or by a right click -> Rename..

  2. Add a ‘. ‘ (dot) in front of the name of the folder and press Enter
  3. Press F5 and now you cannot view that folder!

You are done !

Steps to view Hidden Folder :

The following step is used to Show/View the Hidden files.

  1. Just Open the desired directory and press Ctrl+H or Click View->Show Hidden files to view all the hidden files 🙂

  2. You can test to see if hidden files are being displayed by navigating to other folders
  3. You can Rename the folder anytime by removing ‘.’ from the folder name to revert it back to a normal one !

Now you know how to see all hidden folders on your computer in just a click away.The same Steps can be applied for files too !

If you liked reading this post you might want to check out

Will post more articles for newbies to Linux.:-) What are you views on Linux? Do you use Linux? Drop in your comments.

13 Replies to “How to hide a file or folder in Linux?”

  1. ya am using ubuntu10.04,am using xfce environment. can u tell me how to mount windows partition here..

    1. It is not necessary to configure it manually. When you install Ubuntu package, it will be asked whether to access the Windows partition, where you can just check the partition and check ok.

  2. Hey Guys,

    The above technique has just to hide the folder and there may be chance of opening it by “Ctrl+H”. I have got a better idea to prevent even from opening the directory. Only root user can open and view and edit the files in the directory.. Follow the instruction below to achieve that.

    mkdir ~/Test

    cd ~
    sudo chown -R root:root Test
    sudo chmod 111 Test/

    Thats it , Only root can view and edit the folder as said above.

    Have nice linux-tweaking…


  3. Sure, I will explain in detail

    mkdir ~/Test [“mkdir” is to create a new directory in the home folder where you have logged in].

    cd ~ [navigating to the home directory usinf “cd ~”]

    sudo chown -R root:root Test [here, we are changing the ownership of the folder “Test” to root by using chown, “chown”-means chnaging ownership.]

    sudo chmod 111 Test/ [here, we are changing the rules of who to do what, refer for chmod]

Comments are closed.