Yes, absolutely! Creating a hidden file is just like creating a regular file, but you must start the filename with a dot (.).
The easiest way to create an empty file is using the touch command.
Step-by-step:
-
Create the hidden file:
touch .my_hidden_file -
Try to see it with a normal
ls:ls(You won't see
.my_hidden_filein the output.) -
Find it using the
-aoption:ls -a(Now it will appear in the list!)
Why do we use hidden files?
In Linux, hidden files are mostly used for configuration. For example, .bashrc stores your terminal settings. By hiding them, your home directory stays clean and uncluttered, showing only your active project files and folders.
Give it a try in your terminal! Feel free to ask if you have more questions.