Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if there was a why to add to my shell script ,for running Minecraft, that will shutdown everything that isn't needed to keep the system running. Only the Minecraft process and for it to be reopened when Minecraft is closed? I'm very very new to Ubuntu 12.04 or Linux in general. Been learning as I go along.

share|improve this question
up vote 0 down vote accepted

First I'll try to answer your question, then I'll explain why you probably shouldn't do it :)

I haven't seen or heard of any shell scripts that would do this, but it will be relatively easy to write one yourself. Simply writing a shell scripts and in there pkill-ing the processes that you wouldn't need should do the trick, e.g.

pkill zeitgeist-fts
pkill dropbox

If you then make a second script to run the processes, e.g.

zeitgeist-fts &
dropbox & should be able to restart these processes (and to the more experienced folks on the website: please do edit if there is a better way to terminate/restart these processes). It might be better though to restart your session, e.g. log out or kill the X server, and that'll only take you a few seconds.

Now, here's why I think you will be better off with an alternative solution. Killing too many of these processes is going to leave you with a system that will be unstable, unsecure and probably unusable. If you pkill Dropbox you'll be alright, but pkill Zeitgeist and your Unity process won't operate as it should. Be very careful with what processes you terminate. Also, some processes won't be allowed to terminate and will simply restart. I think it's best to let them be restarted. If you block Compiz for example, it might be very annoying to manually restart it when you need it.

It sounds like you need all your computer's resources to run Minecraft.To summarise, it might be a bad idea to simply strip down Ubuntu to free some resources. Instead, you will be better off using a lighter distro, such as Lubuntu or Xubuntu.

share|improve this answer
I was just looking through some DEs. I'm using Gnome Shell and all, but to resource comprehensive. Thanks for the help, very very useful! – iKoVa Jul 19 '12 at 1:07
Ah, I assumed you used Unity, but as you said, Shell is also a resources hog compared to the lighter alternatives. You should take a look at Xubuntu if you're willing to dive into different DEs, version 12.04 is, just like the default flavour, a LTS release. – Tomas Jul 19 '12 at 2:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.