Many of the delicate system files in Linux are hidden by default. How to Show Hidden Files in Linux? System or application files are typically hidden to prevent unintentional changes.
You will learn How to Show Hidden Files in Linux commands? by reading this guide.
From the Command Line, How to Show Hidden Files in Linux command?
Enter the following command to display all files in a directory, including hidden ones:
ls –a
The current directory’s contents are listed by the ls command. All files, even hidden files, are listed using the -a switch.
To view the regular and hidden files in a directory other than the one where you are currently working:
/etc ls -a
substitute any other directory for /etc.
In a Graphical User Interface, Display Hidden Files (GUI)
If you feel more comfortable working in Gnome, there is a straightforward approach to displaying hidden files (or any other graphical interface).
If Ctrl+h doesn’t work, click the View menu, then check the box to Show hidden files.
Using the Linux Command Line, hide a file or directory
The mv (move) command can be used to mark a file as hidden.
1: Make a test file first. Create a test.txt file that is empty by using the touch command:
press test.txt
2: After that, relocate the file under a new filename to conceal it. The new filename begins with a period (.), indicating that it is hidden:
txt -> test.txt
3: Display the contents of the current directory to confirm the file is now hidden:
ls
4: List the contents now, taking into account hidden files:
ls –a
In the second listing, test.txt should be visible.
A graphical interface can also be used to hide a file.
To conceal a directory, follow the same procedure.
From the command line, create a password-protected, hidden file
1: Begin by making a new text file before using the command line to build a hidden and password-protected archive file:
access test2.txt
2: Then, encrypt and compress that file:
zip test2.txt, zip —encrypt
3: The file’s password must be entered and verified.
4: Next, use the ls command; test2.zip should appear in the file list.
5: Next, enter the following to make the.zip file hidden:
transfer test2.zip to test2.zip
6: To make sure the file is truly hidden, run ls and ls -a.
How to Show Hidden Files in Linux? In the graphical version of Linux, there are more stages involved in encrypting a file.
Now that you know How to Show Hidden Files in Linux? to expose and conceal hidden files. In the event that you have to locate configuration files, these commands can be extremely helpful.
Additionally, data from web browsers, some program caches, and logs can all be found in hidden files.