How to hide files/directories in the Ubuntu command line/terminal window? How to show hidden files/directories?

Are you new to Ubuntu? Would you like to hide a file or maybe hide a directory? Would you like to see hidden files and directories? No matter which of these challenges you have, the solution is close. This is what you need to do!

Have you ever worked with websites? Have you ever heard of the file named .htaccess? This file is read by robots coming to your website looking for information and it is the first thing they read. This file can be used for redirecting content and also for setting up all sorts of cache rules. But, the important now isn’t whether or not you know the file. But, have you noticed that there is a “.” before the filename, turning it into “.htaccess”? Do you know what the dot in the start means? It means that it is a hidden file. And that kind of gives you an answer to one of your questions already.

How to hide files and directories using the Ubuntu command line?

If you want to hide a file or a directory in Ubuntu, simply place a dot (.) at the start of the name. This will make it hidden and if someone uses a command such as dir or ls, or look through the content in the folders using the GUI, they will not see the file or the directory.

How to hide files and directories using the Ubuntu GUI?

Would you like to do this without using the command line? Simply create a new document or a new directory in Ubuntu and place a dot at the start of the name. Below you can see an example of such an operation.

hidden folder in Ubuntu.

It is easy to hide a file or a directory in Ubuntu. And if is hidden, you will not see it as you look through the content of the folder in the normal way in Ubuntu.

How to show hidden files and directories in Ubuntu GUI?

Have you hidden content, but cannot find it again? It is easy to find it using the graphical Ubuntu interface. Go to the folder you are interested in and set the settings for the folder to show hidden files. If you don’t know where to find it, take a look at the screenshot below.

show hidden files in ubuntu GUI

That wasn’t hard, was it? Now let us take a look at how you can do the same thing in the terminal window.

Show hidden files in the Ubuntu terminal window.

How can you do the same using a simple text command? It is very simple.

Use the command ls-la and you will see a nice list with all files and directories included. Check the screenshot below to see an example.

hidden files and directories in ubuntu command line

There you go.


I have now showed you how to hide files and directories using the Ubuntu GUI and the bash. I have also showed you how to show hidden files and directories both in the bash and in the GUI.

I hope this article has helped you along the way. Should you need more help or have any further questions, please use the comment field below.

Would you like to read more about an awesome VPN for Ubuntu? Click the link for more information!

Leave a Reply