How to follow symbolic link(s) to the actual filename?
- From: moma <moma@xxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 11:03:50 +0100
Hello,
It need a bash (shell) command(s) that can follow symbolic links to the actual filename.
A sample:
$ touch afile $ ln -s afile link1 $ ln -s link1 link2
$ 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)? -------------------------------------
I can make a dirty, looping bash script, but before that, any piece of advice is wellcome'd.
cheers, moma http://www.futuredesktop.org/how2burn.html#Ubuntu .
- Follow-Ups:
- Re: How to follow symbolic link(s) to the actual filename?
- From: chris-usenet
- Re: How to follow symbolic link(s) to the actual filename?
- From: Peter T. Breuer
- Re: How to follow symbolic link(s) to the actual filename?
- Prev by Date: Re: /home out of space
- Next by Date: Re: /home out of space
- Previous by thread: kmail back up
- Next by thread: Re: How to follow symbolic link(s) to the actual filename?
- Index(es):
Relevant Pages
|