Linux Tips: View hidden files

Jack Wallen
Apr 16, 2009
Updated • Dec 12, 2012
Linux
|
13

In the Linux operating system, a hidden file is any file that begins with a ".". When a file is hidden it can not been seen with the bare ls command or an un-configured file manager. In most cases you won't need to see those hidden files as much of them are configuration files/directories for your desktop. There are times, however, that you will need to see them in order to edit them or even navigate through the directory structure.To do this you will need to know the correct options (for ls) or how to see them in your file manager of choice.

In this Linux Tips article I will show you how to view hidden files with ls, Thunar, Nautilus, and Dolphin.

LS

If you need to see hidden files using the ls command you need to add the -a switch. But if you just add the -a switch most likely your files will fly by you and you will miss what you are looking for. To avoid this pipe the command through the less command like so:

ls -a | less

The above command will allow you to page through the contents so you can actually see what is there. You can scroll either up or down using the arrow keys or you can scroll down one page at a time with the space bar.

Thunar

Figure 1
Figure 1

If you don't know, Thunar is the file manager for the Enlightenment desktop. In order to see hidden files in Thunar click the View menu and check the Show Hidden Files box (as shown in Figure 1.) Or you can hit the key combination Ctrl-H.

If you use the key combination you must make sure you are focused on the Thunar window. When you set Thunar to view hidden files it will always do so until you unset this option.

Nautlius

Figure 2
Figure 2

Nautilus is the file manager for the GNOME desktop. With the Nautilus file manager viewing hidden files is done in the same way. From the View menu select the Show Hidden Files option (see Figure 2) or hit the key combination Ctrl-H. Like Thunar, if you use the key combination you must be focused on the Nautilus window.

And like Thunar, the hidden file option will stick until it is unset.

Dolphin

Figure 3
Figure 3

Dolphin is the KDE file manager that replaced Konqueror. In order to view hidden files in this file manager you select the View Hidden Files option from the View menu. You can also enable this action by hitting the Ctrl-. key combination. And like both Thunar and Nautilus, in order to use the key combination Dolphin must be in focus or the combination will not work.

Again, like the other graphical file managers, this option will remain until unset.

Final Thoughts

Hidden files are an important part of the Linux operating system. Although you can go your entire Linux lifetime without ever having to view a single hidden file, on that one occasion that you will need to do so, it's good to know how.

Advertisement

Previous Post: «
Next Post: «

Comments

  1. PRasanna Kumar G said on October 6, 2019 at 9:19 pm
    Reply

    Which command can be used to list files and directories along with permissions applied to them?

  2. Anonymous said on March 7, 2019 at 8:00 am
    Reply

    I just tried command ‘ls -a|less’ normal. Thanks

  3. Stevenlai said on November 3, 2018 at 11:22 am
    Reply

    Hello,

    After im press Ctrl-H to see the hidden folder. how to auto close the hidden folder after 5 mint by use command line.

    thank

  4. Anonymous said on October 26, 2018 at 11:43 pm
    Reply

    Hidden files

  5. a said on January 30, 2017 at 3:37 pm
    Reply

    this didn’t help

  6. Yuma Kirkno said on March 3, 2016 at 2:25 pm
    Reply

    Great post!

    You can also search hidden files with find command:

    find /path-to-search -type f -iname “.*” -ls

    Extracted from: http://www.sysadmit.com/2016/03/linux-ver-archivos-ocultos.html

  7. ed said on February 17, 2016 at 6:45 pm
    Reply

    hello!
    i use kali linux 2.0 sana
    my video directory is lost, i don’t know how and i’m amazed that the directories like music,video,photos,documents cannot be deleted, so how is it possible to loose video directory and please guide me to help recover it and fix this problem.

  8. will said on April 7, 2015 at 2:14 am
    Reply

    Wouldn’t rm -rf work also?

  9. andrew prudente said on August 9, 2014 at 4:48 pm
    Reply

    Hi
    I re-loaded the op sys because of a problem but firefox lost all of my bookmarks. I have them backed up on thumb drive but they are all hidden files. How can I replace the ones it installed with my old ones from the thumb drive?

    regards,
    andrew

  10. Daniel said on July 5, 2013 at 9:43 am
    Reply

    This works as well.
    ls -d .[!.]?* | less

  11. hack gee said on September 4, 2012 at 10:39 pm
    Reply

    would not

    ls -al

    be preferable?

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.