Dear all,
today I was using some program and accidentaly I have created a directory called (name inside brackets)
“-13”
When I try to remove this empty dir I get
rmdir -13
rmdir: invalid option – ‘1’
what can I try to remove it?
B.R
Alex
Dear all,
today I was using some program and accidentaly I have created a directory called (name inside brackets)
“-13”
When I try to remove this empty dir I get
rmdir -13
rmdir: invalid option – ‘1’
what can I try to remove it?
B.R
Alex
rename it, then delete it
mv -13 plonk
rmdir plonk
rmdir ./-13
On 2011-11-08 20:46, alaios wrote:
> When I try to remove this empty dir I get
>
> rmdir -13
> rmdir: invalid option – ‘1’
>
> what can I try to remove it?
Try “rmdir -13”
If not, try using mc.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)
On 11/08/2011 08:46 PM, alaios wrote:
>
> what can I try to remove it?
try
ls ?13
if you see ONLY -13 listed (and . & …) then try
rm -ir ?13
–
DD
http://tinyurl.com/DD-Caveat
openSUSE®, the “German Automobiles” of operating systems
The suggestion by ken_yap (post #3) should work. I’m skeptical of the others. His suggestion was:
rmdir ./-13
That solves the problem by using a name for the file that does not begin with “-”.
Some of the other suggestions use quoting, or a wildcard. The quoting and/or wildcard tell the shell how to handle the “-”. But the shell will still pass that on the the target command (the “rmdir” command). The error message is coming from the target command, rather than the shell. So it is what the target command sees that matter.
rmdir ./-13
a test shows that:
rmdir – -13
would also work. I think that’s part of the gnu way of doing things - a “–” terminates the command options and anything following that is a regular parameter (e.g. filename) rather than an option.
On 11/09/2011 04:16 PM, nrickert wrote:
> I’m skeptical of the others.
me too…now that i tried it and see that bash is smart enough to tell
you what to use (and where to look to find what to use)
–
DD
http://tinyurl.com/DD-Caveat
openSUSE®, the “German Automobiles” of operating systems