If you’re running an X session, cut-and-paste is easy: Just use the mouse. But what about when you’re running in a non-graphical console? Or if you just prefer to keep your fingers on the keyboard? The utility screen, which enables you to run multiple screens on the same console (along with many other useful tricks), allows non-graphical cut-and-paste.
Tip of the Trade: Mouse-clicks may be synonymous with cut-and-paste, but in a non-graphical environment, they won’t help you. Enter Screen, which among its many useful tricks, enables non-graphical cut-and-paste.
To enter copy mode in screen, hit Ctrl+A, then [. You can now use the arrow keys, or vim-like keybindings, to move around the screen. 0 gets you to the start of a line, and $ to the end of a line.
You can also use Ctrl+A > filename to paste the selection to a filename and Ctrl+A filename to read a file into the selection buffer so you can then paste it out again using Ctrl+A ].
When in copy mode, you can also use screen‘s scrollback feature (i.e., you can scroll back upward past the top of the currently displayed text) and the search function.
Use ? to search backward. This is probably what you want initially, as you’ll be starting by default from the bottom of the scrollback.
/ searches forward.
Bear in mind that the default scrollback is only 100 lines. To increase this, add a line to your ~/.screenrc:
defscrollback 1000
This increases the scrollback to 1,000 lines; you can edit this value as you prefer.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of “Linux System Administration Recipes: A Problem-Solution Approach” (Apress, 2009).
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.