The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
Google UNIX.COM


Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
finding text in a file §ynic UNIX for Dummies Questions & Answers 5 01-06-2008 03:32 PM
sed.. Add new line after finding text douknownam Shell Programming and Scripting 3 12-01-2004 05:50 AM
Finding out if there is text in a file. iCONAN Shell Programming and Scripting 9 09-15-2004 02:15 PM
Finding text ASpin UNIX for Dummies Questions & Answers 1 12-08-2002 03:42 AM
finding text inside file dindan100 UNIX for Dummies Questions & Answers 3 10-22-2002 12:30 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2002
Registered User
 

Join Date: Jun 2002
Posts: 36
Question finding out the pid for a busy text file

Can some one please tell me how to find out the proccess ID that is holding up a file.

I am attempting to remove a file and I am getting a message stating that it is busy.

i.e

rm filename
filename: 777 mode ? (y/n) y
rm: filename not removed. Text file busy

Thanks in advance.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-28-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,354
fuser may be able to do this. This public domain program lsof certainly can.

But the usual solution is to move the busy file out of the way. Something like...
mv /usr/local/bin/prog /usr/local/bin/prog.old
mv prog /usr/local/bin

And then later...
rm /usr/local/bin/prog.old
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0