Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2186  / 1 Year ago, sun, january 8, 2023, 10:40:04

Just as the title says, Google gives me nothing and I can't test it on this server.



The command as is follows:



tail -f <file> | fgrep --line-buffered "string" | sed -u 's/stuff//g' >> output.log



Do I need to use kill -SIGTERM <PID> or kill -SIGKILL <PID> to stop a tail -f?


More From » 12.04

 Answers
6

  • SIGTERM sends a signal to the command and will tell the command to stop itself. If there is a need to clean-up files due to the kill the command can do that.

  • SIGKILL sends a signal to the init system. The command itself does not get even told it is going to get killed.



So you can use both; but SIGTERM should be preferred (it is more graceful).




Will “kill -SIGTERM” stop “tail -f”?




Yes, it will. On Linux tail acts on SIGTERM.


[#22002] Tuesday, January 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uccase

Total Points: 473
Total Questions: 100
Total Answers: 110

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
uccase questions
;