Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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've Googled around for this to no avail, I'm sure its just something simple but I have not been able to figure this out perhaps because searching in Google or SF for a "-" can be problematic.

I had a strange directory listing show up the other day in my git repository within Drupal. Listing my sites directory looks like this:

-sh-4.1$ ls -al
total 52
drwxr-xr-x  5 (hide) (hide)  4096 Dec  6 16:15 .
drwxr-xr-x 24 (hide) (hide)  4096 Dec 11 16:22 ..
-rw-rw-r--  1 (hide) (hide) 24271 Dec  6 15:57 –
drwxrwxr-x  4 (hide) (hide)  4096 Sep 17 11:53 all
drwxr-xr-x  3 (hide) (hide)  4096 Sep 17 11:54 default
drwxrwxr-x  8 (hide) (hide)  4096 Dec 11 17:40 .git
-rw-rw-r--  1 (hide) (hide)   476 Sep 17 11:53 .gitignore
-rw-rw-r--  1 (hide) (hide)    81 Sep 17 11:53

This "-" file cannot be opened and does not appear to be a symlink, although when I execute "cd -" I get this:

-sh-4.1$ cd -

That is coincidentally or not the users home directory, and the site's root directory. The other strange this is this entry does not show up for any other user browsing this same directory. Nor does it show up for other users period in their Git directories. The entry cannot be removed via RM.

Running Centos 6.2 by the way...

share|improve this question
up vote 4 down vote accepted

That doesn't look like a normal dash to me, it's an em-dash, a Unicode symbol. On Linux you can type it with AltGr + -.

With this knowledge you should be able to simply remove it with rm –. You could simply copy it from here if you can't type it.

The reason for the output of cd - is that this command has special meaning. It moves you to the directory you were in before you used cd the last time.

share|improve this answer
It sure is.. good catch seeing that in the monospaced font! – Shane Madden Dec 12 '12 at 4:04
Very good observation. It turns out it was an en-dash not an em-dash (ugh). It was created by wget when I was trying to download a file earlier in the week to debug something. – Mazzy Dec 12 '12 at 4:12
Oh well, my fault. – aef Dec 12 '12 at 4:13

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.