954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to close any file browser using command in linux

Is there any command to close any already opened file browser using command in linux. I need so. plz help me.

shivnath
Newbie Poster
11 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

You can kill the process if you want...

ps -e | grep firefox


will give you the processnumber of the Firefox process.kill processnumber
will kill the process.

Firewolf
Light Poster
46 posts since Jan 2010
Reputation Points: 10
Solved Threads: 9
 

You can kill the process if you want...

will give you the processnumber of the Firefox process.

will kill the process.


Thanks for your reply but my problem is something different. I don't want to close any web browser. Actually I want to close a file browser like desktop-file browser and so on.
Can you help me. Thanks once again.

shivnath
Newbie Poster
11 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

You can use the same commands (ps & kill) to terminate any application.
I needed something similar once and wrote a small script for it. To automate the commands, I made following (used firefox as example):

ps -e | grep firefox | sed 's/\(.[0-9]*\).*/\1/' | xargs kill
Firewolf
Light Poster
46 posts since Jan 2010
Reputation Points: 10
Solved Threads: 9
 

Thanks for your valuable reply. Your script is working well to close any firefox already opened. But as I said earlier that my problem is a little bit different. Suppose I open a desktop file browser by going through Places --> Desktop and then I want to colse that opened desktop file browser using command in linux. I am using debiian linux and I need such command in my project to proceed further. I hope you are understanding my problem. I want actually to close file browser window which have been already opened and not a web browser (like firefox). Waiting for your reply ............
Thanking you.....

shivnath
Newbie Poster
11 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

What file browser are you using? Nautilus?

Try:

ps -e | grep nautilus | sed 's/\(.[0-9]*\).*/\1/' | xargs kill


I just used firefox as an example...

Firewolf
Light Poster
46 posts since Jan 2010
Reputation Points: 10
Solved Threads: 9
 

What file browser are you using? Nautilus?

Try:

ps -e | grep nautilus | sed 's/\(.[0-9]*\).*/\1/' | xargs kill

I just used firefox as an example...


Yes, my file browser is nautilus. I used your script but it once closes the desktop file browser and again reopen it automatically. I have tried the following script to get process id and then kill it as you have done but the result is same.
ps -e | grep nautilus | cut -c2-5 | xargs kill.
One thing which is also a matter of concern that when i use this script and file browser is closed, all the icons from the desktop disappear and no mouse click works over the desktop. What i want is that desktop icons remain appear on the screen and only desktop file browser gets closed.
Thanks...........

shivnath
Newbie Poster
11 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

ohh thanks for the info

Bilal Ahmad
Newbie Poster
2 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

You can also open a popup menu from file manager windows. To open this popup menu right-click in a file manager window. The items in this menu depend on where you right-click. For example, when you right-click on a file or folder, you can choose items related to the file or folder. When you right-click on the background of a view pane, you can choose items related to the display of items in the view pane.

Huston229
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise

samsameer
Newbie Poster
1 post since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This might be valuable for the threadstarter:

top

Will list the processes that are using the most resources.

killall firefox/gnome/what-ever-name-of-process

Will force close that process without you needing to know the pid.

Computerphile
Newbie Poster
8 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
 

i have started using linux a few days ago ,,,i want to be a regular user but i dont know much technical thing like in windows.. thnx for the informative posts ..if you have any more info post it too thnx :)

robinbolt
Newbie Poster
1 post since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: