I am running the following command and saving the output to a file:

sudo journalctl -u iotedge -f >> sub.txt

the problem is ,i have to stop the operation of the command with ctrl+c otherwise it won't go back to command prompt. Is there any way to stop the follow command and save it's output to a file without pressing ctrl+c.

1 Answer 1


From man journactl:

-f, --follow

Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.

So just remove the -f from the command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .