LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2009, 05:58 AM   #1
an_sush
Member
 
Registered: Nov 2008
Posts: 46

Rep: Reputation: 15
Find path from file alias


How can i find the real path progrmatically from an directory alias?
for eg: i have
Code:
path1=/home/db2inst1/sqllib/java/db2jcc.jar
file which actually is a alias of the real file (
Code:
path2=/opt/ibm/db2/V9.1/java/db2jcc.jar
)

so by giving path1 as input to some shell program/script, how can i find the real path (path2)
please help
 
Old 02-12-2009, 06:11 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Do you mean to say that path1 is sym link to path2?
If it is this then you can look out for ln command. Man for ln for more information.

Last edited by linuxlover.chaitanya; 02-12-2009 at 06:18 AM.
 
Old 02-12-2009, 06:15 AM   #3
rizwanrafique
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
Shell provides file command to check file types. Do:
Code:
# file /home/db2inst1/sqllib/java/db2jcc.jar
and you'll get
Code:
/home/db2inst1/sqllib/java/db2jcc.jar: symbolic link to `/opt/ibm/db2/V9.1/java/db2jcc.jar'
Output can be manipulated in a script easily.
 
  


Reply



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-to : get full path of each file after applying find and cut kaprasanna Linux - General 1 01-07-2008 01:19 AM
Find file/dir path nc3b Programming 5 08-28-2006 04:49 AM
how do i get the proper path to a file through find command napster Linux - General 4 11-07-2005 04:35 AM
Create alias or add to $PATH ryedunn Linux - Newbie 3 08-18-2004 10:42 AM
making alias, can't find .bashrc file djgerbavore Slackware 10 07-23-2004 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:01 AM.

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