How do I create a hidden file?

QuestionsQuestions8 SkillsProDec, 19 2025
0108

To create a hidden file, you simply need to make sure the filename starts with a dot (.).

You can use the touch command, which is the easiest way to create a new, empty file in Linux. Try running this in your terminal:

touch .my_hidden_file

How to verify it:

  1. If you run the normal ls command, you won't see it:

    ls

    (The output will look empty or only show your regular files).

  2. Now, run ls -a (the "all" flag):

    ls -a

    Now you will see .my_hidden_file appearing in the list!

Summary:

  • Standard file: myfile.txt
  • Hidden file: .myfile.txt

It's that simple! In Linux, the leading dot is the only thing that tells the system to hide the file from the default view. Do you want to try creating a hidden directory (folder) as well? The rule is exactly the same!

0 Comments

no data
Be the first to share your comment!