Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does readlink systemcall do?

I can't understand the operation of the "readlink" systemcall in Linux.

Can anyone explain about it with simple example on it?

like image 793
codingfreak Avatar asked Jan 23 '23 05:01

codingfreak


1 Answers

If you have a symbolic link, e.g.

$ ls -l /vmlinuz
lrwxrwxrwx 1 root root 30 2009-08-03 08:59 /vmlinuz -> boot/vmlinuz-2.6.28-15-generic

then readlink syscall will get you the symlink target (boot/vmlinuz-2.6.28-15-generic), just like readlink command:

$ readlink /vmlinuz
boot/vmlinuz-2.6.28-15-generic
like image 83
Michael Krelin - hacker Avatar answered Jan 29 '23 11:01

Michael Krelin - hacker