0

when I tried $ ls /proc ,I found a lot of directories(numbered - for PID and other subdirectories...) as follows :

I am describing only some of the numbered subdirectories,and other subdirectories

$ ls /proc
 129   1475  1899  2     21    2302 (PID's-correct me if i am wrong)
 acpi ,asound, bus,driver, fs, ipmi ,irq , mounts , net ,scsi ,self,sys, sysvipc,tty(other subdirecories ), 

and when I tried $ ls - l /proc it displayed some -> character in it :

$ ls -l /proc
lrwxrwxrwx.  1 root       root                    11 Sep  7 17:06 mounts -> self/mounts 
lrwxrwxrwx.  1 root       root                     8 Sep  7 17:06 net -> self/net
lrwxrwxrwx.  1 root       root                     0 Sep  7  2014 self -> 4806

Here in Access Specifier full access is there(lrwxrwxrwx),my question is: what does l specify here in lrwxrwxrwx what does these -> character means? like in(mounts -> self/mounts , net -> self/net,self -> 4806 etc.)

1 Answer 1

2

The presence of -> means that that "entry" in the directory is a symbolic link (symlink) to a file/directory somewhere else. In this case, /proc/mounts is a symlink to /proc/self/mounts.

Symlinks typically have a permission of 0777, since it isn't the one allowing/restricting access to a file/directory (hence, the rwxrwxrwx). However, whatever permissions are on the file/directory still do come into effect, so if a file has permissions 0600 or rw-------, then only the user owning the file can read or write into it, either directly or through a symlink.

I'm not entirely sure on the l, but my guess is that it's an indication that that entry is a symlink.

2
  • Thanx @saiarcot895 ,well as 0777 corresponds to symbolic link permission ,implies l = 0 ,and others are set(1's) so 7(owner)7(grup)7(rest world) ,isnt it?
    – lazarus
    Sep 7, 2014 at 12:22
  • 1
    Yes. Hence, the guess that the l is specially for symlinks. Sep 7, 2014 at 12:46

You must log in to answer this question.

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