In Linux, a file or folder is considered hidden if its name starts with a dot (.). Typically, file managers like GNOME Files or Dolphin, as well as command-line tools like ls, won't display hidden items by default.

To hide a file or folder, simply add a . before its name. To unhide it, remove the leading dot. This method is different from Windows, where visibility is determined by file/folder attributes rather than the name itself.

You can hide and unhide files or folders using graphical file managers or the mv command in the terminal.

Steps to hide and unhide files and folders in Linux:

  1. Open the terminal.
  2. Use the ls command to view files and folders in a directory.
    $ ls temp/
    file  folder
  3. To hide a file, rename it by adding a . before its name using the mv command.
    $ mv temp/file temp/.file
  4. Use ls again to see that the file is now hidden.
    $ ls temp/
  5. To unhide the file, remove the leading dot using the mv command.
    $ mv temp/.file temp/file
  6. Run ls once more to verify the file is visible again.
    $ ls temp/
    file  folder
Discuss the article:

Comment anonymously. Login not required.