The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Collection of Unix Links Kriss UNIX for Dummies Questions & Answers 1 01-26-2009 07:57 AM
Post Your Favorite UNIX/Linux Related RSS Feed Links Neo What's on Your Mind? 0 12-23-2007 12:41 PM
Question posting links hemangjani UNIX for Dummies Questions & Answers 5 02-25-2006 07:28 PM
All Linux and Unix commands Links devotedsinner News, Links, Events and Announcements 0 11-07-2005 07:49 AM
Unix History Question: Why are filenames/dirnames case sentsitive in Unix? deckard UNIX for Dummies Questions & Answers 3 03-26-2005 01:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-13-2006
nj302 nj302 is offline
Registered User
  
 

Join Date: May 2005
Posts: 17
A question for links in Unix

Is there a command that I can list, at once, all the links(path) of a give file ( including hard link and soft link)? If not, can it be down by writing a script? Thanks a lot.

(I know that pwd would only list one path.)
  #2 (permalink)  
Old 01-14-2006
98_1LE 98_1LE is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
I can't think of a way to list all the soft links.

To find the hard links, first run ls -li to find out the inode number of the file. Then do a find from the root of the file system (hard links do not cross mount points) for that inode.

Example from a Solaris 10 box:
Code:
> cd /usr/bin
> ls -li zcat
      3262 -r-xr-xr-x   3 root     bin        27176 Jan 22  2005 zcat
> find . -inum 3262
./compress
./uncompress
./zcat
>
In this case /usr/bin is the root file system, so I chose not to run the find from / as it would look in other file systems. The 3 between the file permissions and root means there are 3 links to one file.
  #3 (permalink)  
Old 01-15-2006
nj302 nj302 is offline
Registered User
  
 

Join Date: May 2005
Posts: 17
Softlink may need to write a script to find out. Thank you very much for the help.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0