You'll use this file browser every day, so I'll give you a couple of tips to use it at best. First of all, ask your sysadm to configure
less so as it can display not only plain text files, but also compressed files, archives, and so on.
Like recent versions of
less lets you browse files in both directions. It also accepts several commands that are issued pressing a key. The most useful are:
qto leave the browser;
hgives you extensive help;
gto go to beginning of file,
Gto the end, number+
gto go to line `number' (e.g.
%to move to that percentage of the file;
/patternsearches forwards for `pattern';
nsearches forwards for the next match;
m+letter marks current position (e.g.
'+letter go to the marked position.
:eexamines a new file;
!commandexecutes the shell command.
Alas, Linux doesn't still support file version numbers, but you overcome this limitation in two ways. The first is to use RCS, the Revision Control System, which allows you to keep previous versions of a file. RCS is covered in ``The RCS MINI-HOWTO'' ( http://sunsite.unc.edu/mdw/HOWTO/mini/RCS.html).
The second way is to use an editor that knows how to deal with numbered backups;
jed are OK. In
emacs, add these lines in your
(setq version-control t) (setq kept-new-versions 15) ;;; or any other value (setq kept-old-versions 15) (setq backup-by-copying-when-linked t) (setq backup-by-copying-when-mismatch t)
jed, make sure you have version 0.98.7 or newer; the patch for numbered backups is available on
Under UNIX there are some widely used applications to archive and compress files.
tar is used to make archives, that is collections of files. To make a new archive:
$ tar -cvf <archive_name.tar> <file> [file...]
To extract files from an archive:
$ tar -xpvf <archive_name.tar> [file...]
To list the contents of an archive:
$ tar -tf <archive_name.tar> | less
Files can be compressed to save disk space using
compress, which is obsolete and shouldn't be used any more, or
$ compress <file> $ gzip <file>
that creates a compressed file with extension .Z (
compress) or .gz (
gzip). These programs don't make archives, but compress files individually. To decompress, use:
$ compress -d <file.Z> $ gzip -d <file.gz>
unzip utilities are also available. Files with extension
.tgz (archived with
tar, then compressed with
gzip) are very common in the UNIX world. Here's how to list the contents of a
$ tar -ztf <file.tar.gz> | less
To extract the files from a
$ tar -zxf <file.tar.gz>