Most of the time you share your Linux desktop system with your friends or colleagues while you are working at the workplace. So, you need to hide your personal files as well as directories from others. For this purpose, you have to create hidden files or folders that are not visible to everyone. Some Linux users, don’t have enough knowledge to create a hidden file in their system.
In this article, I will provide you a complete tutorial about how to create a hidden file and directory on your CentOS 8.
To make a file and directory hidden, you need to perform the following operations:
$ls
To create a new hidden directory, you will create a directory first by using the following command:
$mkdir .directory_name
You can see the output in the above-mentioned image. We have created a directory with the name ‘.mydirectory’. Here, the ‘.’ is used to create a hidden directory. If you list down the directories and files then, this hidden directory will not be displayed on the terminal.
You can also make an existing directory as hidden. To do this, you need to run the following command on the terminal:
$mv existing_directory .existing_directory
For example, you have a directory name as ‘personal’ in your ‘Documents’ folder. You made this directory as hidden by executing this command "$mv personaldrive .personaldrive". If you will list down the ‘Documents’ folder then, it will not visible in this drive.
Using GUI, you can also make a hidden directory. In CentOS 8.0, from ‘Activities’ you will click on ‘Files’ to select it. You will make a hidden directory to set the name as ‘.personaldrive’.
You can create a hidden ‘.txt’ file using touch or echo command. To make a hidden file you will write the following command on the terminal window:
$touch .file_name
For example, you have created a hidden file with the name ‘.private.txt’ using touch command.
Similarly, you can also make an existing file as hidden. Type the following command to convert an existing file as hidden:
$mv file_name .file_name
For example, you have made a ‘resume.txt’ as a hidden file. Use ‘$mv resume.txt .resume.txt’ command to create a hidden file from the existing file.
When you list down files, it will not be displayed on the terminal.
Using GUI, you can also create a hidden file. You will make a hidden text file with a name as ‘.resume.txt’ or you can adjust it as per your requirement.
You can see the hidden file using GUI as well as from the terminal.
To display the hidden files or folders. You will type the following command on the terminal window:
$ls -a
Or
$ls -al
In the above-mentioned command, you can also view those files that have certain permissions.
Using GUI, you can also view the hidden files. Open the ‘Home’ directory on your CentOS 8.0. You will click the top right icon that is present with a window cancel icon. A dropdown list will be displayed from where you will mark ‘Show Hidden Files’. You can see in the below-mentioned image:
Now, you can view the hidden files on your CentOS 8.0. You can also change permission on a hidden drive for security purposes. Right-click on a hidden drive. Select ‘Properties’ among all options and click on it. A dialogue box will have appeared on your system’s screen.
Click on ‘Permissions’ and change access settings according to your needs.
In this article, we have learned how to make hidden files and directories using the terminal or GUI. You have also learned how to view the hidden files from your CentOS. I hope this tutorial would be useful for you in the future. For more information, in case of any problem, you can do comment in below comment box.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…