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

Files and folders could set to hidden by prepending a . to its name and could be unhidden by removing the leading .. This is different than it is in Windows as files and folders are visible or hidden based on file/folder attributes rather than the name.

Files and folders could be hidden by renaming it with the pre-prended . using graphical files managers or by 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/
  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.