I tried to copy all the files under a directory by simply issuing "cp * /dst_dir", but Shell showed:
~/git$ cp * ~/dst_dir
cp: invalid option -- 'o'
Then issued "ls -1" to list all the files, found the culprit is some files with prefix '-' like below.
-count
-sdds
...
Don't know how these files were generated, moreover I still can't find a way to remove or move these "-xxx" files.
~/git$ rm "-count"
rm: invalid option -- 'c'
Try `rm ./-count' to remove the file `-count'.
Try `rm --help' for more information.
~/git]$ mv \-count /tmp
mv: invalid option -- 'c'
Try `mv --help' for more information.
BTW, my shell is TCSH on RHEL 6.3, "tcsh --version" shows:
~/git]$ tcsh --version
tcsh --version
tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,color,filec
Anyone has any clue on this problem. Your help would be much appreciated.
Update
Thanks all. I checked manual just now, found the official answer below:
To remove a file whose name starts with a '-', for example '-foo',
use one of these commands:
rm -- -foo
rm ./-foo