Files and folders with names beginning with . (a dot) are considered hidden and are not made visible by default in Linux. This means that file managers like GNOME Files or Dolphin, or even command line tools such as ls will not automatically show files and folders with names beginning with ..

Hidden files and folders could be shown at the terminal using the ls command.

Steps to list hidden files and folders in Linux:

  1. Launch terminal
  2. Go to the folder that contains the hidden files or folders.
    $ cd temp/
  3. List normal files and folders in the directory using ls command.
    $ ls
    file  folder
  4. List all files and folders in the directory using ls command, including hidden files and folders.
    $ ls -a
    .  ..  file  folder  .hidden-file  .hidden-folder

    Files and folders with names started with . (a dot) is considered hidden in Linux and other Unix-based operating systems such as *BSDs and macOS

  5. Show more info on the files using the ls command.
    $ ls -la
    total 16
    drwxrwxr-x 4 user user 4096 Oct 31 09:27 .
    drwxr-xr-x 5 user user 4096 Oct 31 09:26 ..
    -rw-rw-r-- 1 user user    0 Oct 31 09:27 file
    drwxrwxr-x 2 user user 4096 Oct 31 09:26 folder
    -rw-rw-r-- 1 user user    0 Oct 31 09:27 .hidden-file
    drwxrwxr-x 2 user user 4096 Oct 31 09:26 .hidden-folder

    . and .. are special folders which refers to current and one-up folder respectively

  6. List files and folders using absolute path.
    $ ls -la /home/user/temp/
    total 16
    drwxrwxr-x 4 user user 4096 Oct 31 09:27 .
    drwxr-xr-x 5 user user 4096 Oct 31 09:26 ..
    -rw-rw-r-- 1 user user    0 Oct 31 09:27 file
    drwxrwxr-x 2 user user 4096 Oct 31 09:26 folder
    -rw-rw-r-- 1 user user    0 Oct 31 09:27 .hidden-file
    drwxrwxr-x 2 user user 4096 Oct 31 09:26 .hidden-folder
Discuss the article:

Share your thoughts, suggest corrections or just say Hi. Login not required.

Share!