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 know how to suspend after a delay by using:

echo 'pmi action suspend' | at now + 1 minutes

However, that only seems to work as long as I keep the console window open. Am I correct in assuming that the at commands are cleared when I close the console?

This is an issue as I want to be able to log in to my computer via SSH, send the suspend command, then log out before it happens. Suspending immediately tends to freeze my local console window, which is inconvenient. Is there a way to send a delayed suspend command without it being cleared when I log out?

share|improve this question
up vote 1 down vote accepted

You can use screen and detach from the screen session. After that you can exit the ssh session and the command will continue to run.

screen (press [Return} to end the help screen)

in the new screen, you type your command and press ctrl-a d to detach from the session

then you can close your ssh terminal.

If you want to reconnect to the screen session, you can type screen -r.

share|improve this answer

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.