Hello everyone,
On Linux platform, if I want to get current process (for example, a shell script), are there any ways (for example, a command) to get the process ID without programming.
regards,
George
Printable View
Hello everyone,
On Linux platform, if I want to get current process (for example, a shell script), are there any ways (for example, a command) to get the process ID without programming.
regards,
George
Yes.
Command is
"ps -ef"
You can get help on ps(process status) command thru manual page of "ps"
by "man ps".
Why did you post this in the C Programming forum then?Quote:
get the process ID without programming.
Too stupid, couldn't find the linux forum, or a search engine. Must be an Ubuntu user.
Quzah.
Hi quzah,
What means "Ubuntu"?Quote:
Originally Posted by quzah
regards,
George
Yeah... he's either an Ubuntu user or a wiseass.Quote:
Originally Posted by George2
Hi itsme86,
Because I want to find a non-programming way, I think programming forum guys should know non-programming way to do the same thing. :-)Quote:
Originally Posted by itsme86
regards,
George
Hi SlyMaelstrom,
What means a wiseass?Quote:
Originally Posted by SlyMaelstrom
regards,
George
Thank you Ken,
Quote:
Originally Posted by Ken Fitlike
regards,
George
Hi maven,
I have tried that "ps -ef" will list all the process, but I only want to get the current process ID of a shell script.Quote:
Originally Posted by maven
regards,
George
That is the most warped logic I've heard in awhile.Quote:
Because I want to find a non-programming way, I think programming forum guys should know non-programming way to do the same thing.
This is ridiculous.Quote:
Originally Posted by George2
Did you even try google? I know close to nothing about Linux. But just found the answer. I won't share it though. Do yourself (really, yourself) a big favor and try to answer your own question before wasting everybody else's time.
The command would be
ps ax | grep "<script name>" | awk {'print $1'}