1

I'm having a weird problem on Ubuntu 18.04 (Desktop) where certain commands don't display output to the terminal when they are run when they definitely should. I can still capture the output of the command using, e.g., xclip. The two commands I'm having this issue for is systemctl and git branch (but nothing else git-related). I can't figure out what the link is between these two, and I haven't spotted anything else that does this.

For example, if I run:

systemctl status cron

I don't get output, but if I run:

systemctl status cron | xclip -selection clipboard

then the status of the cron service is available on my clipboard, as expected.

This happens on both GNOME's terminal and the standard TTY.

  • did you play with any environment? Try systemctl --no-pager status cron option. I am guessing broken $PAGER/$TERM. You can also run set -x before one of that command and see what happens when you running such command. – Alexander Sep 20 '18 at 8:28
  • A broken $PAGER was the issue I think - thanks! $PAGER wasn't set to anything, so I set it to less and everything seems to be back to normal. :) – Sam Harrison Sep 20 '18 at 8:46
0

As Sam, proved in comments, solution was check/reset $PAGER variable.

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.