I often run commands in parallel that take a long time to finish and sometimes I lose track of what is running where since they output basically the same sort of information on screen.
Do you know of any way to find out what command is running in what terminal?
Best Answer
Taken from Bash - Update terminal title by running a second command · U&L and slightly changed:
This (ab)uses the
DEBUG
signal as a trigger to update the title with the last entry from your history, i.e. the last command you executed, via an XTerm Control Sequence. Add the line to your~/.bashrc
to have the feature enabled in every new terminal window.To print other command output alongside in the title, say the current directory with
pwd
followed by ": " and the currently running command, I recommend usingprintf
as follows:Some terminal emulators allow you to specify a dynamic title and even give you the command name as an option so that you don't even need to fiddle around – I searched and found it in
yakuake
's profile settings.