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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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