How does one go about getting the command line prompt back after using the systemctl status command? The command appears to succeed as it displays the status information of the requested service. However, the terminal appears to lock up after using the command.
If you mean
at the end it shows this:
├─systemd-journald.service │ └─318 /lib/systemd/systemd-journald ├─fwupd.service │ └─1703 /usr/lib/fwupd/fwupd ├─systemd-networkd.service │ └─395 /lib/systemd/systemd-networkd └─cups-browsed.service └─2918 /usr/sbin/cups-browsed lines 172-194/194 (END)
... then press a
q for quit.
As steeldriver noted in comments: use
--no-pager if you do not want this behaviour see details.
systemctl status --no-pager
3I wonder why would they not show this by default like nano does. Jul 9, 2018 at 3:36
Sweet. I used this in a script to give feedback during an install and without your fix it forces you to crtl C out of it. Thanks!– F1LinuxJun 19, 2019 at 13:14
--no-pageralso works great for noninteractive scripts– rubo77Jan 13, 2020 at 18:16
Can we also do
systemctl status package | cat?– alperNov 26, 2021 at 13:34
systemctl is running in another terminal:
$ pstree -pa $(pgrep systemctl) systemctl,2100 status └─less,2101
q or Q or :q or :Q or ZZ Exits less.
systemctl status | cat does the job as well. You're just redirecting the output of
systemctl status to
cat which in turn dumps everything on the console without any pagination
1Unfortunately this way the
systemctlexit status is lost (unless
set -o pipefail). Sep 11, 2019 at 10:14
--no-pageroption - see related How to avoid horizontal scrolling in “systemctl status”?