Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not sure how or when the below folder was created.. But I am unable to delete or open it..

bash-3.2$ cd '+%d-%m-%y'
bash: cd: +%d-%m-%y: No such file or directory
bash-3.2$ rm -f  '+%d-%m-%y'
bash-3.2$ ls -l | grep "+"
drwxr-xr-x   2 hypess   hypess         2 Dec 20 04:21 +%d-%m-%y
share|improve this question

migrated from stackoverflow.com Apr 5 '13 at 11:14

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

Use single quotes. Not double quotes. Also use -r to remove directories:

rm -r '+%d-%m-%y'

Not There may be some (leading or) trailing whitespace. You can reveal this using:

ls -l | grep "+" | cat -vet

Ensure you capture all of the whitespace in the quotes.

How it was created? hypess used single quotes, presumable after a malformed date command.

When it was created? Around 2 Dec 20 04:21, I suspect.

share|improve this answer
Updated my question. That is not the issue... – Kent Pawar Feb 4 '13 at 12:23
@KentPawar: I've updated my answer accordingly. I'm not sure it warranted a downvote as it was a reasonable response to the question as it stood at the time with double-quotes. – Johnsyweb Feb 4 '13 at 12:26
Thanks @Johnsyweb! Turns out the script was using Windows EOL and so the folder '+%d-%m-%y^M$' was created along with the CR special character.. – Kent Pawar Feb 4 '13 at 12:40
Nasty! Glad you found it. – Johnsyweb Feb 4 '13 at 12:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.