Linux Technical FAQ

This page is home to my technical Linux FAQ, where I cover some of the simple tasks that seem to cause the most confusion to Linux users. Its covering things like; screen capture and floppy disk use, with more being added as soon as time allows. Now if your questions are not technical, all is not lost, as my non-technical FAQ may be of help to you.

DISCLAIMER: All the information contained in this page, or any linked from it, is provided as is, having no warranty or support of any kind, and is used entirely at your own risk.

The Questions

  1. How do I capture the screen to a file?
  2. How do I use my floppy drive?

How do I capture the screen to a file

Under Windows you have the option to use the print screen key to copy specific areas of the screen to the clipboard, now under X Windows under Linux this is not the case. All is not lost there is a command line tool that does this, this is import, which you use like this.

import filename.jpg

After you run this you will see the mouse pointer becomes a cross hair, which you use to select the window that you want to capture, then simply click in that window and its brought to the foreground, the a image of the window contents is written as "filename.jpg". This example is about the easiest way to use this command, I do strongly encourage you to look at the man page (man import) as this command has many options.

TIP: When I use this I normally open up a shell and run import that way, this means that the capture file is written to a known directory, without the need to include a path on the command line. As always up to you...

How to access your floppy drive

Coming from the windows world, you will be used to accessing floppy disks via a drive letter such as A: or B: now you are in the Linux/UNIX world this is no longer the case. Under UNIX or Linux you need to first mount the device, yes the floppy drive is a device just like the CDROM, hard disks etc. But first you need to know the device name, in most cases it will be fd0 (floppy disk 0). For this example I will assume the device name is indeed fd0. Other than the device name you will need to know where to mount it, again there is usually a default which is /mnt/floppy, which again is what I will assume to be true. OK to mount the drive you use the following command after inserting the disk in the drive (VERY IMPORTANT)

mount /dev/fd0 /mnt/floppy

This while it does work is not the only way to do it, you can make use of the /etc/fstab file, which holds a list of devices and where they are mounted by default, and use the following shorter command

mount /dev/fd0

In this case the mount command will look in the /etc/fstab file and use the mount point defined there, usually /mnt/floppy. Thats not all there is yet another way of doing the same thing, also taking advantage of this very useful file.

mount /mnt/floppy

Just in case you did not already guess, this example will lookup the mount point in the /etc/fstab and mount the device thats linked to the mount point /mnt/floppy. cool yes?

Now you have a mounted disk, you can access the disk from the /mnt/floppy directory (yes a mount point is a directory). But thats not the end of it, you cannot just take the disk out of the drive and expect all to be well with the world, you need to unmount the device before you can continue. Just like with the mount command there are several ways of doing this, and yes its similar to the way you mounted the disk. Un-mounting a device is done with the following command

umount /dev/fd0

or

umount /mnt/floppy

Yes thats right you can use either the mount point or the device name when un-mounting the device, there is no need for both.

TIP: One final thing you really need to understand is that when you copy a file to the floppy mount point its not written to the disk until you unmount the disk. This one is kind of important, so thought I had better make sure you understand it.

Valid XHTML 1.0 Strict