This is example of the command:

 screen -S dua -X stuff $'commandhere'

I've searched lots of resources but still not found the command for keypress Ctrl+R.

  • 2
    All screen keystrokes are after a prefix (Ctrl-a by default), so do you mean C-a C-r? – Barmar Sep 4 '14 at 20:48
  • I mean Ctrl+R jut like pressing Ctrl+C when copying text – apasajja Sep 5 '14 at 5:07
  • I don't understand the question. Are you asking how to make C-R execute that command, or are you asking about what C-R does in screen? – Barmar Sep 5 '14 at 5:51
  • Which shell are you using? – ByteNudger Sep 5 '14 at 16:28
  • I'm using bash. – apasajja Sep 6 '14 at 2:56

In the bash shell the Ctrl+R invokes the build-in command reverse-search-history (C-r). Here is the section from the man 1 bash or you can find at bash(1): GNU Bourne-Again SHell - Linux man page.

reverse-search-history (C-r)

    Search backward starting at the current line and moving 'up' through 
    the history as necessary. This is an incremental search.

The only other command which maybe invoked is a screen specific one for line wrapping, but it's normally invoked like Ctrl+a Ctrl r. The description is from man screen or from Screen User's Manual.

Command: wrap state

    (C-a r, C-a C-r)
    Sets the line-wrap setting for the current window. When line-wrap is on,
    the second consecutive printable character output at the last column of a
    line will wrap to the start of the following line. As an added feature, 
    backspace (^H) will also wrap through the left margin to the previous 
    line. Default is ‘on’. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.