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 trying to figure out difference between

gnome-screensaver-command -a


gnome-screensaver-command -l

According to the gnome-screensaver-command man page...

-l, --lock                 Tells the running screensaver process to lock the screen immediately
-a, --activate             Turn the screensaver on (blank the screen)

For me in both the cases it generated the login screen.Can some one outline the difference in the two things??

share|improve this question
up vote 4 down vote accepted

I think that depends on the gnome-screensaver settings.

  • If you set your gnome screensaver not to lock the screen, than the -a option will not lock the screen.
  • If you set your gnome screensaver to lock the screen, then -a will lock it; this is the default setting in Ubuntu as far as I remember.
  • Option -l, however, will always lock it.
share|improve this answer

The help is accurate. It describes what they're supposed to do.

Your scenario suggests X is crashing and I would suggest filing a bug (via ubuntu-bug gnome-screensaver) and seeing where that takes you. It could be something as silly as the particular screensaver you have selected (try another).

share|improve this answer
I think that OP means that both commands lock the screen. – January Sep 17 '12 at 14:34

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.