In Ubuntu, applications can be opened from a terminal. But sometimes it isn't clear what the appropriate command is to do this.
So, having an application open, how can I get the command used to launch it, without having to search anywhere (just by looking at it)?
Best Answer
I just made the following script which use the application window title to find out the right command which opens the respective application from terminal (I named it
appcmd
):Save this script in your
~/bin
directory and don't forget to make it executable:Usage:
When the script is runed without any argument, the script will return all commands for all windows opened corresponding.
If any argument is given, the script will try to find an open application window containing in its title that argument and will return the command corresponding. For example if Chromium browser is open, you can find out the command which opens it from terminal using only: