- how to show or display hidden files in linux
- ls command
- dir command
- KDE File Manager (dolphin)
- Gnome File Manager (files or nautilus)
- Xfce File Manager (thunar)
- Midnight Commander
- Hide Folders and Show Hidden Files in Ubuntu Linux
- Show hidden files in Linux terminal
- Display hidden files in the file manager (for desktop users)
- Hide files and folders in Ubuntu
- Bonus Tip: Hiding multiple files and folders without renaming them (valid for GUI only)
- Hide it or lock it?
- How to see hidden files and folders in the Debian
- View hidden files using the command-line
- View hidden files by using the GNOME Filemanager
- Using the Keyboard shortcut
This post and this website contains affiliate links. See my disclosure about affiliate links.
how to show or display hidden files in linux
In Linux, as you should already know, there is the concept of hidden files and hidden folders. It is not exactly hidden in the literal sense, but all that means is that the file managers and file system utilities will not display these types of files (or folders) by default.
- These files are usually a mechanism to store user preference or system files that are not modified by user regularly.
- They are also used by different utilities to store configuration and state of the programs. As these files are not actively used by user on a normal day-to-day basis, it makes sense to hide them in most cases.
- It also allows the file manager utilities to prevent cluttering up the user interface and provide a soft division between user files and user specific configuration files.
Any file or folder whose name start with a dot (.) is a hidden file, also known as dot file. These files will not be displayed by default when listing the contents of a folder. These files can be referenced just as any file, by using the name of the file (including the dot).
We will see how you can view these files using the most popular directory listing commands and file managers.
ls command
The ls command is probably the most used command line utility and it lists the contents of the specified directory. In order to display all files, including the hidden files in the folder, use the -a or –all option with ls.
This will display all the files, including the two implied folders: . (current directory) and .. (parent folder). If you want to omit the display of these two folders, then use the -A or –almost-all option.
This is quite useful, if you are using the output of the command as input to some other script. You probably do not the script to loop in the current folder (depending on the script).
If you want to display only the hidden files, then you will need to specify a regular expression with the ls command., the following will display just the hidden file and folders.
The -d option is to ensure that the directory contents are not printed out for each directory in the list.
dir command
Another popular command used to display directory contents is dir. Almost all options for dir is the same as ls, which means everything that was shown for ls in the previous section will work for dir as well.
will display all files, hidden files and the implied folders (. and ..).
will display all files, folders including the hidden folders but excluding both . and ..
will display just the hidden files and hidden folders.
KDE File Manager (dolphin)
The default file manager in KDE is Dolphin. The default setting in Dolphin is not to display hidden or dot files. There are couple of different ways you can enable the option here.
The easiest is probably the keyboard shortcut Alt+. (Alt and dot). You can easily enable the display and disable it again using the same shortcut.
The other option is using the menu option. Click on the Hamburger icon on the menu bar (for Settings/Configuration). In the drop down menu, you will see the option named Show Hidden Files. Click and select it on it to enable the display of hidden files.
You can leave that option selected, if you want to always display the hidden files. The other commonly used file manager is Konqueror, which uses embedded dolphin to display the file system, as well.
Gnome File Manager (files or nautilus)
The default file manager in Gnome on most distros is Gnome Files. It was formerly known as Nautilus. The keyboard shortcut to display hidden files in Nautilus is Ctrl+H. This shortcut can be used to toggle the display of dot files.
The other option is to change it in the configuration. Open Edit -> Preferences and navigate to the Views tab. Select the option Shown hidden and backup files. In modern or latest versions, this option is in Files -> Preferences menu.
Xfce File Manager (thunar)
Xfce is a popular light weight desktop environment, and the default file manager is thunar. The keyboard shortcut is display hidden files is again Ctrl+H just as with Gnome File Manager.
You can find the option with in the menu as well, as with other file managers. Click on View in the menu bar, and select Show Hidden Files option.
Midnight Commander
Midnight Commander is a command line based file manager which has a loyal following. The keyboard shortcut to display dot files here is Alt + . (Alt-Period).
There is also a configuration setting with in Panel Options. Open Options from the menu and then Panel Options. Select the option Show Hidden Files.
No matter which file manager you are using, there should be an option to display hidden files. Most times, it is disabled by default and as it should be. You can try first by right clicking and checking the context menu. The next place to check is either the Settings or Preferences dialog which is often in the Edit or View menu.
As the last resort, read the manual.
Hide Folders and Show Hidden Files in Ubuntu Linux
Wondering how to see or hide files in Ubuntu Linux? Its damn easy to do so. Here’s how to show hidden files in Ubuntu and other Linux distributions.
You are probably 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 Linux terminal
If you are in a terminal, you can use the ls command to display all the files, including the hidden ones:
You can recognize the hidden files and folders with the dot (.) before their names.
You can also use the -A option of the ls command to show hidden files but without the . and .. files.
Display hidden files in the file manager (for desktop users)
If you are in the file manager, you can use the Ctrl+H keyboard shortcut in Ubuntu and I presume other distributions also display all the files, including the hidden ones. Pressing Ctrl+H again will hide the files. 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 (Ubuntu’s counterpart of Windows Explorer and the default is Nautilus). Now go to the top-right hamburger menu → Show hidden files:
Hide files and folders in Ubuntu
Now that you have learned to see hidden files in Ubuntu, let’s now see how you can hide files and folders in Linux. In Linux, if a file name starts with . (dot), it is considered a hidden file. Now if you want to hide a file or folder, let’s say MyFolder, just rename it to .MyFolder and it will be taken as a hidden file or folder. I hope you know how to rename files in Linux command line using mv command.
If you are using a Linux desktop, right-click and choose the rename option and add the dot before the name. 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.
Bonus Tip: Hiding multiple files and folders without renaming them (valid for GUI only)
This is a neat little trick that will let you hide several files and folders from the normal view in your desktop Linux’s file manager. Traditionally, if you create a new file named .hidden and add the name of the folders in this file; those folders will be hidden from normal view when you close your file manager and open it again. Keep in mind that this trick works with only the current directory you are in. It won’t work for nested directories. You can create the .hidden file in any directory to hide files and folders in it.
Hide it or lock it?
This .hidden file is one of the many lesser-known tweaks of the Nautilus file manager. Here are a few more. This was about hiding files in Linux. There are separate methods for locking a folder in Linux. I hope you like this little bit of Linux knowledge.
How to see hidden files and folders in the Debian
Sometimes, we have to keep some files hidden it can be done for different reasons like when we have important files and don’t want others to see it, or to prevent it from accidental deletion especially when we are sharing our system with other users. Some OS files are also kept hidden by default by the OS as they are critical for the functionality of the system. Any changes or accidental deletion of these files can lead to major errors or even cause applications to stop functioning. However, sometimes we need to access these hidden files for troubleshooting or some other reasons. In this article, we will explain how to see hidden files and folders in the Debian File browser using the following ways.
We have run the commands and procedures mentioned in this article on a Debian 10 OS.
View hidden files using the command-line
Normally ls command is used for displaying files in a specific directory. But once the ls command is combined the –a option, you can use it for displaying the hidden files too.
Open the Terminal application by going into the activities tab on the top left corner of your desktop. Then in the search bar, type terminal. When the Terminal icon appears, click on it to launch it. Now in the Terminal, execute the following command:
In the following output, the files starting with dot (.) character are hidden files.
View hidden files by using the GNOME Filemanager
Hidden files can also be viewed within a file manager. Open the file manager from the Activities menu on the top left corner of your desktop. Once the file manager is open, go to the view menu in the top right corner of its window. From the menu that appears, check the box next to the option Show Hidden Files.
Now you will be able to see the hidden files and folders in your File manager. In the following screenshot, the files starting with dot (.) character are hidden files.
Using the Keyboard shortcut
There is also a default shortcut available for viewing the hidden files in the Linux file manager. Open the file manager and simply press Ctrl+H and you will be able to see hidden files starting with (.) character along with the regular files. In the following screenshot, the files starting with dot (.) character are hidden files.
That is all there is to it! I hope it will be helpful whenever you need to access the hidden files and folders in a Debian OS.