Next Previous Contents

11. The Remaining 1%

Much more than 1%, actually...

11.1 Running DOS/Windows Apps

Yes, you can to some extent run DOS and Windows applications under Linux! There are two emulators that are quite good: Dosemu ( http://www.dosemu.org) and Wine ( http://www.winehq.com). The latter is getting better release after release, and the list of runnable applications is getting larger. It even runs Word and Excel!

11.2 Using tar and gzip

Under UNIX there are some widely used applications to archive and compress files. tar is used to make archives---it's like PKZIP or Winzipbut it doesn't compress, it only archives. To make a new archive:

$ tar cvf <archive_name.tar> <file> [file...]

To extract files from an archive:

$ tar xvf <archive_name.tar> [file...]

To list the contents of an archive:

$ tar tf <archive_name.tar> | less

You can compress files using compress, which is obsolete and shouldn't be used any more, or gzip:

$ compress <file>
$ gzip <file>

that creates a compressed file with extension .Z (compress) or .gz (gzip). These programs can compress only one file at a time. To decompress:

$ compress -d <file.Z>
$ gzip -d <file.gz>

RMP.

There are also the unarj, zip and unzip (PK??ZIP compatible) utilities. Files with extension .tar.gz or .tgz (archived with tar, then compressed with gzip) are as common in the UNIX world as .ZIP files are under DOS. Here's how to list the contents of a .tar.gz archive:

$ tar ztf <file.tar.gz> | less

11.3 Installing Applications

First of all: installing packages is root's work. Most Linux applications are distributed as a .tar.gz archive, which typically will contain a directory aptly named containing files and/or subdirectories. A good rule is to install these packages from /usr/local with the command

# tar zxf <archive.tar.gz>

reading then the README or INSTALL file. In most cases, the application is distributed in source, which you'll have to compile; often, typing make then make install will suffice. If the archive contains a configure script, run it first. Obviously, you'll need the gcc or g++ compiler.

Other archives have to be unpacked from /; this is the case with Slackware's .tgz archives. Other archives contain the files but not a subdirectory - careful not to mess things up! Always list the contents of the archive before installing it.

Debian and Red Hat have their own archive format; respectively, .deb and .rpm. The latter is widely used by many distributions; to install an rpm package, type

# rpm -i package.rpm

11.4 Tips You Can't Do Without

Backscrolling: pressing <SHIFT + PAG UP> (the grey key) allows you to backscroll a few pages, depending on how much video memory you have.

Resetting the screen: if you happen to more or cat a binary file, your screen may end up full of garbage. To fix it, blind type reset or this sequence of characters: echo CTRL-V ESC c RETURN.

Pasting text: in console, see below; in X, click and drag to select the text in an xterm window, then click the middle button (or the two buttons together if you have a two-button mouse) to paste. There is also xclipboard (alas, only for text); don't get confused by its very slow response.

Using the mouse: if you installed gpm, a mouse driver for the console, you can click and drag to select text, then right click to paste the selected text. It works across different VCs.

Messages from the kernel: have a look at /var/adm/messages or /var/log/messages as root to see what the kernel has to tell you, including bootup messages. The command dmesg is also handy.

11.5 Where to Find Applications

If you're wondering whether you can replace your old and trusted DOS/Win application with a Linux one, I suggest that you browse the main Linux software repository: ftp://metalab.unc.edu/pub/Linux. Other good starting places are the ``Linux Applications and Utilities Page'' http://www.xnet.com/~blatura/linapps.shtml, the ``official'' Linux page http://www.linux.org, and http://freshmeat.net.

11.6 A Few Things You Couldn't Do

Linux can do an awful lot of things that were cumbersome, difficult or impossible do to with DOS/Windows. Here's a short list that may whet your appetite:

11.7 Practicing UNIX under DOS/Win

Believe it or not, there are fine tools that provide a UNIX-like environment under DOS/Windows! One is the Djgpp suite ( http://www.delorie.com/djgpp/) for DOS, while Cygwin ( http://www.cygnus.com/cygwin) is a more complex port for Win32. Both include the same GNU development tools and utilities as Linux; you won't get the same stability and performance, though.

If you'd like to have a taste of Linux, try out Djgpp. Download and install the following files (as of this writing, the latest version is 2.02): djdev202.zip, bnu281b.zip, bsh1147b.zip, fil316b.zip, find41b.zip, grep22b.zip, gwk303b.zip, lss332b.zip, shl112b.zip.. Installation instructions are provided, and you can find assistance on news:comp.os.msdos.djgpp.

In particular, using bash under DOS/Win is a whiff of fresh air. To configure it properly, edit the supplied file BOOT.BAT to reflect your installation, then put these files in your home directory (in the Windows partition) instead of those provided:

# this is _bashrc

LS_OPTIONS="-F -s --color=yes"
alias cp='cp -i'
alias d='ls -l'
alias l=less
alias ls="ls $LS_OPTIONS"
alias mv='mv -i'
alias rm='rm -i'
alias u='cd ..'

# this is _bprof
if [ -f ~/_bashrc ]; then
  . ~/_bashrc
fi
PS1='\w\$ '
PS2='> '
CDPATH="$CDPATH:~"
# stuff for less(1)
LESS="-M-Q"                     # long prompt, silent
LESSEDIT="%E ?lt+%lt. %f"       # edit top line
VISUAL="jed"                    # editor
LESSCHARSET=latin1              # visualise accented letters
export PS1 PS2 CDPATH LS_OPTIONS LESS LESSEDIT LESSOPEN VISUAL LESSCHARSET

11.8 Common Extensions and Related Programs

You may come across scores of file extensions. Excluding the more exotic ones (i.e. fonts, etc.), here's a list of who's what:

11.9 Converting Files

If you need to exchange text files between DOS/Win and Linux, be aware of the ``end of line'' problem. Under DOS, each line of text ends with CR/LF (that is, ASCII 13 + ASCII 10), with LF under Linux. If you edit a DOS text file under Linux, each line will likely end with a strange--looking `M' character; a Linux text file under DOS will appear as a kilometric single line with no paragraphs. There are a couple of tools, dos2unix and unix2dos, to convert the files.

If your text--only files contain accented characters, make sure they are made under Windows (with Notepad) and not under plain DOS; otherwise, all accented characters will be screwed up.

11.10 Free Office Suites

Yes, you can have for free what would otherwise cost a lot of money!

StarOffice ( http://www.sun.com/staroffice.) is currently the only choice, though Koffice is down the pipeline ( http://www.koffice.org). StarOffice is big and slow, but very good anyway: it offers a lot of functionality not found in Microsoft Office. It can also read and write Word and Excel files, although the conversion isn't always perfect.

Another good package is Corel WordPerfect, a free edition of which is available for download. Need I say more? Go fetch it: http://www.corel.com.


Next Previous Contents

Hosting by: Hurra Communications Ltd.
Generated: 2007-01-26 17:58:00