LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 06: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, 07:11 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

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 07:18 AM.
 
Old 02-12-2009, 07: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


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


All times are GMT -5. The time now is 06:23 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration