Possible Duplicate:
What does “--” (double-dash) mean?
Can anybody explain me below things
i have file named "-xyz". if i try to remove or move that file using command line , it's unable to move. i tried below things :
[rahul@srv100 ~]# ls -lrt -- "-xyz"
-rw-r--r-- 1 rahul rahul 0 Dec 19 08:06 -xyz
[rahul@srv100 ~]# mv "-xyz" xyz
mv: invalid option -- x
Try `mv --help' for more information.
[rahul@srv100 ~]# mv \-xyz xyz
mv: invalid option -- x
Try `mv --help' for more information.
[rahul@srv100 ~]# mv -\xyz xyz
mv: invalid option -- x
Try `mv --help' for more information.
[rahul@srv100 ~]# mv '-xyz' xyz
mv: invalid option -- x
Try `mv --help' for more information.
finally i rename that file using winscp, and after trying multiple ways i got one option and it's working.
mv -- '-xyz' xyz
Wish the help of "--", i created file/directory as below
mkdir -- --abc
touch -- -xyz
So my Question is what is this "--" in bash ? Please explain.
--
has nothing to do with bash. In your case, you can also use./-xyz
. – gniourf_gniourf Dec 21 '12 at 09:56