-1

I connected to centos 7 with SSH and Putty.

I ran this command:

yum update

And closed the terminal.

Now that I'm back in the new terminal, I can see it running with this command:

# ps auxf | grep yum
root      5455 10.3  1.3 646196 222248 pts/1   S+   04:16   1:50      \_ /usr/bin/python /usr/bin/yum update

But the question is, how can I see the instant output of the command like the first time I ran it?

1 Answers1

0

Generally, you can't. You may be able to get some idea of what's going on by following /var/log/yum.log.

If you had started yum update under the control of a screen multiplexing tool like tmux or screen, you could detach and re-attach to the running process.

There are some things you can do with gdb, but they're all a bit hacky. See e.g. this question for a discussion of the topic.

larsks
  • 34,737
  • @StephenKitt Would you believe...that I already don't tell people they can't do something unless I'm absolutely sure? I might be wrong, and thanks for the pointer (a link would have been nice), but no thanks for the attitude. – larsks Aug 30 '22 at 11:27
  • Sorry, I didn’t mean to offend (and I can see why my comment can cause offense, sorry again). The link is in the linked Q&A above, but I should have included it directly: reptyr can re-attach processes to the current terminal. – Stephen Kitt Aug 30 '22 at 11:32
  • @StephenKitt the "reptyr" was great. – Nabi K.A.Z. Aug 31 '22 at 20:49