06-28-2002
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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script that when run creates 4 other text files. Sometimes a couple of these text files are empty. So what I am trying to do is find out if there is text in the file and if not delete the file.
What I have so far is the following script. I am just not sure how to return a true value... (9 Replies)
Discussion started by: iCONAN
9 Replies
2. UNIX for Dummies Questions & Answers
How do i find text string in a file if i have no idea where the file is?
What I am trying to do is find an email address in a file and have no idea where the file is.
Thanks (5 Replies)
Discussion started by: §ynic
5 Replies
3. Shell Programming and Scripting
Hi, is there a command that takes the PID of a process and that only diplays it's ni number?
I`m pretty sure it would require pipes but I tried a few things that ended up miserably...
Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Discussion started by: Yakuzan
2 Replies
4. Shell Programming and Scripting
Hi All,
Am copying mulitple files in a directory in names File0,File1,File2 etc.
I need to print separately the PID of these copies using File names.
for((i=0;i<5;i++))
do
mypid=`ps aux | awk '/File$i/ && !/awk/ { print $2 }'`
echo PID is $mypid
done
It printed nothing. Thinking... (6 Replies)
Discussion started by: amio
6 Replies
5. UNIX for Advanced & Expert Users
Hi,
We have a filesystem mystery on our hands. Given:
2 machines, A and Aa.
Machine Aa is the problem machine.
Machine A is running Ubuntu, kernel 2.6.22.9 #1 SMP Wed Feb 20 08:46:16 CST 2008 x86_64 GNU/Linux. Machine Aa is running RHEL5.3, kernel 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38... (2 Replies)
Discussion started by: mschwage
2 Replies
6. Solaris
Say I have 2 processes(perl scripts on Solaris machine) A and B.
the process A kill the process B.
While in the process B how do I print the PID of the process that Killed it(process A) before dieing.
My process A looks like
open(STATS, "ps -ef|");
while ($inputLine = <STATS>) {
if... (7 Replies)
Discussion started by: enigma_007
7 Replies
7. Solaris
Hi Experts,
I was asked to find most busy file system on one of the server. It is Sun 10. Any idea to get this?
Thanks,
Deepak (5 Replies)
Discussion started by: naw_deepak
5 Replies
8. Shell Programming and Scripting
Hello,
Please help me with this.
I have two files. file1.txt and file2.txt
File1 contains text as below
txt1 txt2
txt3 txt4
txt5 txt6
txt7 txt8
File2 contains text as below
$1 $2 $3 $4 $5 $6 $7 $8 $9
-----------------------------
txt1 txt2 - - - 0 2 8 -*-
txt0 txt7 - - - 1 4 8... (3 Replies)
Discussion started by: tenderfoot
3 Replies
9. Shell Programming and Scripting
Hello All,
I am facing difficulty in getting the PID value & then assigning it to a variable,
kindly help me in resolving the issue.
Thanks a lot in advance.
The custom utility used inside the Test2.sh will process the file in a batch of 10 lines at once and for efficient memory management,... (3 Replies)
Discussion started by: duddukuri
3 Replies
10. Shell Programming and Scripting
Hello All,
I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command.
1.The fifty scripts are stored in a separate file.
2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies