0

Is there a built-in unix/linux command which returns the target of a specific symbolic link?

for example if i made a symbolic link:

%> ln -s build_07-24-2011 latest

is there a command "foo" that does this:

%> foo latest
build_07-24-2011

i know that i can parse the ll -l latest with awk to get the same thing, just wondering if there's a more elegant way to do this.

dimka
  • 4,301
  • 11
  • 31
  • 36

1 Answers1

1

Take a look at readlink(1).

Marcus Borkenhagen
  • 6,536
  • 1
  • 30
  • 33