Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

View smbstatus ouput by user, not by PID

by inductor (Novice)
on Sep 30, 2005 at 07:32 UTC ( #496362=snippet: print w/ replies, xml ) Need Help??

Description: This little script shows the list of open files, preceeding each of them not only with PID as in original smbstatus, but with username too.
#!/usr/bin/perl -w
for (`smbstatus`) {
        $users{$1} = $2 if (/\s*(\d+)\s+(.+?)\s+(.+)\s{2}(.+)\s\((.+)\
+)/);
        print "$1($users{$1}) = $2\n" if (/(\d+).*?\/data\/dat\/(.*)\s
+{3}/);
}
Comment on View smbstatus ouput by user, not by PID
Download Code

Back to Snippets Section

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://496362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2015-07-07 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls