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 README.md
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 -
/home/sites/dev1.(hide).com
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...
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 usedcd
the last time.