How to create a hidden file in Bash

sharon Hwk picture sharon Hwk · Jun 28, 2013 · Viewed 14.1k times · Source

What is the bash command to create a hidden file. I want to name it .httName.

I have tried googling for this, but none of the forums suggest any work around for this. I am simply looking for the command to solve my issue. If anyone happen to know the answer please help me out.

Answer

kamjagin picture kamjagin · Jun 28, 2013

Files starting with a dot are by default hidden. You can create it simply by

touch .httName

anyone will still be able to see it using

ls -a

If you want files to be properly hidden, you will have to change folder permissions using chmod. For example

chmod 770 folder_name

will prevent users (except the owner and people in the group) from listing the whole directory "folder_name".