Is there a command to figure out what app I just started?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a command to figure out what app I just started?

Jin Choi
This post was updated on .
Hello, guru.
Let's suppose I know how to open a file-browser from Xwindow. But, I also want to know what's the corresponding command for CLI. Mostly I guess you can get the hint of this from the process name.

So, I'd love to know what process just started in terminal somehow. I tried this:
watch 'ps -ef | sort -k 7'
But the problem is, although it sorts process in the start_time order, there are so many 00:00:00 and they all these processes with the start_time of 00:00:00 are sub-ordered by alphabetical order of process names. In a nutshell, the start_times are not precise enough to get what I want.

To recap,
1. Is what I want to do possible?
2. If so, please teach me some possible commands combinations for this.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Is there a command to figure out what app I just started?

Guru
Administrator
 Once I open my browser(Mozilla), I tried the ps command:

ps -ef | grep -i firefox
........  /bin/sh /usr/lib/firefox-1.5.0.3/run-mozilla.sh /usr/lib/firefox-1.5.0.3/firefox-bin -UILocale en-US

I got the name of the process which started the browser. Now just close the browser, and run this command from your prompt, your browser should open. I do not know of other ways than this.