In Linux, many configuration and application state files are stored as hidden entries whose names start with a period (.). Revealing these files enables inspection of application settings, cleanup of obsolete configuration, and diagnosis of unexpected behavior tied to user profiles.

On typical Linux filesystems, any name beginning with a dot is hidden by convention rather than by a special filesystem attribute. Command-line tools such as ls omit these entries by default and expose them only when specific options or glob patterns are used.

Hidden directories can contain sensitive data, large caches, or critical configuration that affects login shells and desktop sessions. Commands below assume a GNU-style ls implementation and operate in a regular user shell; destructive edits to hidden files are outside the scope and should be approached carefully.

Steps to show hidden files and folders in Linux:

  1. Open a terminal on the Linux system.
  2. Navigate to the directory where hidden entries need to be inspected.
    $ cd temp/
  3. List regular (non-hidden) files and folders in the current directory.
    $ ls
    file  folder
  4. Display all entries, including files and folders whose names start with a period.
    $ ls -a
    .  ..  file  folder  .hidden-file  .hidden-folder

    ls option:

    -a, --all
           do not ignore entries starting with .
  5. List only hidden files and folders in the current directory by matching names that begin with a dot.
    $ ls -d .[!.]*
    .hidden-file  .hidden-folder
    -d .[!.]*

    prints directory entries whose names start with a dot while excluding the special .. entry.

  6. Show detailed information for all files, including hidden ones, such as permissions, owner, and timestamps.
    $ 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

    . refers to the current directory and .. refers to the parent directory.

  7. List all files, including hidden ones, for a directory specified by absolute path such as /home/user/temp without changing into it.
    $ 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

    Absolute paths such as /home/user/temp make it possible to inspect hidden entries in other locations without changing the current working directory.

  8. Verify that hidden entries are visible by checking that names beginning with a dot, such as .bashrc or .config, appear alongside regular files when using ls -a or the hidden-file glob pattern.
    $ ls -a | grep '^\.' 
    . 
    .. 
    .bashrc 
    .config
    .hidden-file
Discuss the article:

Comment anonymously. Login not required.