Prima di comprendere cosa sta relamente succedendo quando c'è un problema, bisogna conoscere il ruolo teorico giocato da ciascun programma coinvolto nel problema. Per fare questo, per avere la migliore visione si deve consultare la loro documentazione; ma dal momento che queste documentazioni molte e posso essere sparse in lungo e in largo, si dovrebbero conoscere tutti i posti in cui si potrebbero trovare.
Manual pages, while relatively terse in style, contain a great deal of essential information. We will quickly go over the command for viewing them, provided by the
man-db package. 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
FONDAMENTALI La shell, un interprete a riga di comando).
Man pages not only document commands and programs accessible from the command line, but also configuration files, system calls, 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:
- 1
comandi eseguibili dalla riga di comando;
- 2
chiamate di sistema (funzioni fornite dal kernel);
- 3
funzioni di libreria (fornite dalle librerie di sistema);
- 4
dispositivi (sui sistemi Unix-like, questi sono file speciali, di solito posti nella directory /dev/
);
- 5
file di configurazione (formati e convenzioni);
- 6
giochi;
- 7
insiemi di macro e standard;
- 8
comandi di amministrazione del sistema;
- 9
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.
Ovviamente, se non si conoscono i nomi dei comandi, il manuale non sarà molto utile. Per questo scopo c'è il comando apropos
, che aiuta a cercare all'interno delle pagine di manuale, o più precisamente nelle loro descrizioni brevi. Ogni pagina di manuale comincia in pratica con un riassunto di una riga. apropos
, restituisce una lista di pagine di manuale che menzionano le parole chiave richieste. Con una scelta oculata, si può trovare il nome del comando che serve.
Esempio 7.1. Trovare cp
con apropos
$
apropos "copy file"
cp (1) - copy files and directories
cpio (1) - copy files to and from archives
hpcopy (1) - copy files from an HFS+ volume
install (1) - copy files and set attributes
ntfscp (8) - copy file to an NTFS volume.
The
man
command is not the only means of consulting the manual pages, since
khelpcenter
and
konqueror
(by KDE) and
yelp
(under GNOME) programs also offer this possibility. There is also a web interface, provided by the
man2html
package, which allows you to view manual pages in a web browser. On a computer where this package is installed, use this URL after following the instructions in
/usr/share/doc/man2html/README.Debian
:
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.
Last but not least, you can view all manual pages available in Debian (even those that are not installed on your machine) on the
manpages.debian.org
service. It offers each manual page in multiple versions, one for each Debian release.
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 predefinito per visualizzare questi documenti (è chiamato info
) è anche leggermente più complesso. Si farebbe bene ad usare invece pinfo
(dal pacchetto pinfo).
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 riportano i nomi dei comandi corrispondenti.
With
pinfo
navigating between these nodes is easy to achieve with the arrow keys. Alternatively, you could also use a graphical browser, which is a lot more user-friendly. Again,
konqueror
and
yelp
work; the
info2www
package also provides a web interface.
Notare che il sistema info non permette traduzioni, al contrario del sistema di pagine man
. Perciò i documenti info sono quasi sempre in Inglese. Tuttavia, quando si chiede al programma pinfo
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 (see
Sezione 6.7.2, «Gestire i problemi dopo un aggiornamento»).
Nella maggior parte dei casi, i programmi di software libero hanno dei siti web che sono usati per distribuirli e unire la comunità dei loro sviluppatori e utenti. Questi siti sono spesso pieni di informazioni importanti in varie forme: documentazione ufficiale, FAQ (Frequently Asked Questions, domande poste frequentemente), archivi delle mailing list, ecc.I problemi che si possono incontrare sono spesso già stati oggetto di molte domande; le FAQ o gli archivi delle mailing list potrebbero contenere una soluzione. Una buona padronanza dei motori di ricerca risulterà molto preziosa per trovare rapidamente le pagine di interesse (restringendo la ricerca al dominio o sotto-dominio Internet dedicato al programma). Se la ricerca restituisce troppe pagine o se i risultati non sono attinenti a ciò che si cerca, si può aggiungere la parola chiave debian
per limitare i risultati e trovare le informazioni pertinenti.
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 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 FSF's Free Software Directory, or search directly with a search engine, such as Google, DuckDuckGo, Yahoo, etc.
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.
Many such tutorials are managed by the Linux Documentation Project (LDP), whose website hosts all of these documents:
Debian also provides tutorials for its users:
All 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. Further many tutorials nowadays are provided by bloggers, sharing their individual solution with the interested reader. They often lack important information, i.e. the reason why some configuration has been chosen over another, or why some option has been enabled or disabled. Because blogging and creating own websites made it so easy to share, many of these often short tutorials exist, but only a few are actively maintained and well-kept. This can make it hard, to find the "right" one for you. This is all part of the joys of working in a volunteer environment and without constraints…