How to create hidden files in Linux?

前端 未结 8 869
悲哀的现实
悲哀的现实 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条回答
  •  不思量自难忘°
    2021-01-22 17:00

    There are no hidden files on Linux. Some tools don't show files starting with . as others already mentioned.

    Anyway, you can experiment with putting control characters like new-line into the filename. See Control characters in filenames are a terrible idea:

    Some control characters, particularly the escape (ESC) character, can cause all sorts of display problems, including security problems. Terminals (like xterm, gnome-terminal, the Linux console, etc.) implement control sequences. Most software developers don’t understand that merely displaying filenames can cause security problems if they can contain control characters. The GNU ls program tries to protect users from this effect by default (see the -N option), but many people display filenames without getting filtered by ls — and the problem returns. H. D. Moore’s “Terminal Emulator Security Issues” (2003) summarizes some of the security issues; modern terminal emulators try to disable the most dangerous ones, but they can still cause trouble. A filename with embedded control characters can (when displayed) cause function keys to be renamed, set X atoms, change displays in misleading ways, and so on. To counter this, some programs modify control characters (such as find and ls) — making it even harder to correctly handle files with such names.

提交回复
热议问题