Re: [SLE] Moving filename with dash (-filename-)
"Jack Barnett" <jbarnett@axil.netmate.com> wrote:
How do you move or copy a filename with a dash in it? The filename lets say is:
-file_name-
when I try a
mv "-file_name-" filename mv \-file_name\- filename mv *file_name* filename mv '-file_name-' filename
Quoting doesn't help. Quoting is for the shell, the command mv still gets an argument starting with a dash.
it thinks the first character of the filename (which is a dash) is giving a parameter over to the move command, and it outputs something like
Command line arguments starting with a dash (upto the first argument not starting with a dash) are interpreted as options. Give mv two dashes (--) to explicitly mark the end of options: mv -- -file_name- filename This works with many other commands, too. Eilert -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Eilert Brinkmann -- Universitaet Bremen -- FB 3, Informatik eilert@informatik.uni-bremen.de - eilert@tzi.org - eilert@linuxfreak.com http://www.informatik.uni-bremen.de/~eilert/ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (1)
-
eilert@informatik.uni-bremen.de