Ctrl+S Ctrl+Q

Ctrl+S Ctrl+Q terminal output lock and unlock

These are simple shortcuts to pause and continue terminal output, works in most terminals and screen multiplexers like screen. You can use it to catch something if things change too fast, and scroll with Shift + PgUp PgDown. On linux console ScrollLock can also be used.

15
2009-04-02 09:27:09

These Might Interest You

  • There are different ways to run X, I prefer to run it without xdm/gdm. The problem is you can't lock X because one can press Ctrl+Alt+F1, press Ctrl+Z and kill you X locking process. Of course you can disable Ctrl+Alt* or Ctrl+Alt+Backspace keys, but it's inconvinient if you really need to switch into console.


    1
    alias onlyx='nohup startx & disown ; exit'
    elementa13 · 2010-07-26 12:44:13 0
  • Often times you run a command in the terminal and you don't realize it's going to take forever. You can open a new terminal, but you lose the local history of the suspended one. You can stop the running command using , but that may produce undesirable side-effects. suspends the job, and (assuming you have no other jobs running in the background) %1 resumes it. Appending & tells it to run in the background. You now have a job running concurrently with your terminal. Note this will still print any output to the same terminal you're working on. Tested on zsh and bash. Show Sample Output


    -1
    <ctrl+z> %1 &
    joem86 · 2010-10-25 17:43:38 2
  • when your terminal session seems unrensponsive (this normally happen after outputting some binary data directly on your standard output) it may me saned by hitting: CTRL+J tput sgr0 CTRL+J Note: don't press the Enter key, just ctrl+j


    1
    ^J tput sgr0 ^J
    berta · 2009-02-17 09:57:22 4
  • If you are using an xterm emulation capable terminal emulator, such as PuTTY or xterm on Linux desktop, this command will replace the title of that terminal window. I know it is not nice to have seventeen terminals on your desktop with title PuTTY, you can not tell which one is connected to which server and doing what. Even though the string between the quotes is typed as literals, it needs a little more finesse to make it work. Here is how it is done key-by-key: echo "( ctrl-v then ctrl-[ )0;Enter_Title_String_Here( ctrl-v then ctrl-g )"( enter ) ctrl-v : means hold down ctrl key and hit v at the same time like you are pasting in windoze ; also please don't type the parentheses, i.e., ( and )


    5
    echo "^[]0;My_Title_Goes _Here^G"
    TheNomad · 2009-02-17 20:46:06 3
  • this leaves the cursor at the bottom of the terminal screen, where your eyes are. ctrl-l moves it to the top, forcing you to look up.


    13
    cls(){ printf "\33[2J";} or, if no printf, cat >cls;<ctrl-v><ctrl+[>[2J<enter><ctrl+d> cls(){ cat cls;}
    argv · 2011-04-06 01:51:45 12
  • Saves opening another console terminal (eg. CTRL+ALT+F[n]) or opening another remote terminal. Ctrl+Z pauses the current task and pushed it to the background, leaving you with a command prompt for those "Oh crap I forgot to change xyz before I ran that and it'll take forever if I Ctrl+C and start again..." situations. Typing 'fg' (shorthand for foreground, that's how I remember it) will resume the paused task. Show Sample Output


    -1
    <CTRL+Z>; fg
    kbrotheridge · 2014-04-06 14:21:08 0

What Others Think

This is a trick I learned from MS-DOS 2.x day, only to realized MS-DOS copied from Unix.
haivu · 476 weeks and 5 days ago
also good to know if you hit the keys accidentally and wonder why your screen session seems frozen.
sud0er · 472 weeks and 6 days ago
This will not work with the KDE Konsole, the Ctrl+S shortcut is already being used for something else. Worked fine in xterm though.
hk0i · 467 weeks and 4 days ago
'stty -ixon' in your .bashrc will make sure your kbd won't get locked by accident and you can use that key combination for other things.
karol · 395 weeks and 2 days ago

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: