LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-28-2003, 04:15 PM   #1
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: Red Hat Linux 9.0
Posts: 6

Rep: Reputation: 0
Unhappy Listing Files that shares the same link


I need help with listing a file and its link (symbolic).
I tried
Code:
ls -HUl filename
but I'm not sure...

Is there anyway that this can be done?

Thanks in advance for any help!



-Leon
 
Old 09-28-2003, 04:49 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

Do you mean that you jsut want to see where the link goes? Just use:
ls -l /path/to/symlink
 
Old 09-28-2003, 04:51 PM   #3
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: Red Hat Linux 9.0
Posts: 6

Original Poster
Rep: Reputation: 0
Question

Nah... say I know file1 has a link

How do I list the names/path of all the links that links to file1 ???

-Leon
 
Old 09-28-2003, 05:44 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Ah - see what you mean. You cna use find:
find -lname file1

EDIT: To search your entire drive not just from the dir you are in:
find / -lname file1

Last edited by david_ross; 09-28-2003 at 05:47 PM.
 
Old 09-28-2003, 06:01 PM   #5
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: Red Hat Linux 9.0
Posts: 6

Original Poster
Rep: Reputation: 0
Hm... that didn't work

Is there a way I can just grep the i-node numbers and just say they're the same so they're linked together...? lol *sigh*

I created a file with 4 links to test it out...
same inode numbers

when I executed the find command, it returned nothing.. does that only works with Hard links??

:'(
 
Old 09-28-2003, 06:12 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
It worked fine for my symlinks. What command did you issue? Did you see my edit about seaching the entire system?
 
Old 09-28-2003, 06:36 PM   #7
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: Red Hat Linux 9.0
Posts: 6

Original Poster
Rep: Reputation: 0
all my linked files are in my ~/
I made 4... ln file1 file2
cp -l file1 file3
and ln for the rest
then I used find ~/ -lname file1
all I get back was $(...blankingcursorgoeshere...)
 
Old 09-28-2003, 08:08 PM   #8
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: Red Hat Linux 9.0
Posts: 6

Original Poster
Rep: Reputation: 0
Looks like I made a boo boo, it's a hard link... lol Sorry

So back to square one *sigh*
 
  


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
listing all files of a certain user X-GhoSt Linux - General 1 10-22-2005 04:22 AM
Listing shares Omnica Linux - Networking 1 01-14-2005 01:07 PM
listing files in to an array sujith_deva Programming 1 12-12-2004 03:14 PM
listing files in a directory Linh Programming 7 05-17-2004 05:35 AM
Listing files from within a C program? PsychosisNode Programming 4 11-16-2003 11:40 AM


All times are GMT -5. The time now is 02:00 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