Tag Info

Hot answers tagged

4

I can provide you with a perl snippet to do this for you: #!/usr/bin/perl # foreach my $i (@ARGV) { # If it is a symlink then... -l $i and do { # First indirection; ensure that it exists and is not a link my $j = readlink($i); print "$i\n" if -e $j and ! -l $j } } If you save that as /usr/local/bin/if-link and make it ...


4

/proc/<pid>/exe does not follow the normal semantics for symbolic links. Technically this might count as a violation of POSIX, but /proc is a special filesystem after all. /proc/<pid>/exe appears to be a symlink when you stat it. This is a convenient way for the kernel to export the pathname it knows for the process' executable. But when you ...


1

According to the man page of /proc, under Linux 2.2 and later, the file is a symbolic link containing the actual pathname of the executed command. Apparently, the binary is loaded into memory, and /proc/[pid]/exe points to the content of the binary in memory. On the other hand, under Linux 2.0 and earlier, /proc/[pid]/exe is apparently a pointer to the file ...



Only top voted, non community-wiki answers of a minimum length are eligible