When you do
cat some-symlink-to-some-real-file
it shows the contents of the real file, not what is within the symlink itself. Is there a way to see what's actually in it?
A symbolic link is a special type of file whose contents are a string that is the pathname of another file, the file to which the link refers. (The contents of a symbolic link can be read using readlink(2).) In other words, a symbolic link is a pointer to another name, and not to an underlying object.
No. The symlink system call will return EEXIST if newpath already exists. You can only link from a new node in the filesystem.
3. Finding Broken Symlinks. The -H, -L and -P options control how symbolic links are treated, and when omitted, use -P as the default. When -P is used and find examines or prints information from a symbolic link, the details are taken from the properties of the symbolic link itself.
The ls -l
command will show you that:
$ ls -l foo lrwxrwxrwx 1 user group 11 2010-12-31 19:49 foo -> /etc/passwd
Or the readlink
command:
$ readlink foo /etc/passwd
So, the symbolic link foo
points to the path /etc/passwd
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With