I want to keep monitoring a specific job on a slurm worload like cluster. I tried to use the watch command and grep the specific id. If the job id is4138, I tried

$> watch squeue -u mnyber004 | grep 4138
$> squeue -u mnyber004 | watch grep 4138

but they doesn't work. The second command works for the first few seconds, but stop working when watch refreshes.

A better idea please?


2 Answers 2


You have to quote the command

watch 'squeue -u mnyber004 | grep 4138'

The other answer covers how to handle using the 'watch' utility with a pipe but since you're using Slurm and know the job ID, just ask Slurm for that job's status:

$> watch squeue -j 4138

Not the answer you're looking for? Browse other questions tagged .