I opened a simple text file by vi. I then started another shell, and did fuser myFile. I expected it to show the pid of the vi session that had that file open, but it just returned a blank.
then I can see a whole bunch of processed, one of which is my vi with my file open.
But I don;t want that.
I want to do
as I only want to see if myFile.ksh is open. Am I missing something here?
thanks
===============================================
Hey,
Try to use following..
MYPATH="/clocal/user/dir1/dir2/"
for file_dir in `find $MYPATH -amin -1`
do
echo `fuser -uf "$file_dir" ` >> temp.txt.$$
echo " $file_dir is being accessed" >> temp.txt.$$
done
or
fuser -uf /dir1/dir2/file1
It perfectly works. and it shows the name of the user, who has accessed the file.
Catch : fuser returns a process id !! Below command stores the process id, thats being returned by fuser command.
I opened a simple text file by vi. I then started another shell, and did fuser myFile. I expected it to show the pid of the vi session that had that file open, but it just returned a blank.
why would this be?
thanks
-------------------------------------------
hey,
for more help you can visit my post under the same forum:
"awk and fuction (recursion) !! Urgent !! "
Hi,
Not sure whether there is a fuser alternative or any better way to check for file in use or not.
I am wanting to check whether files are in use or not before removing them. Using fuser, the awk seems to be giving me 'weird' output not to mention that it is giving me 2 lines instead of... (0 Replies)
Hi Guys,
I am facing this Error
bash-2.03$ ./curl -V
ld.so.1: curl: fatal: libldap.so.5: open failed: No such file or directory
Killed
bash-2.03$
while executing
./curl -V in /opt/sfw/bin directory.
I am using Sun Solaris 10.
which package upgrage can give me this missing... (9 Replies)
Hi
i have written a infinite loop which writes to a file log.txt
while
do
echo " file in use " >> log.txt
done
i have started this process in one terminal , from another terminal i issued cp command
cp log.txt log2.txt
i was expecting a File in use message but didnt ?
i have... (6 Replies)
if filename.txt is in used, exit, else continue.
i tried to use fuser -c filename.txt, but returned bunch out PIDs eventhough filename.txt is not in used.
any idea ? (10 Replies)
Is there a way to show the first 4 lines of a file without using head -4?
In sed would it be sed '1,4d' ?
What if I just wanted to display the 2nd line ONLY?
How could this be done with AWK?...correctly with SED? (6 Replies)
http://i255.photobucket.com/albums/hh133/COKEDUDEUSF/toolbar.jpg
Take a look at my picture to understand what I'm talking about. I have a bunch of programs open right now and I can't see the name of the programs on my toolbar. Is there hopefully a way to see all open programs on your toolbar... (1 Reply)
Hi
I am facing strange issue in one direcotry it is not showing year of file,
can you please suggest me wheather there is any limitation on year,
on some other file though it is showing the dates.
Regards,
Manoj. (1 Reply)
First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting.
First, this is what's running:
This is the error when jobs are run or the... (0 Replies)
Anyone ever use fuser,
i tried this command fuser /database.bk
but it only returns datbase.bk:
I read some of the forums online, one of them said when he used fuser, it broke down the box, i really don't want that happen.
I thought fuser is to see who is accessing that file, right?
any... (8 Replies)
Hi all,
I have the following script:
-------------------------------------------------
#SCRIPT TO CHECK WHO HAS ACCESSED THE LOG/FILE IN PAST 'N' MINUTES, AND MAIL ACCORDINGLY.
MYPATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/"
MAIL_RECIPIENTS="vg517@dcx.com"
Subject="File accessed in last... (6 Replies)