Closed btemperton closed 7 years ago
Rather than grepping to find the PIDs, what about pkill?
I didn't know about pkill! Every day is a school day :). Not sure whether the best approach is to keep with ps | grep
as an example of piping commands into each other, or introducing a new command. I could add a line to the lesson saying 'this could also be achieved with the pkill
command?
Pipes are covered in the core shell lessons so they can be considered pre-existing knowledge.
Perhaps you could do a re-wording that describes what PIDs are, and that you can check them, but you can also kill processes by name?
PIDs seem to be well covered at the start of this lesson. I have changed the lesson to discuss pkill
instead of ps | grep
, including a warning that pkill
will kill all matching commands and advising the use of pgrep -l
to check.
(now, git question - I have committed the new file to the branch from which the pull request was generated. Can you see this change now, or do I have to create a new pull request?)
Yup, see above your comment where the new commit shows up in the "Conversation"
This repository has been retired.
I have added an example of when someone would combine the
ps
command with thegrep
andkill
commands to terminate a job which is running amok on a system. I think this ties all the concepts covered in this lesson together, as well as providing a useful lesson in what to do when your jobs are going wrong.