02-20-2008
I don't think if fuser can be used in this situation.
But you can use tail -f to see a growing file
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
fuser is used to check whether a file is in use by a process or not.
I was putting some information in a file via a background process and was doing a cat to see the contents.
It gave me the pid of background process followed by stop.
Understood only half, stopped because it was writing on it... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
2. UNIX for Advanced & Expert Users
#SCRIPT TO CHECK WHO HAS ACCESSED THE LOG/FILE IN PAST 'N' MINUTES, AND MAIL ACCORDINGLY.
MYPATH="/clocal/mqbrkrs/user/mqsiadm/sanjay/"
MAIL_RECIPIENTS="abc@xyz.com"
Subject="File accessed in last few minutes"
>tempmail.txt
>tempfind.txt
find "$MYPATH" -type f -amin -1 > tempfind.txt
cat... (0 Replies)
Discussion started by: varungupta
0 Replies
3. UNIX for Advanced & Expert Users
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)
Discussion started by: varungupta
6 Replies
4. UNIX for Dummies Questions & Answers
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)
Discussion started by: adrianlearnpro
8 Replies
5. Shell Programming and Scripting
All,
I have to have my script wait for another script when it is being executed. I used fuser -f scriptname to get the PID of the script but when passed the PID to wait command, the command does not accept it as a PID.
Below is the example:
my.script1:
fuser_result=`fuser -f my.script2`... (4 Replies)
Discussion started by: bharath.gct
4 Replies
6. Solaris
Greetings,
I need help understanding why FUSER will not bring back PSID's on mounted filesystems. Is this a common error?
Thanks in advance for your feedback. (11 Replies)
Discussion started by: Harleyrci
11 Replies
7. UNIX for Dummies Questions & Answers
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)
Discussion started by: tjmannonline
10 Replies
8. Solaris
Hi,
Can anyone explain me the difference between fsuer and lsof commands. As per my knowledge both the commands are used to find the processes used by the current file system or user. Apart from that what is the major difference between these commands (3 Replies)
Discussion started by: rogerben
3 Replies
9. UNIX for Advanced & Expert Users
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)
Discussion started by: newbie_01
0 Replies
10. Shell Programming and Scripting
bash-3.2$ fuser -f /bin/nohup.out
/bin/nohup.out: 13136o 13111o
The pid is 13136.
Can you tell me how can i extract just the pid 13136 from the above output ?
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v
I was trying on this lines but i get strange... (3 Replies)
Discussion started by: mohtashims
3 Replies
LEARN ABOUT FREEBSD
fuser
FUSER(1) BSD General Commands Manual FUSER(1)
NAME
fuser -- list IDs of all processes that have one or more files open
SYNOPSIS
fuser [-cfkmu] [-M core] [-N system] [-s signal] file ...
DESCRIPTION
The fuser utility writes to stdout the PIDs of processes that have one or more named files open. For block and character special devices,
all processes using files on that device are listed. A file is considered open by a process if it was explicitly opened, is the working
directory, root directory, jail root directory, active executable text, kernel trace file or the controlling terminal of the process. If -m
option is specified, the fuser utility will also look through mmapped files.
The following options are available:
-c Treat files as mount point and report on any files open in the file system.
-f The report must be only for named files.
-k Send signal to reported processes (SIGKILL by default).
-m Search through mmapped files too.
-u Write the user name associated with each process to stderr.
-M Extract values associated with the name list from the specified core instead of the default /dev/kmem.
-N Extract the name list from the specified system instead of the default, which is the kernel image the system has booted from.
-s Use given signal name instead of default SIGKILL.
The following symbols, written to stderr will indicate how files is used:
r The file is the root directory of the process.
c The file is the current workdir directory of the process.
j The file is the jail-root of the process.
t The file is the kernel tracing file for the process.
x The file is executable text of the process.
y The process use this file as its controlling tty.
m The file is mmapped.
w The file is open for writing.
a The file is open as append only (O_APPEND was specified).
d The process bypasses fs cache while writing to this file (O_DIRECT was specified).
s Shared lock is hold.
e Exclusive lock is hold.
EXIT STATUS
The fuser utility returns 0 on successful completion and >0 otherwise.
EXAMPLES
The command: ``fuser -fu .'' writes to standard output the process IDs of processes that are using the current directory and writes to stderr
an indication of how those processes are using the directory and user names associated with the processes that are using this directory.
SEE ALSO
fstat(1), ps(1), systat(1), iostat(8), pstat(8), vmstat(8)
STANDARDS
The fuser utility is expected to conform to IEEE Std 1003.1-2004 (``POSIX.1'').
HISTORY
The fuser utility appeared in FreeBSD 9.0.
AUTHORS
The fuser utility and this manual page was written by Stanislav Sedov <stas@FreeBSD.org>.
BUGS
Since fuser takes a snapshot of the system, it is only correct for a very short period of time. When working via kvm(3) interface the report
will be limited to filesystems the fuser utility knows about (currently only cd9660, devfs, nfs, ntfs, nwfs, udf, ufs and zfs).
BSD
May 13, 2011 BSD