I'm trying to rename a file with a hyphen at the beginning of its name and both this:
mv -example-file-name example-file-name
and this:
mv '-example-file-name' example-file-name
result in:
mv: invalid option -- 'e'
bashcommand linelinuxshell
I'm trying to rename a file with a hyphen at the beginning of its name and both this:
mv -example-file-name example-file-name
and this:
mv '-example-file-name' example-file-name
result in:
mv: invalid option -- 'e'
Best Answer
Most GNU/Linux commands allow a
--
option to indicate end of options so that subsequent-
prefixed words are not treated as options.A small test