Hiding files and folders in Linux reduces noise in working directories without moving or deleting the underlying data. That makes it useful for configuration files, cached state, and helper folders that should stay available but do not need to appear in every normal directory listing.

On most Linux systems, hidden entries are controlled by name rather than by a separate filesystem flag. Any file or folder whose name begins with a dot character (.) is treated as hidden by convention, so standard ls output and many graphical file managers omit it until hidden entries are explicitly shown.

This convention does not protect the entry from access, because a hidden path still opens normally when the exact name is used and permissions allow it. Renaming a live configuration file or application data directory can also break scripts, bookmarks, or service paths that depend on the original name, so test the rename in a safe location before applying it to real data.

Steps to hide and unhide files and folders in Linux:

  1. Create a sample working directory, then add one file and one folder that can be renamed safely.
    $ mkdir -p hide-demo && cd hide-demo
    $ printf 'demo\n' > notes.txt
    $ mkdir -p reports
  2. List the visible entries before anything is hidden.
    $ ls
    notes.txt
    reports
  3. Hide the file by renaming it so the name starts with a dot.
    $ mv notes.txt .notes.txt

    Any file or folder whose name starts with a dot, such as .notes.txt or .config, is hidden from normal listings by convention.

  4. Confirm that the file no longer appears in a normal directory listing.
    $ ls
    reports
  5. Show all entries, including hidden ones, to confirm that the renamed file is still present.
    $ ls -a
    .
    ..
    .notes.txt
    reports

    The -a option tells ls to include dot-prefixed names. Many graphical file managers use the same naming convention when hidden files are enabled.

  6. Hide the folder in the same way by renaming it with a leading dot.
    $ mv reports .reports

    Renaming a directory changes its path immediately, so update any script, bookmark, or service configuration that still points to the old name.

  7. Verify that both entries are now hidden.
    $ ls -a
    .
    ..
    .notes.txt
    .reports
  8. Unhide the file and folder by removing the leading dot from each name.
    $ mv .notes.txt notes.txt
    $ mv .reports reports
  9. Confirm that the entries are visible again in normal listings.
    $ ls
    notes.txt
    reports