On my system I can check a job's status using qstat:

$ qstat 2048930
Job ID                    Name             User            Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
2123456                    run.pbs          kilojoules                 0 Q bigq

How can I continuously monitor this output? What I mean is, I would like the output to constantly update so that I see the latest status without re-entering the command. Something like qstat 2048930 | tail -f

  • 1
    See if you have the 'watch' command – Jeff Schaller Apr 18 '16 at 17:53
  • I have this command. – kilojoules Apr 18 '16 at 18:01

The usual way is to use watch:

watch qstat 2048930

That will run the command every 2 seconds and continuously update the output. If you don't have watch and can't install it, you can use a simple loop:

while :; do qstat 2048930; sleep 2; done

You can stop it with CtrlC.

|improve this answer|||||
  • you could also throw in a 'clear' there, after the sleep command, if your terminal supports it. – Jeff Schaller Apr 18 '16 at 18:15

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.