How to create hidden files in Linux?

前端 未结 8 877
悲哀的现实
悲哀的现实 2021-01-22 16:02

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

8条回答
  •  猫巷女王i
    2021-01-22 17:02

    In LINUX Hidden file are start with .(DOT)

    if you create files with starting .(DOT), those files are hidden.

    You can use chmod to set permissions to the file.

    if you set only read only then those cannot be modified in program

    chmod 444 filename
    

    if you want to use this from C-language use system() function to execute this command

    if You use simple ls -alF you can see those files.

    the below files are hidden files In LINUX

    -rw-------  1 root root   27671 Sep 17 11:40 .bash_history
    -rw-r--r--  1 root root    3512 Jul 23 16:30 .bashrc
    

提交回复
热议问题