LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2005, 04:44 PM   #1
Stepaj47
LQ Newbie
 
Registered: Oct 2005
Location: Buffalo, NY
Posts: 8

Rep: Reputation: 0
What is script PID information?


I have to write a script that collects user id and PID information, but I don't
know what PID means. Can anyone give me a brief explanation of what PID stands for, thanks.
 
Old 11-14-2005, 04:51 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
PID = Process IDentifier

man bash
/PID
for details



Cheers,
Tink
 
Old 11-14-2005, 05:03 PM   #3
Stepaj47
LQ Newbie
 
Registered: Oct 2005
Location: Buffalo, NY
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks.

If I want to display the just the PID information using the ps command in bash, how would I do that?
 
Old 11-14-2005, 05:21 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The PID of what would be the first thing you should
try to find out ;)

And then of course there's friendly commands like cut
and awk that will let you post-process the information
out of ps if the built-in display options don't quite do
what you expect.

man ps
man cut
man awk

for details



Cheers,
Tink

P.S.: And since the question strongly reeks of homework
this is going to be as much support as you get, homework
questions are against our rules. If you run into an actual
problem with any of the commands above feel free to come
back and ask.
 
Old 11-15-2005, 08:46 AM   #5
Stepaj47
LQ Newbie
 
Registered: Oct 2005
Location: Buffalo, NY
Posts: 8

Original Poster
Rep: Reputation: 0
When I try to use the "pidof" command, bash says the command is not found.
How do I enable the "pidof" command in my bash shell?

Last edited by Stepaj47; 11-15-2005 at 09:13 AM.
 
Old 11-15-2005, 02:56 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
pidof is part of the sysinitV package in slackware, and
is in /sbin ... chances are that you can't see it as a normal
user in your distro, either. Have a look in /sbin, or see
whether it works as root.

If it doesn't, use ps and grep, gives you the same info
with slightly more work.


Cheers,
Tink
 
Old 11-15-2005, 03:21 PM   #7
Stepaj47
LQ Newbie
 
Registered: Oct 2005
Location: Buffalo, NY
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks, I checked in /sbin, and pidof was there, it was one of a few commands that was highlighted a different color, I am not sure what that means. Possibly that command is disabled?
 
Old 11-15-2005, 03:50 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Personally I don't use ls colorisation, and if I did the
meaning of the colours in your set-up might differ from
what my distro provides. The easiest way to find out
would be to try and run it ;}


Cheers,
Tink
 
  


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
How do I get PID info about a specific script? Stepaj47 Linux - Newbie 2 11-14-2005 05:31 PM
bash script, monitoring running PID? thebover Programming 4 08-26-2004 03:42 PM
obtaining PID of shell script sanjith11 Programming 3 07-14-2004 11:43 AM
small bash script to kill a PID flosch Linux - General 3 05-06-2004 10:28 PM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 07:25 PM


All times are GMT -5. The time now is 01:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration