I have a file called -my-file-name.txt
. I'm trying to move it using the mv
command, however it fails because the hyphen in the name is acting like an option.
mv -my-file-name.txt /some/new/folder
mv: invalid option -- 'm'
try 'mv --help' for more information.
How can I work around this?
I've tried the obvious, wrapping in single quotes (''), double quotes ("") and square brackets ([]), but none of these work.
rm
, but the solution is the same formv
, usemv -- -my-file-name.txt /some/new/folder
ormv ./-my-file-name.txt /some/new/folder
. – Kusalananda May 23 '19 at 22:02--help
options – devklick May 23 '19 at 22:08