Re: How to follow symbolic link(s) to the actual filename?



moma <moma@xxxxxxxxxxx> wrote:
> $ ls -l link2 link1 afile
> -rw-r--r-- 1 moma moma 0 2006-01-31 10:58 afile
> lrwxrwxrwx 1 moma moma 5 2006-01-31 10:58 link1 -> afile
> lrwxrwxrwx 1 moma moma 5 2006-01-31 10:58 link2 -> link1

> If my bash script got "link2", how to find the actual filename (afile)?

readlink -f link2

Chris
.



Relevant Pages

  • Re: SMB problems.
    ... filename does not contain any special characters (one I'm using to test ... Chris. ... Prev by Date: ...
    (microsoft.public.windows.server.networking)
  • Re: adding up field columns in a file
    ... Thats great to know. ... And Chris yes your answer did answer my question as there was the ... filename at the end of the awk statement- doh! ... Prev by Date: ...
    (comp.unix.admin)
  • Identity crisis
    ... But, when I switch to the other identity, I show zero names in that contact ... although I am sharing an ... Chris ... Prev by Date: ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: split a file based on pattern
    ... > Chris F.A. Johnson wrote: ... I think this is one of the most elegant solutions to a problem ... If a line might revert to an older filename, ...
    (comp.unix.shell)
  • RE: file reading problem
    ... Chris ... Prev by Date: ...
    (comp.lang.fortran)