Skip to content

Instantly share code, notes, and snippets.

@Aruna-Hewapathirane
Last active August 29, 2015 14:14
Show Gist options
  • Save Aruna-Hewapathirane/31614f180db5ac18620b to your computer and use it in GitHub Desktop.
Save Aruna-Hewapathirane/31614f180db5ac18620b to your computer and use it in GitHub Desktop.
symbolic link and readlink system call
man 2 readlink
freedom@debian:~/C$ ls -al /dev/block
total 0
drwxr-xr-x 2 root root 480 Jan 29 22:26 .
drwxr-xr-x 14 root root 3500 Jan 29 22:27 ..
lrwxrwxrwx 1 root root 6 Jan 29 22:26 11:0 -> ../sr0
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:0 -> ../loop0
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:1 -> ../loop1
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:2 -> ../loop2
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:3 -> ../loop3
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:4 -> ../loop4
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:5 -> ../loop5
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:6 -> ../loop6
lrwxrwxrwx 1 root root 8 Jan 29 22:26 7:7 -> ../loop7
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:0 -> ../sda
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:1 -> ../sda1
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:16 -> ../sdb
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:2 -> ../sda2
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:3 -> ../sda3
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:32 -> ../sdc
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:4 -> ../sda4
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:48 -> ../sdd
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:5 -> ../sda5
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:6 -> ../sda6
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:64 -> ../sde
lrwxrwxrwx 1 root root 7 Jan 29 22:26 8:7 -> ../sda7
lrwxrwxrwx 1 root root 6 Jan 29 22:26 8:80 -> ../sdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment