Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm facing a very peculiar error:

# ls -l
drwxr-sr-x 8 kay users 4096 Aug 17 15:07 1. Crisis Core Workflow
drwxr-sr-x 6 kay users 4096 Aug 17 15:41 2. Contact Cards or Sheets    
drwxr-sr-x 3 kay users 4096 May 12 20:31 5. Distribution Lists

# cd 5.\ Distribution\ Lists
-bash: cd: 5. Distribution Lists: No such file or directory

# cd "5. Distribution Lists"
-bash: cd: 5. Distribution Lists: No such file or directory

There are no space issues here, I've checked that.

share|improve this question

6 Answers 6

up vote 0 down vote accepted

tailing spaces you are unaware of

try

cd 5*

for starter, but trimming tail spaces would be welcome too

share|improve this answer
1  
Or 'cd 5' to cover any leading spaces too. –  mibus Aug 20 '09 at 10:14

Trailing space, perchance, or some other insane hidden character? Try cd 5<tab>, and see what it fills out.

share|improve this answer

Have you tried fsck'ing the partition?

share|improve this answer

ls | cat -v should show you all the other "fun" characters that make up the filename :)

share|improve this answer

cat -v only shows non-printing characters, which can be useful, but really, what you want is od -c

ls -d 5* | od -c

ls -d makes sure when you're listing a directory that you see the directory permissions as opposed to the files contained within the directory.

e.g.

$ mkdir "blah "
$ ls -d b* | od -c
0000000   b   l   a   h      \n
0000006
share|improve this answer
    
+1 for od, extremely useful tool –  asdmin Aug 18 '09 at 17:58

there are a couple of switches for ls that could help.

ls -w

ls -B

ls -b

-b may be the most useful, it will show non printable characters bu using their C escape codes.

share|improve this answer

Your Answer

 
discard

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.