Before you can understand what is really going on when there is a problem, you need to know the theoretical role played by each program involved in the problem. To do this, the best reflex to have is consult their documentation; but since these documentations are many and can be scattered far and wide, you should know all the places where they can be found.
Manual pages, while relatively terse in style, contain a great deal of essential information. We will quickly go over the command for viewing them. Simply type man manual-page
— the manual page usually goes by the same name as the command whose documentation is sought. For example, to learn about the possible options for the cp
command, you would type the man cp
command at the shell prompt (see sidebar).
Man pages not only document programs accessible from the command line, but also configuration files, system calls, C library functions, and so forth. Sometimes names can collide. For example, the shell's read
command has the same name as the read
system call. This is why manual pages are organized in numbered sections:
comandi eseguibili dalla riga di comando;
chiamate di sistema (funzioni fornite dal kernel);
funzioni di libreria (fornite dalle librerie di sistema);
devices (on Unix-like systems, these are special files, usually placed in the /dev/
directory);
configuration files (formats and conventions);
giochi;
insiemi di macro e standard;
comandi di amministrazione del sistema;
routine del kernel.
È possibile specificare la sezione della pagina di manuale che si sta cercando: per vedere la documentazione della chiamata di sistema read
, si scriverà man 2 read
. Quando non è esplicitamente specificata una sezione, verrà mostrata la prima sezione che ha una pagina di manuale col nome richiesto. Perciò, man shadow
restituirà shadow(5) perché non ci sono pagine di manuale per shadow nelle sezioni da 1 a 4.
Of course, if you do not know the names of the commands, the manual is not going to be of much use to you. This is the purpose of the apropos
command, which helps you conduct a search in the manual pages, or more specifically in their short descriptions. Each manual page begins essentially with a one line summary. apropos
returns a list of manual pages whose summary mentions the requested keyword(s). If you choose them well, you will find the name of the command that you need.
Esempio 7.1. Trovare cp
con apropos
$
apropos "copy file"
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
hcopy (1) - copy files from or to an HFS volume
install (1) - copy files and set attributes
Il comando
man
non è l'unico modo di consultare le pagine di manuale; infatti, anche
konqueror
(in KDE) e
yelp
(sotto GNOME) offrono questa possibilità. Esiste anche un'interfaccia web, fornita dal pacchetto
man2html
, che permette di vedere le pagine di manuale in un browser web. Su un computer su cui è installato questo pacchetto, si può usare questo URL:
Questa utilità richiede un server web. Per questo si dovrebbe installare questo pacchetto su uno dei propri server: tutti gli utenti della rete locale potrebbero beneficiare di questo servizio (comprese macchine non Linux) e così non si è obbligati a installare un server HTTP su ogni macchina. Se il proprio server è accessibile anche da altre reti, potrebbe essere opportuno restringere l'accesso a questo servizio solo agli utenti della rete locale.
Il progetto GNU ha scritto manuali per la maggior parte dei suoi programmi in formato info; per questo motivo molte pagine di manuale rimandano alla corrispondente documentazione info. Questo formato offre alcuni vantaggi, ma il programma per visualizzare questi documenti è anche leggermente più complesso.
Si chiama ovviamente info
e prende come argomento il nome del «nodo» da consultare. La documentazione info ha una struttura gerarchica e se si invoca info
senza parametri verrà mostrata una lista dei nodi disponibili al primo livello. Di solito i nodi portano i nomi dei comandi corrispondenti.
I controlli di navigazione nella documentazione non sono particolarmente intuitivi. Il metodo migliore per prendere confidenza col programma probabilmente è invocarlo, premere
h
(per «help», «aiuto») e quindi seguire le istruzioni per imparare con la pratica. In alternativa, si può anche usare un browser grafico, che è molto più amichevole. Anche qui,
konqueror
e
yelp
funzionano; anche
info2www
fornisce un'interfaccia web.
Notare che il sistema info, al contrario del sistema di pagine man
, non permette traduzioni. Perciò i documenti info sono sempre in inglese. Tuttavia, quando si chiede al programma info
di visualizzare una pagina info non esistente, questo ricadrà sulla pagina man con lo stesso nome (se esiste), che potrebbe essere stata tradotta.
7.1.3. Documentazione specifica
Ogni pacchetto include la propria documentazione. Anche i programmi meno documentati in generale hanno un file README
che contiene informazioni interessanti o importanti. Questa documentazione è installata nella directory /usr/share/doc/pacchetto/
(dove pacchetto rappresenta il nome del pacchetto). Se la documentazione è particolarmente grande, potrebbe non essere inclusa nel pacchetto principale del programma, ma piuttosto separata in un pacchetto dedicato che di solito di chiama pacchetto-doc
. Di solito il pacchetto principale raccomanda il pacchetto con la documentazione, dimodoché è facile trovarla.
The /usr/share/doc/package/
directory also contains some files provided by Debian which complete the documentation by specifying the package's particularities or improvements compared to a traditional installation of the software. The README.Debian
file also indicates all of the adaptations that were made to comply with the Debian Policy. The changelog.Debian.gz
file allows the user to follow the modifications made to the package over time: it is very useful to try to understand what has changed between two installed versions that do not have the same behavior. Finally, there is sometimes a NEWS.Debian.gz
file which documents the major changes in the program that may directly concern the administrator.
In most cases, free software programs have websites that are used to distribute it and to bring together the community of its developers and users. These sites are frequently loaded with relevant information in various forms: official documentation, FAQ (Frequently Asked Questions), mailing list archives, etc. Often, problems that you may have have already been the subject of many questions; the FAQ or mailing list archives may have a solution for it. A good mastery of search engines will prove immensely valuable to find relevant pages quickly (by restricting the search to the Internet domain or sub-domain dedicated to the program). If the search returns too many pages or if the results do not match what you seek, you can add the keyword debian
to limit results and target relevant information.
If you do not know the address for the software's website, there are various means of getting it. First, check if there is a
Homepage
field in the package's meta-information (
apt-cache show package
). Alternately, the package description may contain a link to the program's official website. If no URL is indicated, look at
/usr/share/doc/package/copyright
. The Debian maintainer generally indicates in this file where they got the program's source code, and this is likely to be the website that you need to find. If at this stage your search is still unfruitful, consult a free software directory, such as Freecode.com (formerly Freshmeat.net), or search directly with a search engine, such as Google or Yahoo.
You might also want to check the Debian wiki, a collaborative website where anybody, even simple visitors, can make suggestions directly from their browsers. It is used equally by developers who design and specify their projects, and by users who share their knowledge by writing documents collaboratively.
7.1.5. Esercitazioni (HOWTO)
A howto is a document that describes, in concrete terms and step by step, “how to” reach a predefined goal. The covered goals are relatively varied, but often technical in nature: for example, setting up IP Masquerading, configuring software RAID, installing a Samba server, etc. These documents often attempt to cover all of the potential problems likely to occur during the implementation of a given technology.
Molte di queste esercitazioni sono gestite dal Linux Documentation Project (LDP), il cui sito web ospita tutti questi documenti:
These documents should be taken with a grain of salt. They are often several years old; the information they contain is sometimes obsolete. This phenomenon is even more frequent for their translations, since updates are neither systematic nor instant after the publication of a new version of the original documents. This is part of the joys of working in a volunteer environment and without constraints…