swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Adding another use for kill command in intermediate shell lesson 04 job.md #846

Closed btemperton closed 7 years ago

btemperton commented 9 years ago

I have added an example of when someone would combine the ps command with the grep and kill 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.

gdevenyi commented 9 years ago

Rather than grepping to find the PIDs, what about pkill?

btemperton commented 9 years ago

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?

gdevenyi commented 9 years ago

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?

btemperton commented 9 years ago

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?)

gdevenyi commented 9 years ago

Yup, see above your comment where the new commit shows up in the "Conversation"

gvwilson commented 7 years ago

This repository has been retired.