The &
operator is specially used for executing a task in background, representing like you see (with the [X] YYYY
). YYYY is the PID number of the task in background, and X is the number you assigned at this background task (like a counter).
PID will change every time, it will increment itself like a counter, and X would be reset when you will close the terminal. If you type kill -9 YYYY
where YYYY is the PID number of this background task; terminal will prompted [X] Stopped
, that means your background task is ... stopped.
There is no problem with that, just a little mistake from your command, which would be sudo apt-get update && sudo apt-get upgrade -y
.
NB: Usually, when you use a command line (without the &
operator), you can't use another one in the same terminal unless the command line is done, but when you add the &
operator, the terminal will accept another command at same time (but without output and error redirection, it can be hard to type something, so you can also use nohup
).
sudo apt-get update & sudo apt-get upgrade -y
literally? The ampersand should be doubled (&&
) to do what you probably wanted. Instead, you seem to have got a task in background. – Melebius Aug 13 '18 at 08:07