LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-12-2015, 08:39 PM   #1
rookee
LQ Newbie
 
Registered: Jun 2014
Posts: 28

Rep: Reputation: Disabled
Please help me understand this man page.


I'm trying to understand this man page of lsof on linux. . The following is the excerpt of lsof man page. Can anyone please help me understand what these options mean.

1) the ^ (negated) login name or user ID (UID), specified with the -u option;
2) the ^ (negated) process ID (PID), specified with the -p option;
3) the ^ (negated) process group ID (PGID), specified with the -g option;
4) the ^ (negated) command, specified with the -c option;
5) the (^) negated TCP or UDP protocol state names, specified with the -s [p:s] option.

Also please advise tips on reading and understanding the man pages if there's any. Thanks in advance.
 
Old 03-12-2015, 09:07 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
What they're saying is that if you provide multiple options such as user (-u), pid (-p) they are OR'ed by default. This means that if you run:
Code:
lsof -u root -p 666
.. you would see any open files by pid 666 or by user root

If you negate an option such as (any open files NOT open by root):
Code:
lsof -u ^root -p 666
.. the check for user will take effect first before any further filtering is applied.
This means that if pid 666 was running as root it will not show up in the output.

For general guidance with man pages, you'll find that they're usually quite terse and if you are having trouble understanding then try out a few of the options and it'll help clarify how the tool works.
 
1 members found this post helpful.
Old 03-12-2015, 09:21 PM   #3
rookee
LQ Newbie
 
Registered: Jun 2014
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thank you very much kbp.
 
Old 03-12-2015, 09:38 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 11
Posts: 8,209

Rep: Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507
I think that man pages are written much more like a specifications sheet than a text book. The man pages terseness and exactitude seem natural to mathematicians and some programmers but most people find the man pages to be lacking. If you cannot decipher a man page description then I recommend that you use google to find an explanation written like a textbook. In the case of lsof here is a decent human readable explanation:

https://danielmiessler.com/study/lsof/

This explanation has plenty of good examples and it includes an example that explains the part of the lsof man page that stumped you.

-------------------
Steve Stites
 
1 members found this post helpful.
Old 03-12-2015, 09:48 PM   #5
rookee
LQ Newbie
 
Registered: Jun 2014
Posts: 28

Original Poster
Rep: Reputation: Disabled
Pretty informational.Thanks Jailbait.
 
Old 03-13-2015, 12:35 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by jailbait View Post
I think that man pages are written much more like a specifications sheet than a text book. The man pages terseness and exactitude seem natural to mathematicians and some programmers but most people find the man pages to be lacking. If you cannot decipher a man page description then I recommend that you use google to find an explanation written like a textbook. In the case of lsof here is a decent human readable explanation:

https://danielmiessler.com/study/lsof/

This explanation has plenty of good examples and it includes an example that explains the part of the lsof man page that stumped you.

-------------------
Steve Stites
They are natural to mathematicians and computer scientists. But it is good at this way. Because it is concise, correct and understandable. Users should try to learn them. For start using more explanatory text do help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
getting out of a man page! naijaguy Linux - Newbie 11 04-10-2018 05:21 PM
man page is not found although $MANPATH and man.conf changed Abbraxas Linux - Newbie 3 09-05-2011 06:40 PM
I don't understand man pages guest Linux - Newbie 7 02-14-2005 12:31 AM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 08:52 AM
Is there a man page on how to use man page? jdruin Linux - Software 2 10-30-2004 09:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration