Question

Give the complete command line to show processes whose PID is 1 or parent PID is...

Give the complete command line to show processes whose PID is 1 or parent PID is 1 in Linux

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ps is command to list all process.

command to show process whose PID is 1 is ps -p 1 or ps --pid 1 (you can use any of these)

and command to show process whose parent PID is 1 is ps -ppid 1

I'll illustrate this for you to understand. Even if you have any doubt regarding commands you can always find this by yourself by refering help command.

refer below screenshot:

run

ps --help list

~$ ps --help list Usage: ps [options] Selection by list: -C <command> command name -G, --Group <GID real group id or name -g,

so you can see the mark result how to use process id and parent process id.

run ps --pid 1 result attached below

$ ps --pid 1 PID TTY 1 ? TIME CMD 00:00:00 tini

run ps --ppid 1, result attached below

~$ ps --ppid 1 PID TTY 8? TIME CMD 00:00:00 sh

you can always refer ps --help <simple|list|output|threads|misc|all> for more options for this command.

Hope it helps. Please give feedback, if this answer helped resolved your query.

Happy to help you. Keep learning.

Add a comment
Know the answer?
Add Answer to:
Give the complete command line to show processes whose PID is 1 or parent PID is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT