Thursday 7 December 2017

linux - Kill process after it's been allowed to run for some time

I want to limit the time a grep process command is allowed to run or be alive.


For example. I want to perform the following:


grep -qsRw -m1 "parameter" /var

But before running the grep command I want to limit how long the grep process is to live, say no longer than 30 seconds.


How do I do this?


And if it can, how do I return or reset to have no time limit afterwards.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...