How to delete a special directory
How to delete a special directory
am 09.02.2007 15:29:42 von gamito
Hi,
I've accidently created two directories: -f and -q
Now, i can't remove them with rm -rf -f -q
I get an error.
Any ideas ?
Warm Regards,
M=E1rio Gamito
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 15:33:45 von Scott Pack
--1UWUbFP1cBYEclgG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
M?rio Gamito [gamito@gmail.com] wrote:
> I've accidently created two directories: -f and -q
>=20
> Now, i can't remove them with rm -rf -f -q
> I get an error.
>=20
Try giving the full path name to the directory. Such as,
rm -rdf ./-f ./-q
S.
--=20
--------------------------------------------------
Scott Pack
spack@cs.ohio.edu
--1UWUbFP1cBYEclgG
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFFzIZJc2gDRkt36GYRAntQAKCuTtvzWn6WM6iQfArOMnpZqz+lzACg y3ms
Eijj9jhSmtZ4CQjGVOhXZnM=
=TgD4
-----END PGP SIGNATURE-----
--1UWUbFP1cBYEclgG--
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 15:35:05 von Florian Klien
On 09.02.2007, at 15:29, M=E1rio Gamito wrote:
> I've accidently created two directories: -f and -q
>
> Now, i can't remove them with rm -rf -f -q
> I get an error.
>
> Any ideas ?
try: rm -rf -- -f -q
that should do it. with the double dash you end the commands for rm.
hth
florian
--=20
=46lorian Klien
student of Telematics, tutor for 'Introduction to Structured
Programming' and 'Software Development Practical Exercises'
at Graz university of technology.
"We have persistent objects, they're called files.",
Ken Thompson
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 16:01:57 von Karey Weston
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3253852917_5125350
Content-type: text/plain;
charset="US-ASCII"
Content-transfer-encoding: 7bit
Try this (works with bash on BSD...Linux should be the same)
rm -rf \-f \-q
Make sure you are in bash...the backslashes escape the - and take it as a
literal.
Cheers
wes
On 2/9/07 7:33 AM, "Scott Pack" wrote:
> M?rio Gamito [gamito@gmail.com] wrote:
>> I've accidently created two directories: -f and -q
>>
>> Now, i can't remove them with rm -rf -f -q
>> I get an error.
>>
>
> Try giving the full path name to the directory. Such as,
> rm -rdf ./-f ./-q
>
>
>
>
> S.
--B_3253852917_5125350
Content-type: application/pkcs7-signature; name="smime.p7s"
Content-transfer-encoding: base64
Content-disposition: attachment;
filename = "smime.p7s"
MIIIXwYJKoZIhvcNAQcCoIIIUDCCCEwCAQExCzAJBgUrDgMCGgUAMAsGCSqG SIb3DQEHAaCC
BiswggLkMIICTaADAgECAhBZfwdefs9zC+drl5OVi2OMMA0GCSqGSIb3DQEB BAUAMGIxCzAJ
BgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBM dGQuMSwwKgYD
VQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQTAeFw0w NjAzMjIxODA0
NDJaFw0wNzAzMjIxODA0NDJaMEcxHzAdBgNVBAMTFlRoYXd0ZSBGcmVlbWFp bCBNZW1iZXIx
JDAiBgkqhkiG9w0BCQEWFWt3ZXN0b25AaW5uZXJ3YWxsLmNvbTCCASIwDQYJ KoZIhvcNAQEB
BQADggEPADCCAQoCggEBAMwWFisRCL7xtOZfTLCZXnOGjUhLT/HQb+imQe6s REJDs8XIAfa/
tV10KDNpNwCDtssLgj/rDyYWoaOU4H6wuHakFxUBtGGw+nzlcY/2m8+xx9Dl A6c+B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nxnL8
c9YzKo9oBAM75SGQo0ECYEznRz+6E3YKYDpOQUnz7pwtk8owGVVJ6XS3n+tO mOkDK9Zr51gM
AqHDtrU7ujnnsF81A4VA+gr4gaxnBRf/3dRFNC5jP9s2PUspg5+WN2MFf7Mq f3Wb6Wr7Gy9h
7VurLyDM0uCtgOXio4fFNTxhc1oV3t762RxFOQD6GQN6jXLyFtw8ASs=
--B_3253852917_5125350--
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 17:59:26 von Glynn Clements
Karey Weston wrote:
> >> I've accidently created two directories: -f and -q
> >>
> >> Now, i can't remove them with rm -rf -f -q
> >> I get an error.
> >>
> >
> > Try giving the full path name to the directory. Such as,
> > rm -rdf ./-f ./-q
>
> Try this (works with bash on BSD...Linux should be the same)
>
> rm -rf \-f \-q
>
> Make sure you are in bash...the backslashes escape the - and take it as a
> literal.
That won't work. The dashes are significant to "rm", not the shell.
The backslashes will be removed by the shell, and won't affect the
arguments which "rm" sees.
I have no idea why this would work on BSD; bash is bash, regardless of
the underlying OS.
--
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 18:15:51 von mariani.dario
What about rm -rf "-r" "-f"?
If not, a file manager like Midnight Commander should do the trick.
On 2/9/07, Glynn Clements wrote:
>
> Karey Weston wrote:
>
> > >> I've accidently created two directories: -f and -q
> > >>
> > >> Now, i can't remove them with rm -rf -f -q
> > >> I get an error.
> > >>
> > >
> > > Try giving the full path name to the directory. Such as,
> > > rm -rdf ./-f ./-q
> >
> > Try this (works with bash on BSD...Linux should be the same)
> >
> > rm -rf \-f \-q
> >
> > Make sure you are in bash...the backslashes escape the - and take it as a
> > literal.
>
> That won't work. The dashes are significant to "rm", not the shell.
> The backslashes will be removed by the shell, and won't affect the
> arguments which "rm" sees.
>
> I have no idea why this would work on BSD; bash is bash, regardless of
> the underlying OS.
>
> --
> Glynn Clements
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 18:22:24 von gamito
Hi,
Thank you all for your answers.
Yhis did the trick :)
> /bin/rm -r -- ./-f ./-q
Warm regards,
M=E1rio Gamito
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to delete a special directory
am 09.02.2007 19:07:14 von Glynn Clements
Dar=EDo Mariani wrote:
> > > >> I've accidently created two directories: -f and -q
> > > >>
> > > >> Now, i can't remove them with rm -rf -f -q
> > > >> I get an error.
> > > >>
> > > >
> > > > Try giving the full path name to the directory. Such as,
> > > > rm -rdf ./-f ./-q
> > >
> > > Try this (works with bash on BSD...Linux should be the same)
> > >
> > > rm -rf \-f \-q
> > >
> > > Make sure you are in bash...the backslashes escape the - and take=
it as a
> > > literal.
> >
> > That won't work. The dashes are significant to "rm", not the shell.
> > The backslashes will be removed by the shell, and won't affect the
> > arguments which "rm" sees.
> >
> > I have no idea why this would work on BSD; bash is bash, regardless=
of
> > the underlying OS.
>=20
> What about rm -rf "-r" "-f"?
The same issue applies; the shell will simply "eat" the quotes before
passing the strings to "rm", which will interpret them as switches
rather than filenames.
Quotes and backslashes are shell syntax. They will help if the problem
is because the filename means something to the shell (e.g. a file
named "~" or "<" or "$foo"), but not if the filename means something
to the program (e.g. a file named "-f").
=46or that situation, you need to use "--" (which should work with any
program which uses getopt()), or the "./-f" trick.
--=20
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html