Super User is a question and answer site for computer enthusiasts and power users. 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

Ok here's a quick question. I have a debian server with sass (driven by ruby) installed. To compile a sass file to a css file, yo do:

sass --watch style.scss:style.css

If I run this on my server through a terminal. Is that process still running when I close the terminal? If not, how do I keep it running? And how do I stop it if I want to?

share|improve this question
up vote 3 down vote accepted

If you want a process to be running even when you disconnect from a server, use nohup.

nohup sass --watch style.scss:style.css &

The & will start the job in the background. nohup makes sure that even when you log out, the process continues. Every output will be logged to nohup.out.

You can also have several output files for stdout and stderr:

nohup --watch style.scss:style.css > main.log 2> err.log &
share|improve this answer
Wow! Thank you! How can I stop the process? – tbleckert Jun 23 '11 at 10:17
I guess you would have to run ps aux | grep nohup | grep -v grep and then run kill PID where PID is the number in the second column. Haven't found a better way to do that yet. – slhck Jun 23 '11 at 10:20
Oh ok thank you :) – tbleckert Jun 23 '11 at 10:21
I've been using pkill sass to stop my processes (under Ubuntu 12.04). That worries me a little since it's not a delicate approach, but I'm the only person using my server and so far it hasn't killed anything unintended. – Andy Giesler Nov 2 '12 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .