How do Linux systems hide folders and files?

Source: Internet
Author: User
Tags parent directory python script in python

This method is suitable for all Linux systems. Although it was carried out under Fedora. We all know that Windows can change the hidden nature by setting the properties of the file. So how do you do it under Linux? This article describes how to hide and display files and folders.

1, first show how to hide folders. (The file and folder methods are exactly the same, and the following is omitted.) If there's a Pythonar directory in your home directory, there's a folder called "Invisible."

2, then click it, rename it with F2 (or Fn + F2), and then press the home key to enter a decimal (.) At the front.

3, then, click Home, and then click Pythonar back to the previous "invisible" location. Sure enough, the folders are gone.

4, on the display of hidden folders, you can use the relevant settings for file browser. But it's too much trouble to do it at the terminal. So now please open the terminal. Enter the Pythonar directory.

5, and then use the command: LS-A, to display all the contents of the directory. You'll see. " .. . Can't see "three things." The first represents the current directory, and the second represents the parent directory. The most important is the third, it is your hidden directory.

6, use MV command to rename it:

mv. Can't see, see

So it is not only visible, but also renamed.

7, back to the previous directory, you can see the folder back.

PS: You can use the command Nautilus ~/pythonar to cut back from the terminal to the directory.

8. Conclusion:

This is a bit of a hassle for files/folders that often need to be hidden/displayed. It can be done by writing a shell script or Python script. However, most of the time, you can use this method to hide a file.

Note: about how to implement "SEC display" in Python to hide/display a file, if you need, please leave a comment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.