Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-03-2009, 12:07 AM   #1
LQ Newbie
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
Get full path of a file

Can somebody tell me how to get the full path of a symlink and/or file ?
I have the following
In /usr/bin
myfile (symlink) -> myactualfile (physical file)

When I use readlink on myfile, I get myactualfile. Howver, I want the full path. If thats not possible using a single command, I was thinking to do this in 2 steps
1. readlink(file)
2. get_full_path(file) - Need Linux API to substitue get_full_path.

Old 08-03-2009, 12:34 AM   #2
LQ Newbie
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0
OK. found the response in another thread - realpath. this works.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i find full path of file? DoME69 Programming 5 03-04-2009 02:11 PM
perl CGI full path to file for upload GATTACA Programming 1 06-11-2007 10:42 PM
full path of a file ttilt Linux - General 1 11-08-2005 06:02 PM
get full path of uploaded file in php spoody_goon Programming 2 05-10-2005 07:32 PM
How to parse full path of file name in bash ? hq4ever Programming 2 03-28-2005 03:31 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration