/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

Show OSX Login Screen

This keeps the user logged in but shows the login screen. Very useful when connecting remotely to an OSX-Server via VNC

0
By: zagdul
2013-04-23 14:27:10

These Might Interest You

  • when using Gnome or KDE, you will have a hard time getting a screenshot of something like a login screen, or any other screen that occurs before the desktop environment is up and monitoring the printscreen key. (this probably applies for other DEs as well, but I haven't used them) What this command is meant to do is take a screenshot of an X window using a command you can run from your virtual terminals (actual text terminals, not just an emulator) To do this: Press CTRL+ALT+F1 to go to a virtual (text) terminal once your login window comes up Login to the virtual terminal and enter the command (you'll have to type it in) You should now have a file called screenshot.png in your home directory with your screenshot in it. For those of you who are new to the virtual terminal thing, you can use CTRL+ALT+F7 to get back to your regular GUI From http://www.gnome.org


    3
    chvt 7 ; sleep 2 ; DISPLAY=:0.0 import -window root screenshot.png
    camocrazed · 2010-08-20 17:28:49 1
  • From screen's manpage: "Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user. This is the author's favorite." Toss this in your ~/.bash_profile so that you never have that "oh crap" moment where you wanted to run something in screen and didn't.


    11
    echo "screen -DR" >> ~/.bash_profile
    sud0er · 2009-04-28 20:45:37 0
  • Killall5 will kill your session and redirect to login screen. -Very useful when suffering display problems. -Can use F1-F6 -Need to login in the particular console if not already


    1
    <Ctrl><Alt><F6> killall5
    totti · 2011-09-07 19:19:34 0
  • Notifyme is a program that listen in background for users login, and report on login and logout. Users can be specified from a list or in a ~/notify.rc file. -C options force to display messages on the center of the screen.See man notifyme for more details. Part of notifyme package, tested on Debian. Show Sample Output


    4
    notifyme -C `cat /etc/passwd | cut -d: -f1`
    servermanaged · 2009-05-19 19:17:05 2
  • If you know the benefits of screen, then this might come in handy for you. Instead of ssh'ing into a machine and then running a screen command, this can all be done on one line instead. Just have the person on the machine your ssh'ing into run something like screen -S debug Then you would run ssh -t user@host screen -x debug and be attached to the same screen session.


    7
    ssh -t user@host screen -x <screen name>
    Dark006 · 2009-08-02 15:39:24 0
  • the $15 may change for you depending on your distro, etc...


    4
    x11vnc -display :0 -auth $(ps -ef|awk '/xauth/ {print $15}'|head -1) -forever -bg &
    nottings · 2009-02-19 18:55:54 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: