Seeing this message when trying to exit bash means some interactive processes launched from this terminal are still running in the background. Use the jobs
command to list them. Use fg <n>
to bring job number n
to the foreground and exit the process properly.
As an example, if a command being piped to less exits and less is left hanging without anything to show, it goes to the background. Example:
1 2 3 4 5 6 7 8 9 10 11 |
agnel@Carmen:~$ non-existent-command | less non-existent-command: command not found (END) [1]+ Stopped non-existent-command | less agnel@Carmen:~$ |
This means that less is still running in the background waiting for input. Here’s how to bring it to the foreground and exit it.
1 2 3 4 |
agnel@Carmen:~$ jobs [1]+ Stopped non-existent-command | less agnel@Carmen:~$ fg 1 non-existent-command | less |
In this case, after fg 1
, it is not immediately clear what to do. But since I know that it is less
that’s running now, I hit q (since q is the less
keystroke to quit).