outsource from india chennai india programmers freelance php coder freelance outsource scripts programming complicated perl patterns php module installation
outsource from india perl installation and configuration php installation linux system administration US$15,US$19,US$11,US$10 cheap programmer
india outsource outsource india chennai india programmers php perl mysql freelance freelance programmer
SHOWCASE of php and perl scripts CONTACT US for php custom perl scripts
HOME
 
Next Previous Contents

10. Useful Programs

10.1 Browsing Files: less

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 TYPE, less lets you browse files in both directions. It also accepts several commands that are issued pressing a key. The most useful are:

  • first of all, press q to leave the browser;
  • h gives you extensive help;
  • g to go to beginning of file, G to the end, number+g to go to line `number' (e.g. 125g), number+% to move to that percentage of the file;
  • /pattern searches forwards for `pattern'; n searches forwards for the next match; ?pattern and N search backwards;
  • m+letter marks current position (e.g. ma); '+letter go to the marked position.
  • :e examines a new file;
  • !command executes the shell command.

10.2 Numbered Backups Under Linux

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; emacs and jed are OK. In emacs, add these lines in your .emacs:

(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)

In jed, make sure you have version 0.98.7 or newer; the patch for numbered backups is available on http://ibogeo.df.unibo.it/guido/slang/backups.sl .

10.3 Archiving: tar & gzip

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 gzip:

$ 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>

RMP.

The unarj, zip and unzip utilities are also available. Files with extension .tar.gz or .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.gz archive:

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

To extract the files from a .tar.gz archive:

$ tar -zxf <file.tar.gz>


Next Previous Contents
Linux HOWTO full list
   This document, LDP HOWTO-INDEX, is copyrighted (c) 1995 - 2002 by Tim Bynum, Guylhem Aznar, Joshua Drake and Greg Ferguson. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. If you have questions, please contact the LDP.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed