Hidden files and folders will not be shown by default by file managers such as GNOME Files or Dolphin, or command line tools such as ls. A file or folder is considered hidden if its name starts with a ..

Files and folders could be hidden by prepending a . to its name and could be unhidden by removing the leading . using mv command at the terminal.

Steps to hide and unhide files and folders in Linux:

  1. Launch terminal
  2. List files and folders in a folder using ls.
    $ ls temp/
    file  folder
  3. Rename an existing file by prepending . to its name using mv to hide a file.
    $ mv temp/file temp/.file
  4. Run ls to list files and folders in the previous folder.
    $ ls temp/
    folder
  5. Rename the hidden file by removing the leading . using mv to unhide the file.
    $ mv temp/.file temp/file
  6. Run ls again to list the files and folders in the folder.
    $ ls temp/
    file  folder
Discuss the article:

Comment anonymously. Login not required.

Share!