SHARE
Facebook X Pinterest WhatsApp

Cut and Paste With Screen

Written By
thumbnail Juliet Kemp
Juliet Kemp
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



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.

  1. When you’ve reached the point where you want to start the copy, hit Enter.
  2. Move the cursor to the end point of your selection (you’ll see what you’re copying highlighted), and then hit Enter again.
  3. Now move the cursor to wherever you want to paste the selection (you can move to another screen within your session), and hit Ctrl+A ] to paste the selection.

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).

Follow ServerWatch on Twitter

thumbnail Juliet Kemp

Juliet Kemp is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

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.