What I want is a normal way to quit, like q in top.
That's ControlC :)
I am just curious about the question, because I feel that killing the process is not a good way to quit something.
^C
(ControlC) sends a SIGINT to the process, which is defined as:
The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process
That's exactly what you want to do here, is interrupt tail
. There's no other way to accomplish what you're trying to do ("nicely" quit tail) and while other answers provide a means to stop tail
in other ways, they're no better.
Pressing ^C
will attempt to interrupt a task in Linux -- this is perfectly normal, and it's only "not good" if that process is in the middle of something and you're not letting it finish, and then the only "not good" side effect is leftover things from that process. As an example, ^C
in the middle of a make
command leaves partially-compiled software, but that's fine: a further run of make
will clean that up / resume where it left off.
tail
is not interactive; it does not take commands.man signal
for moretail
or even kill it without worry. But if you want an alternative, considermost
, which has an admittedly under-documented "follow" mode, initiated with Shift+F, and can be cleanly exited with Q.tail -f
isn't that :)