1

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.

6 Answers 6

0

tailing spaces you are unaware of

try

cd 5*

for starter, but trimming tail spaces would be welcome too

1
  • 1
    Or 'cd 5' to cover any leading spaces too.
    – mibus
    Aug 20, 2009 at 10:14
2

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

2

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
1
  • +1 for od, extremely useful tool
    – asdmin
    Aug 18, 2009 at 17:58
1

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.

0

Have you tried fsck'ing the partition?

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .