Fats : Programming : Linux Tools
Here you can find information about:
- General Unix/Linux ,
- Text editors , including vi(m) , and (X)Emacs ,
- Make & Makefiles ,
- The sed & awk family , including sed , awk , and other relatives of sed and awk , and
- the version control and archiving tool CVS ,
These items correspond to some of the most useful Unix/Linux tools that support programming. Note, however, that they don't cover the Unix/Linux shell and other scripting languages. Please, consult our Shell Scripting page for information about those.
General Unix/Linux
-
The University of Indiana has a short Introduction to Unix commands on their well linked and searchable IT Knowledge Base.
-
Here is a neat UNIX Tutorial for Beginners from the University of Surrey.
-
These two simple and clear tutorials from Queens University, Canada, cover
(t)csh
and other Unix material: Introduction to Unix Tutorial , and Advanced Unix Tutorial . -
The Linux Documentation Project has a number of resources for Linux users and programmers, including this Introduction to Linux , by Matchtelt Garrels (also available in pdf format), and a Pocket Linux Guide , by David Horton, (also available in pdf format).
-
The Stanford Computer Science Education Library has a very good Unix Programming Tools 16-page tutorial, covering compilation, the gcc compiler, the
make
utility, the gdb debugger, the Emacs text editor, and the Unix shell. -
Die.net is an interesting site, which features fancy browsable Linux
man pages
, (i.e. the manual pages of Linux commands). -
You can find a great collection of computer science and programming resources, including (but not restricted to) Unix and Linux, at Softpanorama .
-
A great collection of resources for Linux users and programmers is availabe in the Linux.org web site.
-
The Open Group maintains a The UNIX System web site, with a very complete and useful collection of resources for UNIX users and programmers.
-
The Berkeley Software Distribution (BSD) , is an influential variety of UNIX, developed at UC Berkeley. It was used as the base for the SunOS and the Apple MacIntosh OS-X, and for many parts of Gnu/Linux. The FreeBSD web site keeps a number of useful resources for Unix users and programmers, including an excellent documentation page . A number of original articles and tutorials, originally for the BSD 4.4, but still very useful for Unix/Linux users, is available at the FreeBSD Documentation Server .
Back to top.
Text editors
The two most popular text editors in Unix/Linux are
vi
, the visual editor
(which was improved and renamed
vim
in Linux, which stands for VI iMproved
),
and Gnu Emacs.
Vi
is available in any Unix/Linux machine,
Emacs in any Gnu Linux computer, and often
times you can also find the XEmacs editor,
which is a variant of Emacs.
Fats has all the three of them.
Here are a few tutorials and resources for them.
Vi(m)
-
Wikipedia's short article on
vi
describes the main characteristics of this text editor, and has a number of very good links. -
The
vi
editor was designed by Bill Joy . With Mark Horton, he also wrote this tutorial tovi
: An Introduction to Display Editing with Vi , which is also available in pdf format. -
Vim comes with its own internal tutorial. To stat that tutorial, on the Linux prompt type
vimtutor. -
Ben Yoshino, University of Hawaii, wrote this neat, short, but very effective Mastering the VI editor tutorial. A great place to start!
-
This Purdue University Vi Text Editor tutorial is another fast way to learn
vi
. -
If you are into the
cult of vi
, don't forget to visit The Vi Lovers Home Page , where you will find lots of very useful materials forvi
users and worshipers. -
If you keep forgetting all those keystroke combinations of
vi
commands, you may find this vim Quick Reference Card useful. It is also available in pdf format. -
For advanced applications of
vi
, see Steve Oualline's Vim Cookbook . -
A list of
vi
FAQ . -
The full Vim manual and a book are available free from Sourceforge, in browsable and printable formats.
(X)Emacs
-
Wikipedia's article on Emacs describes the history and features of this text editor, and has very good links to Emacs resources.
-
XEmacs is a text editor based on, but divergent from, Gnu Emacs. The Wikipedia article on XEmacs explains the differences and gives a few links on Xemacs.
-
Emacs was designed by Richard Stallman , a.k.a. RMS , the leading advocate and activist of the free software movement.
-
Emacs and XEmacs come with their own internal tutorials. To reach the tutorial, after starting either one of these text editors, type
<CTRL>-h t. -
The University of Texas IT Services keeps this helpful GNU Emacs Reference List , where you can quickly find the right Emacs command to do what you want to do.
-
Jeremy Zawodny's Jeremy's Emacs Stuff site has a few Emacs resources, featuring a helpful and relatively short Emacs Beginner's HOWTO . A good place to start if you want to learn Emacs.
-
A brief XEmacs tutorial from Ohio State University.
-
A browsable Emacs cheat sheet from Stanford University.
-
A printable Emacs reference card (pdf file) .
-
A browsable XEmacs reference card .
-
A printable XEmacs reference card (pdf file) .
-
The official Gnu Emacs FAQ in a single huge list, from gnu.org. The same Gnu Emacs FAQ split in smaller and more manageable lists, from faqs.org.
-
The XEmacs FAQ list.
-
The Gnu Emacs home page has a number of resources. For copious documentation on Emacs features, see the Gnu Emacs manual , also available in pdf format.
-
The XEmacs Project web site has a number of resources for XEmacs users, including complete documentation and manuals .
Back to top.
Make & Makefiles
From the standpoint of a programmer, the Unix/Linux utility make
,
and the corresponding Makefiles
, are a tool to enable systematic,
organized, efficient, and painless compilation of simple and complex programs.
Learning how to use make
, and how to write and modify Makefiles
,
is time well spent, and a must for whoever wants to do scientific
programming, even at a very simple level.
Here are a few tutorials and resources that will help you to learn
and use make
.
-
This short Wikipedia article tells what the
make
Unix/Linux utility is about. -
A a simple, clear, and very clever
make
tutorial by Ben Yoshino, University of Hawaii. This is most likely the best place to start, if you want to learn how to writeMakefiles
and to usemake
. -
Makefile Getting Started is a very good and simple introduction to
make
andMakefiles
by Brett Humphreys, Ohio University. -
Automating Program Compilation - Writing Makefiles is another good introduction to
Makefiles
andmake
, from Little Unix Programmers Group. -
For a bit more detail, see A short guide to Makefiles , by Owen Astrachan, Duke University.
-
An Introduction to the UNIX
make
Utility , from Middle Tennessee State University, Computer Science Department, is a very good short introduction to this tool. -
On fats, as in any other Gnu/Linux machine, we have Gnu
make
. If you want the full detailed documentation, the Gnumake
project keeps an up to date Gnumake
manual in many formats, including pdf .
Back to top.
The sed & awk family
Sed
and awk
are relatively simple and very flexible
programming languages with great capability to do one time things
,
such as generating, editing,
or reordering data in column format files, modifying the occurrences of
a particluar string on a group of files, etc.
More often than not, sed
and awk
programs are
very efficient and very simple (but sometimes cryptic) one liners,
which makes the use of both languages attractive.
Sed
and awk
can be used directly on the Unix/Linux command
line or in shell scripts, and are typically used for pre- and post-processing
of input and output data files for other programs written in C or Fortran,
whose file formatting capabilities require a more intensive programming effort.
Sed
-
The Wikipedia article on
sed
describes the capabilities and basic syntax of thestream editor
, and gives a good set of links with additional resources. -
This
An Introduction to sed
, from Harvey Mudd College, is a very simple and clear tutorial. -
A collection of useful
sed
one liner programs . -
Sourceforge archives a wealth of
sed
resources . In the sedder's grab bag you can find scripts, tutorials, and more! -
This series of short
by example
articles onsed
, by Daniel Robbins, Gentoo Technologies, is available from IBM: -
A good list of
sed
resources , by Eric Pement, Northpark University. -
The Softpanorama web page SED as a Pipe Tool , has good examples of uses of
sed
, and a number of excellent links to othersed
resources. -
This
Sed
and Regular Expressions web page, by Yao-Jen Chang has a number or interesting applications ofsed
. -
A very readable introduction to
sed
, also available in pdf format, is this 1978 original article that defines the goals and capabilities of the stream editor: SED - A Non-interactive Text Editor , by Lee E. McMahon , the designer ofsed
. (Not to be confused with Lee McMahon, The Tivoly 's bandleader.)McMahon, who had a Ph.D. degree in Psychology from Harvard and worked for Bell Labs, explains in the article how the stream editor works. In all examples the input data are these opening verses of Kubla Khan , the psychodelic poem published in 1816 by Samuel Taylor Coleridge , which are edited in several ways using
sed
:In Xanadu did Kubla Khan A stately pleasure dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea. -
A complete set of
sed
FAQ . -
On Linux machines like fats, you get the flavor of
sed
produced by the Gnu project. If you want complete documentation, the Gnused
project web site maintains the full Gnused
User's Guide , in several file formats, including PostScript . -
One of the few books available on
sed
is: Dale Dougherty, and Arnold Robbins, sed & awk, 2nd. Edition O'Reilly & Associates, Inc., Sebastopol, CA, 1997.
Awk
-
The Wikipedia article on
awk
gives a good general description of the language capabilities and syntax, and very good links to related sites. -
This
Getting started with awk
, from Harvey Mudd College, is a simple and clear tutorial. -
A slightly more detailed
An Awk Tutorial
, from Vectorsite.net. -
This series of short
by example
articles onawk
, by Daniel Robbins, Gentoo Technologies, is available from IBM: -
The Softpanorama web page AWK Programming , has good examples of uses of
awk
, and a number of excellent links to otherawk
resources. -
A good list of
awk
resources , by Eric Pement, Northpark University. -
A list of
awk
FAQ . -
On Linux machines like fats, you get the flavor of
awk
produced by the Gnu project, a.k.a.gawk
. If you want complete documentation, the Gnuawk
(gawk
) project web site maintains the full Gnuawk
User's Guide , in several file formats, including pdf . -
The best reference and cookbook on
awk
is authored by the designers of the language, whose initials were used to christianize their creature: Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger The AWK Programming Language , Reading, MA, 1988. Brian Kernighan, one of the authors, keeps thisawk
web page with book errata, source code for the book examples, etc. Incidentally, another author, Alfred Aho is a professor at Columbia University. The third author is Peter J. Weinberger, or PJW , whose mugshot picture , merged with the AT&T logo, became famous in a cult pioneer book of digital photography .
Other relatives of sed and awk
Besides awk
and sed
,
Unix (and Linux) have a number of software tools that can help you
write effective and simple scripts to do very useful things.
Unix tools are very simple.
Some of them are grep
, cut
, paste
, sort
,
join
, merge
, etc.
These tools were designed following the basic minimalist Unix philosophy:
do one thing, and do it right
.
However, these tools can be combined easily, each tool doing
its own thing
, to produce quite complex programs.
If you know which Unix tools to use, and how to combine them to
reach your goal, you can write effective scripts and program prototypes in
record time.
-
Softpanorama gives a good summary of Classic (pipable) Unix Tools , with examples, links to related sites, etc.
-
You can find more information about Unix tools and Unix shell scripting on our
Shell Scripting
page. -
The main reference book on Unix tools and environment is: Brian W. Kernighan and Rob Pike, The UNIX Programming Environment , Prentice Hall, Englewood Cliffs, NJ, 1984. One author, Brian Kernighan, keeps a web page for the book, with the examples source code, book errata, etc.
Back to top.
CVS
This is a list of useful miscellaneous software available on fats.
-
The Concurrent Versions System or CVS is a version control system that you can use to keep track of changes and updates in any tree of directories and files, particularly of programs source code. CVS was developed by Per Cederqvist.
The CVS manual , list of FAQ , an Introduction to CVS , and a tutorial , are available online.
The current version of CVS installed on fats is 1.11.1p1.
-
If you need assistance with CVS or other software on fats, please contact Gus Correa
Back to top.
Last updated on by Gus Correa.