Blog

03/06/2019

Linux: GNU/Screen Scroll Up and Down Look At Data



I am using GNU Screen software application to multiplex several virtual consoles. I can access multiple separate terminal sessions inside a single terminal window over remote ssh terminal session. Often I need to go though server logs located in /var/ directory. I can not seem to scroll up when I run tail -f /var/log/messages or /var/log/secure file. How do I use page-up / page-down keys to scroll up under GNU scree?

You need to use the following key combination to scroll up and look at your data under GNU screen. First press:

CTRL-A

Next press:
[

This will activate copy mode in GNU/screen. Now, you can scroll up/down and look at your data. Use the following keys:

  1. CTRL-u and CTRL-d scroll the display up/down by the specified amount of lines while preserving the cursor position. (Default: half screen-full).
  2. CTRL-b and C-f scroll the display up/down a full screen.

From the man page – following movement keys can be used in copy mode:

         h, j, k, l move the cursor line by line or column by column.
         0, ^ and $ move to the leftmost column, to the first or last non-whitespace character on the line.
         H, M and L move the cursor to the leftmost column of the top, center or bottom line of the window.
         + and - positions one line up and down.
         G moves to the specified absolute line (default: end of buffer).
         | moves to the specified absolute column.
         w, b, e move the cursor word by word.
         B, E move the cursor WORD by WORD (as in vi).
         C-u and C-d scroll the display up/down by the specified amount of lines while preserving the cursor position. (Default: half screen-full).
         C-b and C-f scroll the display up/down a full screen.
         g moves to the beginning of the buffer.
         % jumps to the specified percentage of the buffer.

For searching use the following vi like syntax:

  • /SearchWord – Vi-like search forward.
  • ?SearchWord – Vi-like search backward.

See screen man page for more information:
$ man screen

Posted by: SXI ADMIN

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

14/08/2019

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...
14/08/2019

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....
12/08/2019

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...