- 1 year ago
How to add hidden attribute to a file in linux like windows does?
In Linux, you can add a "hidden" attribute to a file by prefixing its name with a dot (.
). By convention, files and directories with names starting with a dot are considered hidden in Linux. Here's how you can create a hidden file:
Open a terminal.
Navigate to the directory where you want to create the hidden file.
Use the
touch
command to create the file and prefix its name with a dot (e.g.,.myfile
):bashtouch .myfile
The file .myfile
will now be hidden in Linux. You can confirm this by running ls -a
to show all files (including hidden ones) in the current directory.
Note that the "hidden" attribute in Linux is more of a convention and affects how file managers and command-line tools display files. It does not provide the same level of privacy or security as the hidden attribute in Windows.