First of all, when working with any file of file that starts with a dash, that poses a small problem because a dash is used to denote options (like Vi's -r option) and so won't be taken as a filename. The simplest workaround for this case is to just prefix it with a ./
as in vi ./-z
will open the "-z" file in vi without issue. Another common workaround with most software it to put file names after an argument of --
. That is a common separator most software accepts to separate options from non-option arguments like filenames. So, the other approach is to use vi -- -z
. The ./
trick should always work, but --
can be depend on the software to implement it, but it is quite common.
As for that file itself, I would think it's more likely something that was accidentally created when attempting to pass a -z
option to it for whatever reason, but it was taken as a filename, possibly because it was given passed a --
or a >
parameter. If you are concerned about it's contents, a safer option to examine it might be a program like hexdump -C
or xdd
. As you said you have opened it in Vim, it's not too likely it would cause any harm. If you see a bunch of ^@
symbols in Vim, that means the NUL
control character which is just a byte of value zero. That could be from a variety of sources from allocating a file without writing any contents to it to being an empty disk image or similar. If that's all that's in that file, it's basically empty with no real contents.
sudo vim -- -z
doesn't work?^@
.file
command could reveal its origin? I don't know whether it's a good idea to touch it or not, I'm just observing.file
only outputsvirus: data
(renamed-z
tovirus
)sudo vim -- -z file
while you intended to dosudo vim -Z -- file
or something similar?