How can we hide the file and folders with the terminal commands? Can we even hide the hard disk partitions?


In the world of Linux, any file or directory that's name starts with a . is considered hidden.

Note that hiding a file or directory is not a measure of security, it's just for convenience, so that unnecessary files such as configuration files don't bother your daily routine. They can be listed easily if you wanted, e.g. ls -lA.

As for hiding partitions, you can use gparted to set a "hidden" flag on partitions. This will hide the partition from operating systems. Note that this can be easily reverted, so don't use this for hiding sensitive data.

If you want to operate on the same disk you're booting from, you might need a live CD/DVD or (preferably) a live USB stick.

If you are looking for security, search this site (or Google) for encrypted folders and partitions.

  • THank you this is simply the best thing I learnt today about linux – sigdelsanjog Aug 1 '14 at 17:24
  • 1
    @algosig I'll just add a funfact: According to Rob Pike, hidden files were an unintended consequence of trying to make ls not show . and ... Essentially, a bug that turned into a feature. – kraxor Aug 1 '14 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.