Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
Delete dir with hyphen in name

I'm on CentOS 7.2 and I've somehow managed to create a folder called "-p". I can't seem to remove it now. I've tried the following:

rmdir -p rmdir "-p" rmdir \-p rmdir "\p"

It's probably simple, but I'm struggling.

I guess worst case I'll move anything out of the parent folder and go for a rm -rf

Many thanks

EDIT: just figured out the command that did it (and has done it again)

mkdir –p /etc/redis /var/redis

...I don't even

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You could do:

rm ./-p

And depending on the rm used:

rm -- -p
over 4 years ago · Santiago Trujillo Denunciar

0

You can pass foldernames starting with hypens to mkdir and rmdir after a "double hypen". Here's an example:

$ ls -1
$ mkdir -- -p
$ ls -1
-p
$ rmdir -- -p
$ ls -1
$
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda