LinuxQuestions.org
Visit Jeremy's Blog.
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 09-28-2003, 03:15 PM   #1
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: CentOS
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, 03:49 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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, 03:51 PM   #3
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: CentOS
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, 04:44 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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 04:47 PM.
 
Old 09-28-2003, 05:01 PM   #5
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: CentOS
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, 05:12 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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, 05:36 PM   #7
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: CentOS
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, 07:08 PM   #8
FireAllianceNX
LQ Newbie
 
Registered: Sep 2003
Location: New York City
Distribution: CentOS
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



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

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

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