Video Tutorial - Getting Started with GNU Screen

Peter Upfold takes a look at GNU Screen and gives a tutorial on how to use its multi-session capabilities, as well as renaming your sessions and using detaching and re-attaching.

Cygwin - a Unix Environment and Shell on Windows

Cygwin logo

If your daily routine means that you spend much of your time behind a Windows system, yet you love the power and flexibility of a Unix-based environment, it might be frustrating not to have access to the tools and environment that you want.

Alternatively, you might want to compile some Linux/Unix software, so that it can run natively under Windows.

Cygwin is a Linux-style environment for Windows, that gives you a set of libraries, a full Linux-style command line and a package manager so you can install many of the Unix programs you might be familiar with.

I thought I would take a look at Cygwin's latest release and show you how to install it and get up and running.

First of all, head on over to the site and download setup.exe. This is the main installer/package manager for Cygwin and by default you use it to do an internet-based install, i.e. the setup program itself will download the packages.

Downloaded setup.exe file

Cygwin Installer

Once the installer is up and running, click Next to bypass the initial welcome screen. You will be given several options on how you want to obtain packages. In most cases, Install from Internet is fine here.

Next, choose the directory to install Cygwin to on your Windows machine. This directory will become your root (/) from within the Cygwin shell.

Choose Cygwin directory

On the next screen, choose the temporary folder where packages will be downloaded before they are installed into Cygwin. If you want, you can use a Windows temporary folder, but if you want to keep the source packages files around so you don't have to redownload later, make it somewhere permanent.

Again, click the old Next button and choose whether you need to use a proxy. In most home computer situations, leave the defaults intact and move on.

The Installer will at this point go off and retrieve a list of the different download sites, or mirrors, available to you. Choose one geographically close to you in preference, but any of them should be fine.

Cygwin Select Packages

Here, you need to choose the packages that you want to install. You can just leave this all as it is and move on, but if you want to install additional packages into Cygwin, follow these steps.

The categories can be either left at the Default setting, or you can choose to Install or Uninstall whole categories by clicking on the 'recycling' icon next to them (and the word 'Default').

For individual packages, expand a category and find the package you want. To install or uninstall it, add a check under the 'Binary' and/or 'Source' columns to grab what you want.

Once you're done choosing packages, click Next yet again to move on. You can always come back to this stage later by re-running the installer to add or remove packages.

Cygwin Download and Installation

Download and installation now takes place. Depending on the speed of your machine and how much you've asked to download, this could take a while.

Once the installation is finished, pick your Desktop and Start menu shortcut options and Finish.

Finally - that's the installation done! You can access Cygwin through the shortcuts you just made, or by browsing to the directory you installed it in and launching cygwin.bat.

You will be presented with a bash shell, just as on Linux, and all of the Cygwin packages you installed should now be available for use.

Cygwin shell

You can also access Windows programs and files through /cygdrive/[Windows drive letter].

And there you have it - a Linux compatible environment for your Windows machine. Cygwin isn't really for the faint hearted, or those without Linux/Unix CLI experience, but it is a very powerful platform to bringing many features of the Unix platform to a Windows machine in a native way.

You can even run X on it.

Using GNU Screen on a Remote Machine

Cables - source http://www.sxc.hu/photo/496858

I recently posted about using nohup to run a command, particularly on a remote machine, that keeps running even when you close the terminal or connection that started it.

Several people in the comments there also suggested GNU Screen for a similar purpose.

So, what is Screen? It describes itself as:

... a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

Basically, among other things, it can create multiple 'virtual terminals' that run inside a single physical terminal or connection, and offers you additional features, such as resuming sessions later and basic copy and paste.

What we're interested in in the context of my other post is running commands in the background on remote machines, so I can start a command running, disconnect from SSH, but the command will stay running.

Screen, unlike Nohup, will allow me to come back later and interact directly with the terminal that I started, not just dump the results of a command to a file.

On your remote machine, start the program:

$ screen

You'll get a brief copyright notice and such, just press Space as directed. You are now running Screen (although it won't look any different to a normal terminal session by default).

Now, feel free to go off and start that important task. Once it's up and running, press Ctrl+A, then Ctrl+D. Screen sends you back to your shell and you can now disconnect.

Later, when you want to come back, run:

$ screen -r

Your old session is restored! Anything you started should still be running.

Screen is a lot more powerful than just offering this feature, however, but we'll save the rest for another day.

Finally, when you are actually done with a Screen session for good, quit it by pressing Ctrl+A, then Ctrl+\ or you can simply type exit into the terminal as normal.

[image source]

  1. 1
  2. 2
  3. 3
  4. 4
  5. ...
  6. Go to

Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe