Home > Article > Operation and Maintenance > How to set up file hiding in linux
In Linux, you can add "." before the file name to hide the file. You only need to rename the file you want to hide. The syntax is "mv file name. file name"; the mv command uses For renaming files, you can use the "ls-a" command to find hidden files.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How to hide files in Linux
1. Hidden files/directories
Hiding files in the Linux file system is a unix operation The result of a long-standing bug in the 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 hide 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" to show/hide [hidden files 】.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to set up file hiding in linux. For more information, please follow other related articles on the PHP Chinese website!