Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script like this:


tail -f /path/to/file.txt

tail -f /path/to/other/file

... `

How can I stop tail -f without stopping whole script?

Any idea?

share|improve this question
Are you really asking "How do I stop a process in Unix?"… – Ярослав Рахматуллин Sep 18 '13 at 9:37 -- Interrupting your processes – Ярослав Рахматуллин Sep 18 '13 at 9:40
This question is easily solved by research – Ярослав Рахматуллин Sep 18 '13 at 9:42

In another shell you can write

 pgrep -lf tail

the output should be similar to this:

9845 tail -f /path/to/file.txt

PID of the process in this case is 9845 You can stop (kill) it with

kill 9845

if it doesn't function you can use kill -9 9845.

Note: if you kill the process of 1st "tail -f" line of the script, the script will proceed till the second "tail -f" (tail -f /path/to/other/file) and stops again there.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.