suppose i have many windows open like two image files, a terminal , a firefox. and using command line i want to exit specifically 1 of these.. how can i do this?
is there any shell command to do this?
i am waiting for reply. its urgent!
m using ubuntu 9.04

There are a couple of ways to exit a shell directly from the command line either sending an "end of file" which is a <CTRL> d or typing exit. However I think you are referring to closing a specific window you have open on the Desktop. To do that you have to know something unique about the open window and then kill the process has the window open. If you know the name of the application or the image then you could use:

ps aux | grep <info about open window> | grep -v grep

This would show the processes associated with the info you entered. You need the process id, which is the second column, to kill the process. For example if I received the following lines from the grep:

root 23274 0.0 0.1 90744 3196 ? Ss 08:33 0:00 sshd: rod [priv]
rod 23276 0.0 0.0 90744 1680 ? S 08:33 0:00 sshd: rod@pts/1
rod 23277 0.0 0.0 64208 1472 pts/1 Ss 08:33 0:00 -bash
root 23306 0.0 0.0 101252 1300 pts/1 S 08:33 0:00 su -
root 23307 0.0 0.0 64212 1528 pts/1 S 08:33 0:00 -bash

and wanted to kill the bash shell run by rod I would enter the following to kill it:

kill -9 23277

Is that what you are looking for?

thanx alot !:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.