Many of us are familiar with the concept of “hiding” a folder or file in Windows. Hiding a folder or file just “removes” the folder from the normal view and then you can choose to display “hidden files” to see it.
So how do you see the hidden files in Linux then? Let me show you that.
Show hidden files in Ubuntu & other Linux
If you are in a terminal, you can use the ls command to display the all the files, including the hidden ones:
You can recognize the hidden files and folders with the dot (.) before their names.
If you use desktop Linux, you can still see hidden files easily. Let’s see how.
Keyboard Shortcut in GUI
If you are not a fan of keyboard shortcuts, you can use the file manager GUI to display the hidden folders and files.
To see a hidden file or hidden folder in Ubuntu, go to the file manager (default is Nautilus). File Manager is Ubuntu’s counter part of Windows Explorer.
Now go to the top menu->Show hidden files:
How to hide files or folders in Ubuntu
So when we have learnt how to see hidden files in Ubuntu, let us now see how can we hide a folder. Unfortunately/interestingly, there is no similar way as in Windows to hide a folder. In Windows you right click on a file and choose the option of making it hidden. But this option is not available in Ubuntu.
So, how can you hide a folder in Ubuntu then? Very simple! Using the Linux property of hiding a file/folder. In Linux, if a file name starts with . (dot), it is considered as a hidden file.
Now if you want to hide a file or folder, lets say MyFolder, just rename it to .MyFolder and it be taken as a hidden file. So by adding dot makes it a hidden folder (including all the sub folders and files inside it).
Let us make me one thing clear here. We are not talking about locking a folder in Linux. It is a simple folder hiding. And trust me, even this helps a lot in hiding the ‘special files’ in your computer :)