3

I'm in bash and running F17 as su. My pwd is

/home/user

and when I ls I see

Desktop Documents Downloads Music Pictures Public Templates Videos

However, I'm unable to cd into any of these. My error is

bash: cd: Desktop: No such file or directory

How come?

22
  • What error message appears when you try to cd into them?
    – Renan
    Commented Aug 17, 2012 at 17:25
  • bash: cd: Desktop: No such file or directory
    – Piper
    Commented Aug 17, 2012 at 17:37
  • Wild guess: perhaps you are already in your Desktop directory? cd will not produce any output if successful
    – lk-
    Commented Aug 17, 2012 at 17:42
  • 2
    @Islay: What does ls -l say? Guess: Desktop is a stale link...
    – Gowtham
    Commented Aug 17, 2012 at 18:11
  • 1
    @Islay Ok, so the directory is really called Desktop, it's not that. And it is a directory and not a symbolic link. Commented Aug 18, 2012 at 18:35

2 Answers 2

2

It is almost always the case that "when root cannot do something root should be able to do, the problem is selinux".

As it's been months, the situation has probably been remedied, but if someone else has a similar problem and see this post, I recommend running "setenforce 0" which will put selinux in "permissive" mode until the next reboot (or until "setenforce 1" is run). See if that fixes it such that you can cd into Desktop.

If that fixes it, then you will need to either restore the selinux context for /home/user, or change the selinux policy for files under /home.

0

You can check your ~/.bashrc file and see if you have an alias defined for cd. Does this happen as any other user or just yours? Is it only the Desktop directory or all directories in your home folder?

1
  • It's all sub directories of my user directory: /home/user
    – Piper
    Commented Aug 17, 2012 at 18:19

You must log in to answer this question.

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