- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- System Administration
- >
- viewing the full path of the linked file
-
- Forums
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- OEM Solutions
- Servers: The Right Compute
- Shifting to Software-Defined
- Telecom IQ
- Transforming IT
- Infrastructure Solutions German
- L’Avenir de l’IT
- IT e Trasformazione Digitale
- Enterprise Topics
- ИТ для нового стиля бизнеса
- Blogs
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Forums
-
Blogs
-
InformationEnglish
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 05:16 AM
05-14-2009 05:16 AM
I am using suse line 9. Some files are soft linked. i am not able to see the full path of the linked file.
Ex:
emdlagora02:/usr/x86_64-suse-linux/bin # ll
total 0
lrwxrwxrwx 1 root root 12 Dec 18 13:18 ar -> ../../bin/ar
lrwxrwxrwx 1 root root 12 Dec 18 13:18 as -> ../../bin/as
lrwxrwxrwx 1 root root 12 Dec 18 13:18 ld -> ../../bin/ld
lrwxrwxrwx 1 root root 12 Dec 18 13:18 nm -> ../../bin/nm
lrwxrwxrwx 1 root root 16 Dec 18 13:18 ranlib -> ../../bin/ranlib
lrwxrwxrwx 1 root root 15 Dec 18 13:18 strip -> ../../bin/strip
is it possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 05:38 AM
05-14-2009 05:38 AM
Re: viewing the full path of the linked file
So, ar is a link to a file that is two directories above, then descend to bin and there you will find ar.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 05:43 AM
05-14-2009 05:43 AM
Re: viewing the full path of the linked file
find /usr/x86_64-suse-linux/bin -name "*"
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 05:45 AM
05-14-2009 05:45 AM
Re: viewing the full path of the linked file
what you can also do is:
# find /usr/x86_64-suse-linux/bin -type l -exec ls -l {} \;
this will give you full path to the link target.
J.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 06:42 AM
05-14-2009 06:42 AM
Re: viewing the full path of the linked file
I want to see the actual path of this "../../bin/ar"
how to know the original path of this "../../"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 07:19 AM
05-14-2009 07:19 AM
Re: viewing the full path of the linked file
which ../../bin/ar
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-14-2009 03:40 PM
05-14-2009 03:40 PM
Re: viewing the full path of the linked file
It will show you the absolute path.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2009 03:19 AM
05-15-2009 03:19 AM
Re: viewing the full path of the linked file
>>lrwxrwxrwx 1 root root 12 Dec 18 13:18 ar -> ../../bin/ar
from your current location do
cd ..
cd ..
cd bin
ll ar
is the location of your link file
Suraj
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2009 03:50 AM
05-15-2009 03:50 AM
Re: viewing the full path of the linked file
Still i am not able to see the full path.
# ll kini*
lrwxrwxrwx 1 root root 24 Nov 19 2007 kinit -> ../lib/heimdal/bin/kinit
# readlink -m kinit
readlink: invalid option -- m
Try `readlink --help' for more information.
# readlink kinit
../lib/heimdal/bin/kinit
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2009 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2009 07:30 AM
05-15-2009 07:30 AM
Re: viewing the full path of the linked file
hb:~/sub/subsub$ readlink -m symlink
/home/hartmut/sub/file
hb:~/sub/subsub$
That may be what you are looking for. But, it's not the full path. -m is explained as "canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence"
hb:~/sub/subsub$ echo "`pwd`/`readlink symlink`"
/home/hartmut/sub/subsub/../detour/../file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2009 09:31 PM
05-15-2009 09:31 PM
Re: viewing the full path of the linked file
Why do you care?
Symlinks to relative paths are good, absolute paths are bad. Think of having them over an NFS mount.
The absolute path would be $PWD/../../bin/ar.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2019 Hewlett Packard Enterprise Development LP