orphan soft linked files


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers orphan soft linked files
# 1  
Old 08-07-2009
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  
Old 08-07-2009
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  
Old 08-08-2009
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  
Old 08-16-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Is orphan process handling by Solaris os and Linux os same?

In solaris, orphan process is put to sleep mode and does not consume any CPU resources. In Linux, orphan process is kept in running state consuming all CPU and Ram resources. Is it the case? Is there a difference on how these operating systems will handle orphan processes? The route cause of... (10 Replies)
Discussion started by: Belure Pooja B
10 Replies

2. UNIX for Advanced & Expert Users

cronjobs orphan processes

Our cron job stats its started on Oct20 % ps -ef | grep cron root 1442044 1 0 Oct 20 - 25:23 /usr/sbin/cron All the below jobs aixmf,aixgh are triggered from cron only. user pid ppid date time cmd gaix 1581282 1 35 16:33:01 - 20:56... (1 Reply)
Discussion started by: karnan
1 Replies

3. UNIX for Dummies Questions & Answers

List linked files

A perl script that displays the list of files which have multiple links..! ls -l shows number of links in a field. (0 Replies)
Discussion started by: aadi_uni
0 Replies

4. Shell Programming and Scripting

Mailing me the Defunct/Zombie/Orphan

Hello I need a script which would mail me the list of processes which are zombie/defunct or orphan. Please help me in this regard. (7 Replies)
Discussion started by: mehimadri
7 Replies

5. Shell Programming and Scripting

How to retrieve all the linked script files/ctl files/sql files?

Hi I am going to migrate our datawarehouse system from HP Tru 64 Unix to the Red Hat Linux. Inside the box, it is running around 40 cron jobs; inside each cron job, it is calling other shell script files, and the shell script files may again call other shell script files or ctl files(for... (1 Reply)
Discussion started by: franksubramania
1 Replies

6. Linux

Cron ORPHAN (no passwd entry)

I am using the standard vixie-cron am seeing the following my logs : crond: (username) ORPHAN (no passwd entry) Ordinarily this is a simple matter, there is no corresponding user, but I am using central authentication and the username does exist and is usable via the standard nsswitch mechanism, so... (2 Replies)
Discussion started by: humbletech99
2 Replies

7. UNIX for Advanced & Expert Users

how to remove db2 orphan processes

Hi Guys, I'm working on a AIX 5.3 environment and I've been quite a few times in a situation where we can remove db2 orphan processes therefore our only alternative has been to reboot the entire server. Now I wonder is there is any other possible way that we can use to remove those processes... (5 Replies)
Discussion started by: hariza
5 Replies

8. UNIX for Advanced & Expert Users

Files Linked With A Binary

Hi, What is command in unix to find what are all the files linked with an executable binary. Thanks in advance. Rgds, Omkumar (2 Replies)
Discussion started by: tc.omkumar
2 Replies

9. UNIX for Advanced & Expert Users

rdist -- but not linked files

How do I rdist a directory from one server to another, excluding soft and hard links? current rdist syntax: 1 2 * * * cd /apps/oasis/prdsch/log; rdist -c j1*.log oasis@oastdby:/apps/schiller/oasis/prdsch/log 31 2 * * * cd /apps/oasis/prdsch/log; rdist -c oasis_bin_trans*.log... (6 Replies)
Discussion started by: captainzeb
6 Replies

10. Shell Programming and Scripting

Script to kill stranded/orphan process by users.

I have customers on our AIX/UNIX node startup a process that becomes stranded or orphaned and must be killed. I would like to create a script to check for these orphan processes and kill them. I can have cron run this job. The customers process will run and after 24 hours time out leaving an... (4 Replies)
Discussion started by: rjohnson
4 Replies
Login or Register to Ask a Question