no.1

Jul 3, 2008 at 11:01 o\clock

Using GNU Screen in Your Terminal

by: gaobin

Available in most Linux distributions, GNU Screen is a utility that allows you to split one terminal window into several separate terminal sessions. It's great for saving screen space by running multiple command-line applications in one large terminal window, rather than several smaller ones.

As a PHP developer, I use GNU Screen to split one large terminal window into three sessions; one to view directories containing project files, one to connect to and manage my MySQL database server and one to keep an eye on log files via the tail command.

When you start Screen in a terminal, you're presented with a welcome message then returned to the command prompt. The prompt looks and works exactly how it normally would, but now you have all the facilities of Screen at your disposal.

To start using Screen, Press Ctrl and the A key simultaneously.Now Screen is listening for your command.Use Shift-S to split the terminal window into two, creating two individual screens.

The terminal window is split, but you still have just one session active. Get Screen's attention again by pressing Ctrl-A and then hit Tab. This command will make the newly created screen the active one and can be repeated to cycle through screens.

Press Ctrl-A then c (lower-case, you don't need to use Shift for this command) and a new command prompt will appear.

You can close any command prompts by typing 'exit'

You should now have two screens, each with their own command prompt. You can repeat the split process to give yourself more screens if you like.

To resize a screen, press Ctrl-A followed by a colon (:) Now you'll see GNU Screen's own command prompt, where you can enter the command to resize the screen you're currently active in. Enter 'resize 10' to change the screen's height to ten lines.

Those are the basics of using GNU Screen, hopefully enough to give you some idea of how useful it can be. Many in-depth tutorials can be found through your favorite search engine if you're interested in learning more.


Comment this entry


Captcha

Attention: guestbook entries on this weblog have to be approved by the weblog\s owner.