How to create hidden files in Linux?

stack_A picture stack_A · Sep 17, 2013 · Viewed 39.3k times · Source

In my program, I have to make a file hidden in order to avoid removal or modification of the file.

PATH=/etc/
NAME = file

Is there a function in C that will allow me to do that?

Answer

Grammin picture Grammin · Sep 17, 2013

You can just add a . to the front of the file name. Having said that if your goal is to not allow modification of the file change the permissions to something that can't be modified. Something like:

chmod 444 fileName