Question

On a server when I type in ls -al I get a list of the directories

-bash-3.2$ ls -al
total 12
drwxr-xr-x  3 root root    0 Feb 13  2011 .
drwxr-xr-x  4 root root 4096 May 11  2011 ..
drwxr-xr-x 55 torg torg 4096 May 15 05:40 stuff

However I happen to know that there are more directories pressent, because when I type cd loourr and then go back cd .. I find myself with

-bash-3.2$ ls -al
total 32
drwxr-xr-x  3 root root    0 Feb 13  2011 .
drwxr-xr-x  4 root root 4096 May 11  2011 ..
drwxr-xr-x 55 torg torg 4096 May 15 05:40 torg
drwxr-xr-x 108 loourr loourr 20480 Jan 29 19:48 loourr

Why is this? I was under the impression that the -a flag reveals all directories. What could be causing this, and how can I reveal directories that are still not being listed?

Update: Heres what happens when I follow David Wolever suggestion

-bash-3.2$ ls
torg
-bash-3.2$ pwd
/home/room1
-bash-3.2$ cd loourr
-bash-3.2$ pwd
/home/room1/loourr
-bash-3.2$ cd ..
-bash-3.2$ ls
torg  loourr
-bash-3.2$ pwd
/home/room1

and when I mount

-bash-3.2$ mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda6 on /scratch type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
cartman.foo.bar:/home/room2/me on /home/room2/me type nfs (rw,addr=*.43)
cartman.foo.bar:/home/room2/admin on /home/room2/admin type nfs (rw,addr=*.43)
storage1.foo.bar:/storage/3 on /storage/3 type nfs (rw,nfsvers=3,tcp,intr,hard,addr=*.44)
cartman.foo.bar:/home/room1/torg on /home/room1/torg type nfs (rw,addr=*.43)
cartman.foo.bar:/home/room1/loourr on /home/room1/loourr type nfs (rw,addr=*.43)

Some notes: I replaced the server admins name with admin, my account name with me, the server extension with foo.bar and the part of addr= that was constant with *

Was it helpful?

Solution

I suspect that you have an automounter set up. This is not a case of directories not being visible, but rather that the directory is created and a remote file system mounted in that location on demand, when you first try to reference the location.

In this case, using ls -a or any other option will not show the directories, because they don't exist yet. Your system administrator can set options on the automounter to make the directories visible (browsable), but there are good reasons that they may have not done that, in addition to the fact that it's not usually the default.

OTHER TIPS

There is no reason that ls -al wouldn't show the loourr directory.

It must have been created between the first and second calls to ls, or you may have ended up in a different directory. Try this:

$ ls
stuff/
$ pwd
/foo/
$ cd loourr
$ pwd
/bar/loourr/
$ cd ..
$ ls
stuff/ loourr/
$ pwd
/bar/ <-- different directory

There are a couple of different reasons cd might take you to a different directory… Symlinks are one (although probably aren't in your case), and the CDPATH environment variable is another (if you echo $CDPATH, do you see anything?)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top