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 > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to retrieve all the linked script files/ctl files/sql files? franksubramania Shell Programming and Scripting 1 05-04-2009 01:47 PM
Cron ORPHAN (no passwd entry) humbletech99 Linux 2 02-16-2009 02:02 AM
how to remove db2 orphan processes hariza UNIX for Advanced & Expert Users 5 10-05-2006 09:33 PM
Files Linked With A Binary tc.omkumar UNIX for Advanced & Expert Users 2 11-22-2005 06:02 AM
rdist -- but not linked files captainzeb UNIX for Advanced & Expert Users 6 11-18-2003 11:37 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2009
Pouchie1 Pouchie1 is offline
Registered User
  
 

Join Date: May 2009
Posts: 36
orphan soft linked files

How can we find files that were soft linked to an original file and then the original has been deleted. these soft linked files won't then be accessible. How can we find orphan linked files?

Thanks,
  #2 (permalink)  
Old 08-07-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 730
Having made a symbolic link to a non-existant file:
Code:
$ ls -l /tmp/fred /fred
ls: cannot access /fred: No such file or directory
lrwxrwxrwx 1 tony tony 5 2009-08-07 23:03 /tmp/fred -> /fred
$
Try to list the file the link points to:
Code:
$ ls -lL /tmp/fred
ls: cannot access /tmp/fred: No such file or directory
$ echo $?
2
$
Combine that with a:
Code:
find -type l
To find all the symbolic links and you have a method of locating broken symbolic links.
  #3 (permalink)  
Old 08-08-2009
Pouchie1 Pouchie1 is offline
Registered User
  
 

Join Date: May 2009
Posts: 36
It looks like you are working with known file with known broken links. I am trying to list all the soft links that are broken or orphaned. I don't know them as of yet.

Thanks,
  #4 (permalink)  
Old 08-16-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 730
No I am not assuming file names, by using the find(1) command you will find all links in and below the directory you are in.
Reply

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 12:20 PM.


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