Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

This chapter is from the book

This chapter is from the book

View Hidden Files and Folders

ls -a

Up to this point, you’ve been viewing the visible files in directories, but don’t forget that many directories contain hidden files in them as well. Your home directory, for instance, is just bursting with hidden files and folders, all made invisible by the placement of a . at the beginning of their names. If you want to view these hidden elements, just use the -a option (or --all).

$ ls -a ~/
.            .gimp-2.2       .openoffice.org1.9.95
..           .gksu.lock      .openoffice.org1.9
.3ddesktop   .glade2         .openoffice.org2
.abbrev_defs .gnome          .opera
.acrorc      .gnome2         .padminrc
.adobe       .gnome2_private pictures
alias        .gnome_private  podcasts
[List condensed due to length]

You should know several things about this listing. First, ls -a displays both hidden and unhidden items, so you see both .gnome and pictures. Second, you’ll always see the . and .. because . refers to the current directory, while .. points to the directory above this one, the parent directory. These two hidden files exist in every single folder on your system, and you can’t get rid of them. Expect to see them every time you use the -a option. Finally, depending on the directory, the -a option can reveal a great number of hidden items of which you weren’t aware.

  • + Share This
  • 🔖 Save To Your Account