13 – Linux Tools & Applications
December 5, 2009 – 10:16 pmPlease note… This information no longer exists at the referenced locations. This is only a copy of what was available in 2003.
Basic Linux Training™
Linux Tools & Applications
Stefan Waidele jun.
Based on the original lesson by Henry White
Table of Contents
Editors
One of the most important software choices you’ll make is that of which editor to use. It’s not a matter of which one is better – that question always degenerates into a religious war.
The point is that you learn as much as you can about using the one you decide to use, and as quickly as possible.
What seems to work best in learning these programs is to keep a notebook while you’re learning, and transfer the most useful commands to index cards.
I would like to classify editors by the way they accept commands. There is vi, emacs, Wordstar and others. You absolutely, positively MUST learn your way around in vi! (See section below for details)
There are built-in tutorials in vi and emacs.
vi or vim (Vi IMproved)
vi has been around for almost 30 years, and you’ll find some version of it on every Unix/Linux machine worldwide. More importantly, vi is small enough to put on a bootable floppy for emergency ‘repairs’ and powerful enough to handle all your editing needs. When you’re under pressure to get the system back up and running as quickly as possible, you don’t want to have to learn how to use vi or whatever editor is on your rescue floppy – some distributions use ae which is very simple and easy to understand. You won’t have the luxury of using your favorite word processor in those situations.
One might argue that rescue-disks today are on CDs and have enough space for several editors (KNOPPIX boots from CD and even has OpenOffice on it). But there are several occasions when it is good to know vi, since commands like crontab will dump you into a vi-like environment. Then you’ll need to know at least some basic commands.
Most importantly, pressing <Esc> :q! <Return> will get you out of vi without saving anything (read: Without trashing your system.
)
You move the cursor with your right hand, using the keys h, j, k and l. This way the hand can stay in its regular position, using the index-finger for the direction that is used most: Down. (The cursor-keys might also work, but don’t rely on them.)
In order to actually edit the file, press i to get in to insert-mode and type away. <Esc> gets you back into command-mode to move around. To save your changes and exit, press <Esc> :wq <Return>
If you work in X11, you might take a look at gvim and kvim, the Gnome and KDE versions of vi. With them, you have an editor with menus and everything, but can get used to the keystrokes. If you don’t know how to do something with the keyboard, look in the menus. They have the corresponding keys right next to the options.
For the tutorial on vi simply type vimtutor from the shell. (Strictly speaking, this is the tutorial for vim – Vi IMproved, but on most systems vi is a link to vim and the basic functions are the same.)
emacs
Another popular editors is emacs which will do virtually anything you want to do. There are three major OS today: Linux, MacOS X and Emacs.
The price you pay for all that versatility is size – emacs is huge – some 45MB compared to the 67KB of the versatile e3 mentioned below. And slow. (Some say that’s where it got it’s name – Emacs Makes Any Computer Slow
) Of course, on modern PCs you probably won’t notice it, and it has an abundance of built-in features – which some people like. Still that’s too much horsepower if you only need to make a quick edit to a file. The flip side is that you can comfortably stay in emacs the entire session, day after day.
Most importantly, pressing <Ctrl>x followed by <Ctrl>c and n<Return>yes will get you out of emacs without saving anything (read: Without trashing your system
).
You move the cursor by holding down <Ctrl> and pressing n, p, f or b, which is for next, previous, forward and backward. (The cursor-keys might also work, but don’t rely on them.)
In order to edit the file, just type away. To save your changes and exit, press <Ctrl>x<Ctrl>s<Ctrl>x<Ctrl>c
If you work in X11, emacs starts up in a GUI; so you have an editor with menus and everything, but can get used to the keystrokes. If you don’t know how to do something with the keyboard, look in the menus. They have the corresponding keys right next to the options.
For the emacs-tutorial, start it up and press C-h t (That is <Ctrl> and ‘h’ simultaneously and after that ‘t’).
Wordstar like editors
There are several editors using the commands that come from the Wordstar word-processor many are still used to. If that is a feature for you, then you know them already and do not need a tutorial. So I will skip the quick run-through ![]()
The curious find a listing of the Wordstar-Keybindings in ‘man e3′. A popular editor using these keys is joe.
Other Editors
e3 is a small editor that can disguise itself as wordstar, emacs, pico, vi or Nedit, depending on how you call it on the command line: e3ws, e3em, e3pi, e3vi, e3ne (Thus, the 3 in the name is an understatement). It makes a perfect candidate for the emergency floppy mentioned before, since it only takes 10K of disk space for the binary (67KB according to the RPM).
There are many more editors that follow their own scheme. They might be even more suitable for those new to Linux. With all the learning one has to do in order to master Linux, one might not want to struggle with such basic applications like editors. So here is a list of some other editors worth checking out; most of them are mouse and/or menu-driven:
General notes
If you are used to an editor, you will find out what you can do with it: System configuration, HTML for web pages, publishing with LaTeX, programming – literally everything.
As with your choice of a distribution, don’t “marry” the first one that happens by
Take your time. Try them all. Then decide for yourself.
If you haven’t already discovered it, ispell is a nice spell checker which you can use alone, or as one of the options in a number of other application programs; another spell checker is aspell. They are, for all intents and purposes, interchangeable.
Text processing
The office type of word processing in Linux is done with one of the available office-suites: OpenOffice (free version of StarOffice), KWord (KOffice) or Abiword (Gnome-Office)
There are older, but still very usefull systems for word processing in a very litterare meaning. These take text as ASCII-files with markup-tags and format the text accordingly. The philosophy behind that is that the author should not have to worry about how the text will look when printed or displayed. Others take care of that. This process is derived from the traditional publishers’ workflow.
This way of marking up text is very up to date. SGML with its probably most famous child HTML is one of the standards. (HTML has been made soft by including ‘text-formating’ tags.) There are also XML, TeX, LaTeX, texinfo. They all have in common that the sourcefiles describe what is in the text and not so much how the text should look. Letting the computer know what is in the file is a way of opening up documents to the future, enabeling output devices we do not immagine yet to “display” our documents. They can be printed, displayed on monitors, read out loud, searched intelligently, …
Other Programs and Utilities
I highly recommend that you spend some extra time on Chris Browne’s pages. He has done an outstanding job of reviewing and categorizing the available software. There is no need to repeat that here.
Check your installation – /bin, /sbin, /usr/bin, /usr/local/bin, etc. – for the binaries currently on your machine. (You might want to make a list of each of these, saved as a text file or send them to your printer.)
Never delete anything from those bin-directories unless you are absolutely sure what you are doing. Your distribution has set them up for your system to work. If you mess with the commands, or delete some of them you think you don’t need, you might break some dependencies and wreck your system. Even if you are low on disk-space, you should not delete anything that is not in your /home/ or /usr/local/ unless you know what you are doing. If you want to remove programs, use your distribution’s package-management.
You should know some of the programs and utilities in those bin-directories already. When you run across one you are not familiar with, check the man or info page. You can also use apropos to find similar programs by category.
Here’s an interesting exercise:
script
TAB-TAB
CTRL-D
more typescript
Warning: If you forget CTRL-D, script will continue to echo everything to the file typescript until you run out of disk space.
As you talk with other Linux people, you’ll hear about nifty programs and utilities you simply must have on your machine. You’ll also hear about ‘hacks’ to your configuration that will make life easier and better.
For example, the basic ls can be modified (read ‘aliased’) if it isn’t already (in /etc/profile) so that instead of ls -a (as mentioned above) you can type la, or instead of ls -l use ll. In fact, you’ll probably want to colorize the ls command to have all HTML files, executables, scripts, and tarballs, for example, display in the same color so they stand out from each other quickly at a glance.
There are too many programs to cover them all here. You won’t know whether you like them until you try them, and *this* is another instance where being active in the local Linux Users’ Group saves you a lot of trial and error! Most members are quite proud of their machines and configurations, and most meetings have one or more machines brought in for ‘show and tell’ or hands-on practice (something we can’t do here on a mailing list).
For many tips and techniques to get the job don go to The Linux Cookbook. It shows very well that unix (and thus linux) is not about big programs, but about using small pieces to build something big. I really urge everyone who is ‘no friend of the shell’ yet to take a look at it, since it really shows ‘the power of the word’.
I have put together a list of tasks I have to perform on a regular basis together with a list of programs I use to do them. I have also added programs that came to my mind as alternatives. So this list is neither complete nor political correct. But it can serve as a start to getting things done with Linux.
Viewing (and maybe creating) different kinds of file-formats:
- PDF, PS: acroread (Adobe) or ghostview
- Most graphical formats: The Gimp
- Tons of JPEGs: pixie plus
- MP3, OggVorbis: xmms
- AVIs, DVDs, MPEGs: xine, mplayer
- MS-Office files: OpenOffice
- …
If you need to convert a file to another format try <source>2<dest> as a command. For example, if you have a ps but need a pdf, try ‘ps2pdf myfile.ps’. For images, you can also use the gimp (interactively) or imagemagick’s mogrify (for batchprocessing).
Getting things done:
- Syncing the Palm: jpilot
- Browsing the Web: Mozilla, Konqueror, links
- Archiving websites: wget
- E-Mail: Mozilla, mutt, Evolution, Kmail
- Burning CDs/Backups: mkisofs + cdrecord, k3b
- …
File management
- Bash: The standard command line interface used in Linux. Once you are comfortable with it, you will not need anything else. The tab-key is your best friend (auto-completion).
- mc: Midnight Commander, looks like that other commander under DOS
- Konqueror & Nautilus: Graphical Filebrowsers that resemble a famous windows-application.
- mmv: Multiple Move. If you need to rename many files in one swoop.
- find & xargs: If you need to perform the same operation on many files.
- …
So you still need that windows-app?
- Wine:is a free windows emulator. It was used by corel for porting photopaint and others who desperately needed to have a linux-version of their windows-application.
- Crossover Office: Lets MS-Office run under Linux.
- Win4Lin: Emulates a PC for the original Windows-files to run on. Only Windows runs on Win4Lin.
- VMWare: Emulates a PC. You can install almost any OS you want on that piece of virtual hardware. Runs Linux, BSD, Dos/Windows up to XP, and inofficially even Novell Netware.
- …
Linux games:
Yes, there are games for linux
Assignments
Terms and Concepts:
Define and add these to your glossary:
- text editor
- text formatter
- text processing
- word processing
- spell checker
- vi – command mode
- vi – edit (insert) mode
- vi – ex mode
- vi – yank
- register
- macros
- regular expression – regexp
- grep
- emacs – yank
- TeX
- LaTeX
- groff
- Texinfo
- ldp
- nemscript
- AFS
- ISO 9660
- FAT-16
- FAT-32
- file formats
- iBCS2
- mtools
- emulator
- dosemu
- wine
- samba
Online:
Check on your CD-ROM or the LDP site online: HOWTO Index
There are many great resources online. This is just a brief listing to get you started.
- http://dsl.org/cookbook/ – The Linux Cookbook
- http://www.delorie.com/gnu/docs/ – GNU Manuals
- http://www.geek-girl.com/unix.html#texinfo – GNU texinfo pages
- http://www.indiana.edu/~ucspubs/b131/ – emacs Reference Card
- http://www.mcsr.olemiss.edu/unixhelp/vi/ref.html – vi Reference Card
- http://www.eng.hawaii.edu/Tutor/vi.html – Mastering the vi Editor
Chris Browne has several long, annotated (read ‘opinionated’) pages on most everything related to Linux, Linux advocacy and Linux software.
- http://cbbrowne.com/info/wp.html – Linux Word Processing
- http://cbbrowne.com/info/spreadsheets.html – Linux Spreadsheets
- http://cbbrowne.com/info/financelinux.html – Linux Financial Software
Copyright © 1997-2003 Henry White. Copyright © 2003 Stefan Waidele jun. All Rights Reserved.
Reproduction or redistribution without prior written consent is strictly prohibited. Address comments and inquiries to info@basiclinux.net
Sorry, comments for this entry are closed at this time.