This article mainly introduces the method of hiding files under Linux, which has certain reference value. Friends in need can refer to it. Let’s take a look at a simple method to hide files in Linux.
How to hide files under Linux
1. Hidden files/directories
Hidden files in Linux file systems are the result of a long-standing bug in the Unix operating system. After a while, many people adopted this functionality and considered it a feature. The method of hiding files or directories is much simpler than on Windows. To hide an entire file in Linux, just rename the file and put some text in front of it.
The specific method is as follows:
1) Find a file or directory you want to hide using the file manager and select it .
2) Press F2 (or right-click and select "Rename").
3) Next, place a "." in front of the file name.
Since most file managers hide hidden files by default, the renamed file or directory is now invisible. Note that files placed in hidden directories will also be hidden by default.
2. View hidden files and folders in the terminal
To view these files, first use cd to enter the specific directory where you have hidden files/folders. Next, use the command below to display all files, whether visible or hidden.
ls -a
ls command is used to display all projects in the current directory, but not hidden projects. To view hidden items, the -a parameter is required.
3. View hidden files and folders in the file manager
Use the keyboard shortcut "Ctrl H" Show/hide [hidden files].
This article comes from the PHP Chinese website, Linux system tutorial column, please continue to pay attention to this column for more related tutorials!
The above is the detailed content of How to hide files under Linux. For more information, please follow other related articles on the PHP Chinese website!