Linux Tips: View hidden files - gHacks Tech News

Linux Tips: View hidden files

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.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

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

    would not

    ls -al

    be preferable?

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

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

  3. 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

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

    Wouldn’t rm -rf work also?

  5. 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.

  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. a said on January 30, 2017 at 3:37 pm
    Reply

    this didn’t help

Leave a Reply

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

Please note that your comment may not appear immediately after you post it.