Fstat
From FreeBSDwiki
(Difference between revisions)
Line 4: | Line 4: | ||
'''fstat -p qmail-send''' - only return files locked by the '''qmail-send''' process | '''fstat -p qmail-send''' - only return files locked by the '''qmail-send''' process | ||
'''fstat -u jimbo''' - only return files locked by the user '''jimbo''' | '''fstat -u jimbo''' - only return files locked by the user '''jimbo''' | ||
+ | '''fstat /usr/local/sbin/smbd''' - only return info on processes and users locking the file '''/usr/local/sbin/smbd'''. | ||
see also: [[iostat]] | see also: [[iostat]] | ||
[[Category:System Commands]] | [[Category:System Commands]] |
Revision as of 13:08, 15 June 2007
fstat is a command similar to the lsof command Linux users are familiar with. Simply put, it returns a list of all open files and what user context they've been opened in. Handy arguments:
fstat -f /usr/local/etc - only return locked files from the filesystem containing /usr/local/etc/ (/usr, on most systems) fstat -p qmail-send - only return files locked by the qmail-send process fstat -u jimbo - only return files locked by the user jimbo fstat /usr/local/sbin/smbd - only return info on processes and users locking the file /usr/local/sbin/smbd.
see also: iostat