Search code examples
javalinuxunixrootcd

Not able to do cd /usr/bin/java


I am trying to view content of /usr/bin/java directory.But not able to do cd in java directory even if I am accessing as root.

/usr/bin# cd java
-bash: cd: java: Not a directory

When I am trying to view permission of this directory I am getting this

ls -ld java
lrwxrwxrwx 1 root root 22 Aug  5  2015 java -> /etc/alternatives/java

What should I do now to access java directory?


Solution

  • /etc/alternatives/java usually links to java executable, not directory. Please check by using:

    ls -l /etc/alternatives/java
    

    It will show you a link, do ls -l on the link that it gives you and you will see that it is actually a file not a directory.