Answer» I inadvertenly CREATED a file with a dash preceeding the filename. i.e. "-a"
So as EVERYONE knows, you can't rename it or delete it because of the -
Any help on this would be greatly appreciated.
JFFree File Manager like XTree:
http://www.unixtree.org/To do it from commandline, it's: rm -- -a The -- tells it to treat all following arguments as files.How about remving a file with a number (i.e. 1) as the filename?That's not an issue. The number is parsed as text. "rm 1.txt" works as you would expect.I tried the suggestion to remove a file with a number as the filename with the rm 1.txt command and get the same result:
#rm 1.txt
1.txt: No such file or directory
??
What is the hash (#) doing in there?
If all else fails, try: Code: [Select]rm "1.txt" If you have a decent shell you can just type rm then hit TAB repeatedly until it starts cycling through the available file names. The shell will automatically enter the file name the way rm needs it.The hash is there as an example of the command line prompt. The file name is 1, not 1.txt....
I have tried everything I can think of......
rm -- -1 rm -f 1 rm "1" rm -- ./1 rm -- ./\1
?
What shell are you using? I have run this sequence:
Code: [Select]echo 1 > 1 rm 1 on bash, sh, csh & zsh, and they all work exactly as you would expect.
I wonder if the file isn't actually called '1' but has some HIDDEN character in its name? How about doing:
Code: [Select]ls > sample and then emailing the output to me to have a look at?Before you do this you should use: man rm
you can also use: 1. cd to the directory 2. issue rm -i *1*
This will prompt you for any file that has a 1 in the file name. If you do not want to remove other files that have a 1 in the file name, be sure to reply: n you may have to
Mike
|