Vous êtes sur la page 1sur 156

& , &

/ . (#) $ & , / . (#) $ &


/# /# &
/ 8 / 8 !
/. /. !-
/8$ %/% /8$ !0
/8/" # ( & /7 , , 2 /8/" # ( & *
&
! 0
" #$% & " #$% & ' ++ ++ '
#( #( & + $+ /7 , 2,, '!
#) $ #) $ * # . # -
+ + 8 8 &*
.$ + .$ + &
#$ & , #$ & - . ( +( . ( +( &
#$ & , #$ & & ./+ (( & ./+ (( & &
#$ #$ & ./+ (+ & ./+ (+ & &'
. . * ) . ) &'
( + ( + ) ) &-
(( (( ! ) . ) &&
(% (% ' ) ) &0
( +/ & , ( +/ & & ) # ) # 0*
(. (. 0 ) + 9 23 ,, ) + 0
+$1 +$1 ! 6- 6% &' 6- 0
%( /" & 23 ,, %( /" & !
% + % + !'
% $( % $(
%$ + 4 5 .$ 6 % $ + '
%/ " & %/ " & '
+ + '-
#. (( & #. (( & -*
#. (+ & #. (+ & -
-
+ ( + ( -&
( ( -0
$ & /7 , , 2 $ & &*
" " &
/ / &'
/ # & / # & &-
+// +// &&
#& , #&
$ $ !
/# + /# + -
/ / 0
/7 , 2,, '
, , !
,5 ,5 &
,5 ,5 &*
+/ +/ &-
$ + 8& , $ + 8& &-
"( "( &0
"%/ & , "%/ & 0*
"$#( "$#( 0
# + # + 0
#.$ & , #.$ & 0
1 1 *'
$ + $ + *&
$# . $# . *0
//) ( . //) ( *
/ /
)( )( -
& , & &
+ ## & , + ## & 0
+$ + & /7 , 3 +$ + & *

( (
Aussi bien at que batch lisent les commandes à mémoriser
depuis l'entrée standard, ou dans le fichier indiqué par
l'option -f. Le répertoire de travail, l'environnement
(sauf pour les variables TERM, DISPLAY et _) ainsi que le
umask sont mémorisés au moment de l'invocation. Une com-
NOM mande at - ou batch - invoquée depuis un shell obtenu par
at, batch, atq, atrm - Mémoriser, examiner ou supprimer su(1) mémorisera l'U-ID en cours. L'apppelant recevra par
des jobs à exécuter ultérieurement. courrier (mail) les messages écrits sur les flux de sortie
standard et d'erreur standard, s'il y en a. Le courrier
SYNOPSIS sera envoyé en utilisant la commande /bin/mail. Si at est
at [-V] [-q fichier] [-f fichier] [-mldbv] HEURE invoquée depuis un shell obtenu par su(1), le courier sera
at -c commande [commande...] envoyé à l'utilisateur courrespondant au login.
atq [-V] [-q fichier] [-v]
atrm [-V] commande [commande...] Le Super-Utilisateur peut toujours employer ces commandes.
batch [-V] [-q fichier] [-f fichier] [-mv] [HEURE] Pour les autres utilisateurs, les permissions sont déter-
minées par les fichiers /etc/at.allow et /etc/at.deny.
DESCRIPTION
at et batch lisent, depuis l'entrée standard, ou depuis un Si le fichier /etc/at.allow existe, seuls les utilisateurs
fichier, des commandes qu'ils exécuteront ultérieurement, dont les noms sont mentionnés dans ce fichier peuvent
en utilisant /bin/sh. utiliser at.
at lance les commandes indiquées à une heure précise. Si /etc/at.allow n'existe pas, at vérifie si /etc/at.deny
existe, et tous les utilisateurs non-mentionnés dans ce
atq affiche la liste des commandes en attente fichier ont le droit d'invoquer at.
d'exécution, sauf si l'appelant est le Super-Util-
isateur. Dans ce dernier cas, atq affiche la liste Si aucun de ces deux fichiers n'existe, seul le Super-
des travaux en attente pour tous les utilisateurs. utilisateur a le droit d'appeler at.
atrm efface les travaux en attente. Un fichier /etc/at.deny vide signifie que tous les util-
isateurs ont le droit d'appeler ces commandes, c'est la
batch exécute les commandes indiquées lorsque la charge configuration par défaut.
système le permet, c'est à dire lorsque la charge
du processeur, obtenue depuis le fichier OPTIONS
/proc/loadavg descend en dessous de 1,5 par -V Afficher un numéro de version sur la sortie
défaut, ou en dessous d'une valeur mentionnée d'erreur standard.
explicitement durant l'invocation de atrun.
-q file Utiliser la file d'attente mentionnée. Une file
At permet d'indiquer l'heure de lancement de manière assez est designée par une simple lettre, dans l'inter-
complexe. valle a jusqu'à z, et A jusqu'à Z. La file c est
la file d'attente par défaut pour at tandis que la
Il accepte des spécifications de la forme HHMM ou HH:MM file E est celle par défaut pour batch. Plus les
pour exécuter un travail à une heure donnée de la journée files ont une lettre importante, plus les travaux
en cours (ou du lendemain si l'heure mentionnée est déjà seront exécutés avec une valeur de gentillesse
dépassée). On peut aussi lui fournir l'un des arguments (voir nice(1)) élevée. Si un travail est enreg-
suivants : midnight (minuit), noon (midi), ou teatime istré dans une file avec une lettre majuscule, il
(l'heure du thé, soit 16 heures). Il est également possi- sera transmis à batch à l'heure indiquée. Si l'on
ble de fournir un suffixe du type AM (matin), ou PM invoque atq avec un nom de file spécifique, il ne
(après-midi) avec une heure sur un cadran de 12 heures. montrera que les travaux en attente dans cette
On peut indiquer le jour de lancement, en précisant une file.
date du type nom-du-mois (en anglais) jour et éventuelle-
ment année, ou encore une date du type MMJJAA ou MM/JJ/AA -m Envoyer un courier à l'utilisateur lorsque le tra-
ou JJ.MM.AA. (NDT : C'est sympa de penser aux gens qui vail est terminé, même s'il n'a rien écrit sur ses
notent le jour avant le mois :-) flux de sortie.
On peut indiquer une heure de la forme now(maintenant) + -f fichier
nombre d'unités, où les unités peuvent être minutes, Lire la commande à exécuter dans le fichier et non
hours, days (jours), ou weeks (semaines) et on peut égale- pas sur l'entrée standard.
ment demander à at de déclencher le travail le jour même
en ajoutant le suffixe today ou le lendemain en ajoutant -l Est un alias pour atq.
tomorrow.
-d Est un alias pour atrm.
Par exemple, pour lancer une commande à 16 heures, 3 jours
plus tard, on peut indiquer at 4pm + 3 days, pour lancer -b Est un alias pour batch.
le travail à 10 heures du matin le 31 Juillet, il faut
invoquer at 10am Jul 31 et pour lancer une commande à 1 -v Pour atq, afficher les travaux terminés mais pas
heure du matin le lendemain, effectuez at 1am tomorrow. encore effacés de la file. Pour les autres,
afficher les heures de lancement programmées.
!
et le codage d'Huffman. La compression est généralement
-c Imprimer sur la sortie standard les travaux men- nettement meilleure que celle atteinte par des com-
tionnés sur la ligne de commande. presseurs conventionnels basés sur LZ77/LZ78, et approche
les performances de la famille des compresseurs statis-
FICHIERS tiques PPM.
/var/spool/at
/var/spool/at/spool Les options de ligne de commandes sont délibérément très
/proc/loadavg similaires à celle de GNU gzip, mais elles ne sont pas
/etc/utmp identiques.
/etc/at.allow
/etc/at.deny bzip2 attend une liste de noms de fichiers pour accompag-
ner les options de ligne de commandes. Chaque fichier est
VOIR AUSSI remplacé par une version compressée de lui-même, avec le
cron(1), nice(1), sh(1), umask(2), atrun(8) nom "nom_original.bz2". Un fichier compressé a les mêmes
date de modification, les mêmes permissions, et, quand
BOGUES c'est possible, les mêmes propriétés que celles du fichier
Sous Linux, batch est tributaire d'un système de fichiers original, de sorte que ces caractéristiques peuvent cor-
de type proc monté sur le répertoire /proc. rectement être restaurées au moment de la décompression.
Le traitement du nom du fichier est naïf dans le sens
Si le fichier /etc/utmp n'est pas disponible, ou est qu'il n'y a pas de mécanisme pour préserver les noms, per-
endommagé, ou si l'utilisateur n'est pas connecté lorsque missions, propriétés et les dates des fichiers situés dans
at est invoquée, le courrier est envoyé a l'U-ID corre- des systèmes de fichiers où ces concepts manquent, ou qui
spondant à la variable d'environnement LOGNAME. Si celle- ont des restrictions strictes en ce qui concerne la
ci est indéfinie ou vide, l'U-ID courant est utilisé par longueur des noms de fichiers, comme MS-DOS.
défaut.
bzip2 et bunzip2, par défaut, n'écraseront pas les
At et batch, tels qu'ils sont implementés actuellement, ne fichiers existants. Si vous voulez le contraire, utilisez
sont pas fiables lorsqu'il y a une situation de manque de l'option -f.
ressources systèmes. Si c'est régulièrement le cas sur
votre site, vous devriez vous orienter vers un autre Si aucun nom de fichier n'est indiqué, bzip2 compresse de
système de lancements différes, comme nqs. l'entrée standard vers la sortie standard. Dans ce cas,
bzip2 n'écrira pas la sortie sur un terminal, puisque cela
AUTEURS serait incompréhensible et donc inutile.
At a été écrit principalement par Thomas Koenig,
ig25@rz.uni-karlsruhe.de. Les routines d'analyse des bunzip2 (ou bzip2 -d) décompresse tous les fichiers
dates et heures sont de David Parsons, orc@pell.chi.il.us. précisés. Les fichiers qui n'ont pas été créés par bzip2
sont détectés et ignorés, et un avertissement est émis.
bzip2 tente de deviner le nom du fichier décompressé à
TRADUCTION partir de celui du fichier compressé de la manière suiv-
Christophe Blaess, 1997. ante :

nom_fichier.bz2 devient nom_du_fichier


Linux 16 Avril 1997 AT(1) nom_fichier.bz devient nom_du_fichier
nom_fichier.tbz2 devient nom_du_fichier.tar
nom_fichier.tbz devient nom_du_fichier.tar
unautrenom devient unautrenom.out

Si le fichier ne se termine pas par l'un des suffixes


reconnus, à savoir .bz2, .bz, .tbz2 et .tbz, bzip2 se
NOM plaindra de ne pas pouvoir deviner le nom du fichier orig-
bzip2, bunzip2 - Compression de fichiers par tri de blocs, inal, et utilisera le nom du fichier auquel il ajoutera
v0.9.5. .out à la fin.
bzcat - Décompresser les fichiers sur stdout.
bzip2recover - Récupérer des données de fichiers bzip2 Comme pour la compression, ne pas fournir de nom de
endommagés. fichier provoque la décompression de l'entrée standard
vers la sortie standard.
SYNOPSIS bunzip2 décompressera correctement un fichier qui est la
bzip2 [ -cdfkqstvzVL123456789 ] [ noms_fichiers ... ] concaténation de deux fichiers compressés ou plus. Le
bunzip2 [ -fkvsVL ] [ noms_fichiers ... ] résultat est la concaténation de fichiers non compressés
bzcat [ -s ] [ noms_fichiers ... ] correspondants. Le test d'intégrité (-t) des fichiers
bzip2recover nom_fichier compressés concaténés est également supporté.

Vous pouvez aussi compresser ou décompresser des fichiers


DESCRIPTION sur la sortie standard en fournissant l'option -c. De
bzip2 compresse les fichiers en utilisant l'algorithme de multiples fichiers peuvent être compressés et décompressés
compression de texte par tri de blocs de Burrows-Wheeler, de cette façon. Les sorties résultantes sont envoyées
'
séquentiellement sur stdout. La compression de multiples -t --test
fichiers d'une telle façon génère un flux contenant de Tester l'intégrité des fichiers spécifiés, mais ne
multiples représentations de fichiers compressés. Un tel pas les décompresser. Ceci effectue en fait une
flux ne peut être décompressé correctement que par bzip2 décompression de test, et ne s'occupe pas du résul-
version 0.9.0 ou ultérieure. Les versions antérieures de tat décompressé.
bzip2 s'arrêteront après la décompression du premier
fichier du flux. -f --force
Force l'écrasement des fichiers en sortie. Nor-
bzcat (ou bzip2 -dc) décompressent tous les fichiers malement, bzip2 n'écrasera pas les fichiers de sor-
spécifiés sur la sortie standard. tie préexistants. Force également bzip2 à briser
les liens durs (hard links) de fichiers, ce qu'il
bzip2 lira les arguments dans les variables d'environ- ne ferait pas autrement.
nement BZIP2 et de BZIP, dans cet ordre, et les traitera
avant tout argument lu à partir de la ligne de commandes. -k --keep
Ceci donne une façon pratique de fournir des arguments par Garder (ne pas effacer) les fichiers d'entrée
défaut. durant la compression ou la décompression.

La compression est toujours effectuée, même si le fichier -s --small


compressé est légèrement plus volumineux que le fichier Réduire l'utilisation de la mémoire pour la com-
original. Les fichiers de moins de 100 octets ont ten- pression, la décompression et la vérification. Les
dance à s'agrandir, car le mécanisme de compression com- fichiers sont décompressés et testés en utilisant
porte toujours un surplus constant d'à peu près 50 octets. un algorithme modifié qui requiert uniquement 2.5
Les données aléatoires (incluant la sortie de la plupart octets par bloc d'un octet. Cela signifie que tout
des compresseurs de fichiers) sont codées avec à peu près fichier peut être décompressé dans 2300Ko de
8.05 bits par octets, ce qui donne une expansion d'environ mémoire, même s'il le sera à une vitesse deux fois
0.5%. lente que la vitesse normale.

En tant que vérification interne, bzip2 utilise des CRC Durant la compression, -s sélectionne une taille de
32bits pour s'assurer que la version décompressée d'un bloc de 200Ko, ce qui limite l'utilisation de
fichier est identique au fichier original. Ceci permet mémoire d'a peu près le même nombre, aux dépens du
une protection contre la corruption des données com- coefficient de compression. Bref, si votre machine
pressées, et contre des bogues non détectés de bzip2 possède peu de mémoire vive (8 Mo ou moins),
(heureusement très improbables). La probabilité qu'une utilisez -s pour tout ce que vous faites. Voir
corruption de données passe inaperçue est infime, environ GESTION DE LA MEMOIRE plus bas.
une chance sur 4 milliards pour chaque fichier compressé.
Soyez conscients, toutefois, que la vérification se pro- -q --quiet
duit pendant la décompression, et qu'elle ne peut donc Supprime les messages d'avertissement non essen-
vous informer que lorsque quelque chose s'est mal passé. tiels. Les messages se rattachant aux erreurs
Cela ne peut pas vous permettre de récupérer les données d'E/S et à d'autres événements critiques ne sont
non compressées originales. Vous pouvez utiliser pas supprimés.
bzip2recover pour essayer de récupérer des données de
fichiers endommagés. -v --verbose
Mode volubile -- montre le coefficient de compres-
Valeurs de retour : 0 pour une sortie normale, 1 pour des sion pour chaque fichier traité. Des -v supplémen-
problèmes d'environnement (fichier non trouvé, options taires augmentent le niveau de volubilité, en
invalides, erreurs d'entrée/sortie, etc.), 2 pour indiquer affichant des tas d'informations qui sont princi-
un fichier compressé corrompu, 3 pour une erreur de con- palement utiles à des fins de diagnostic.
sistance interne (un bogue, p.ex.) qui a fait paniquer
bzip2. -L --license -V --version
Afficher la version du logiciel, les termes et con-
ditions d'utilisation.
OPTIONS
-c --stdout -1 to -9
Compresser ou décompresser sur la sortie standard. Fixe la taille de bloc à 100, 200, ... 900 k pen-
dant la compression. Cette option n'a aucun effet
-d --decompress sur la décompression. Voir GESTION DE LA MEMOIRE
Forcer la décompression. bzip2, bunzip2 et bzcat ci-dessous.
constituent en fait le même programme, et la
décision quant aux actions à entreprendre est -- Traiter tous les arguments ultérieurs en tant que
déterminée sur la base du nom du fichier utilisé. noms de fichiers, même s'ils débutent par un tiret.
Cette option annule ce mécanisme, et force bzip2 à Ainsi, vous pouvez traiter des fichiers dont les
décompresser. noms commencent par un tiret, par exemple : bzip2
-- -monfichier.
-z --compress
Le complément de -d : force la compression, quel --repetitive-fast --repetitive-best
que soit le nom d'invocation. Ces options sont redondantes dans les versions
0.9.5 et ultérieures. Elles fournissent un
- &
contrôle assez grossier sur le comportement de Voici une table qui résume l'utilisation maximale de la
l'algorithme de tri dans les versions antérieures, mémoire pour différentes tailles de blocs, ainsi que la
ce qui était parfois utile. Les versions 0.9.5 et taille compressée totale de 14 fichiers du Calgary Text
ultérieures disposent d'un algorithme amélioré qui Compression Corpus totalisant 3141622 octets. Cette table
rend l'usage de ces options inutile. donne un certain aperçu sur l'évolution de la compression
avec la taille de bloc. Ces chiffres tendent à minimiser
l'avantage des tailles de blocs plus importantes pour les
GESTION DE LA MEMOIRE fichiers plus imposants, car le Corpus est dominé par des
bzip2 compresse des fichiers importants par blocs. La petits fichiers.
taille de bloc affecte à la fois le coefficient de com-
pression atteint, et le montant de mémoire nécessaire pour Usage Usage Usage Taille
la compression et la décompression. Les options -1 à -9 du
précisent la taille de bloc utilisée, de 100000 octets à Option compr. décompr. décompr. -s Corpus
900000 octets (par défaut) respectivement. Au moment de
la décompression, la taille de bloc utilisée pour la com- -1 1200 k 500 k 350 k 914704
pression est lue à partir de l'entête du fichier com- -2 2000 k 900 k 600 k 877703
pressé, et bunzip2 s'alloue ensuite juste assez de mémoire -3 2800 k 1300 k 850 k 860338
pour décompresser ce fichier. Puisque les tailles de -4 3600 k 1700 k 1100 k 846899
blocs sont conservées dans les fichiers compressés, il -5 4400 k 2100 k 1350 k 845160
s'ensuit que les options -1 à -9 ne sont pas pertinentes, -6 5200 k 2500 k 1600 k 838626
et qu'elles sont donc ignorées durant la décompression. -7 6100 k 2900 k 1850 k 834096
-8 6800 k 3300 k 2100 k 828642
Les exigences mémoire de la compression et de la décom- -9 7600 k 3700 k 2350 k 828642
pression, en octets, peuvent être estimées à :

Compression : 400Ko + ( 8 x taille de bloc ) RECUPERATION DE DONNEES DE FICHIERS ENDOMMAGES


bzip2 compresse les fichiers en blocs d'une longueur
Décompression : 100Ko + ( 4 x taille de bloc ), ou d'habituellemnt 900 Ko. Chaque bloc est traité indépen-
100Ko + ( 2.5 x taille de bloc ) damment des autres. Si un défaut du support physique ou
une erreur de transmission provoque l'endommagement d'un
Des largeurs de blocs plus importantes voient les fichier multi-blocs, il peut être possible de récupérer
bénéfices marginaux retirés diminuer rapidement. La plu- des données à partir des blocs non endommagés du fichier.
part de la compression provient des deux ou trois cents
premiers ko de taille de bloc, un fait à retenir quand on La représentation compressée de chaque bloc est délimitée
utilise bzip2 sur de petites machines. Il est également par un motif de 48 bits, ce qui permet de trouver les lim-
important de savoir que les exigences mémoire de la décom- ites des blocs avec une probabilité raisonnable. Chaque
pression sont fixées au moment de la compression par le bloc comporte également son propre CRC 32 bits, de sorte
choix d'une taille de bloc. que les blocs corrompus peuvent être distingués des
autres.
Pour les fichiers compressés avec la taille de bloc par
défaut de 900Ko, bunzip2 aura besoin d'environ 3700 Ko bzip2recover est un simple programme dont le but est de
pour la décompression. Pour permettre la décompression de rechercher les blocs dans les fichiers .bz2, et d'écrire
tout fichier sur une machine avec 4 Mo de RAM, bunzip2 chaque bloc détecté dans son propre fichier .bz2. Vous
possède une option pour décompresser en n'utilisant que la pouvez alors utiliser bzip2 -t pour tester l'intégrité des
moitié environ de ces 3700 Ko, à savoir à peu près 2300 fichiers résultants, et décompresser ceux qui ne sont pas
Ko. Malheureusement, la vitesse de décompression est endommagés.
également réduite de moitié, et donc vous ne devriez
utiliser cette option (-s) qu'en cas de nécessité absolue. bzip2recover prend un seul argument, le nom du fichier
endommagé, et écrit un certain nombre de fichiers
En général, essayez d'utiliser la taille de bloc mémoire "rec0001file.bz2", "rec0002file.bz2", etc, contenant les
la plus grande permise, puisque cela maximise la qualité blocs extraits. Les noms de fichiers en sortie sont
de la compression atteinte. Les vitesses de compression conçus de sorte que l'utilisation de jokers (wildcards)
et de décompression ne sont en fait pas affectées par la dans des traitements ultérieurs -- par exemple, "bzip2 -dc
taille de bloc. rec*file.bz2 > données_récupérées" -- liste les fichiers
dans le bon ordre.
Un autres aspect significatif s'applique aux fichiers qui
peuvent tenir dans un seul bloc -- ç.à.d. la plupart des bzip2recover devrait être utilisé principalement pour
fichiers que vous rencontrez en utilisant une grande traiter les grands fichiers .bz2, puisque ceux-ci contien-
taille de bloc. Le montant réel de mémoire utilisée est nent de nombreux blocs. Il est clairement inutile
proportionnel à la taille du fichier, puisque le fichier d'essayer de l'utiliser sur des fichiers endommagés d'un
est plus petit qu'un bloc. Par exemple, compresser un seul bloc, car un seul bloc endommagé ne peut être
fichier de 20000 octets avec l'option -9 forcera le com- récupéré. Si vous voulez minimiser toute perte poten-
presseur à allouer environ 7600 Ko de mémoire, mais n'en tielle de données à cause d'erreurs de transmission, vous
utilisera réellement que 400 Ko + 20000 * 8 = 560 Ko. De devriez envisager d'utiliser une taille de bloc plus
même, le décompresseur allouera 3700 Ko mais n'utilisera restreinte.
que 100 Ko + 20000 * 4 = 180 Ko.

0 *
PERFORMANCES vers les sources de documentation. Christian von Roques
La phase de tri de la compression réunit les chaînes de m'encouragea à chercher des algorithmes de tri plus rapi-
caractères similaires présentes dans le fichier. A cause des, pour accélérer la compression. Bela Lubkin m'encour-
de cela, les fichiers contenant de très longues suites de agea à améliorer la performance de la compression dans le
symboles répétés, comme "aabaabaabaab ..." (répétés pire des cas. Beaucoup de personnes m'ont envoyé des
plusieurs centaines de fois) peuvent être compressés plus patchs, aidé pour des problèmes de portabilité, prêté des
lentement que d'habitude. Les versions 0.9.5 et machines, donné des conseils et ont été généralement
ultérieures se conduisent nettement mieux que les versions utiles.
précédentes de ce point de vue. Le rapport entre le temps
de compression dans le pire des cas et dans le cas moyen
est de l'ordre de 10 pour 1. Pour les versions TRADUCTION
antérieures, ce rapport était de 100 pour 1. Vous pouvez Frédéric Delanoy, 2000.
utiliser l'option -vvvv pour voir la progression dans les
détails, si vous le souhaitez.

La vitesse de décompression n'est pas affectée par ces Linux 9 Août 2000 BZIP2(1)
phénomènes.

bzip2 alloue d'habitude plusieurs Mo de mémoire pour ses


besoins, et ensuite charge le tout d'une manière assez
aléatoire. Cela signifie que les performances, à la fois
pour la compression et la décompression, sont largement
déterminées par la vitesse à laquelle votre machine peut
traiter les défauts de cache. A cause de cela, de petites
modifications du code pour réduire le taux d'échec en NOM
cache ont donné des améliorations de performances dispro- cal - Afficher un calendrier.
portionnées. Je suppose que bzip2 se conduira le mieux
sur des machines avec de très larges caches. SYNOPSIS
cal [-jy] [[mois] [annee]]

INCONVÉNIENTS DESCRIPTION
Les messages d'erreurs d'E/S ne sont pas d'une grande Cal affiche un calendrier. Si les arguments sont omis, le
utilité. bzip2 essaie vraiment de détecter les erreurs mois courant est affiché. Les options sont les suivantes:
d'E/S et de s'arrêter proprement, mais les détails du
problème rencontré peuvent parfois induire en erreur.
-j Affiche les numéros des jours dans l'année (le
Cette page de manuel se rattache à la version 0.9.5 de numéro 1 correspond au 1er Janvier).
bzip2. Les données compressées créées par cette version
sont entièrement compatibles de façon descendante et -y Affiche le calendrier de l'année courante.
ascendante avec les versions antérieures 0.1pl2 et 0.9.0,
à l'exception près que les versions 0.9.0 et ultérieures Un paramètre unique indique l'année (1 - 9999) à afficher;
peuvent correctement décompresser de multiples fichiers noter que l'année doit être complètement spécifiée : ``cal
compressés et concaténés. La version 0.1pl2 ne sait pas 89'' n'affiche pas le calendrier de 1989. Deux paramètres
le faire; elle s'arrêtera après la décompression du pre- indiquent le mois (1 - 12) et l'année. S'il n'y a pas de
mier fichier du flux. paramètres, le calendrier du mois courant est affiché.

bzip2recover utilise des entiers 32 bits pour représenter L'année commence le 1er Janvier.
les positions des bits dans les fichiers compressés ; de
ce fait, il ne peut traiter de fichiers compressés de plus On considère généralement que le passage au calendrier
de 512 Mo de long. Ceci pourrait être résolu facilement. grégorien est survenu le 3 Septembre 1752. A cette
époque, la plupart des pays avaient reconnu ce calendrier
(mais quelques uns ne le reconnurent qu'au début du 20ème
AUTEUR siècle). Les dix jours suivant cette date furent
Julian Seward, jseward@acm.org. éliminés, et donc le calendrier de ce mois est un peu par-
ticulier.
http://www.muraroa.demon.co.uk
HISTORIQUE
Les idées intégrées à bzip2 sont dues (entre autres) aux La commande cal est apparue dans la version 6 de AT&T
personnes suivantes : Michael Burrows et David Wheeler UNIX.
(pour la transformation de tri de blocs), David Wheeler (à
nouveau, pour le codeur Huffman), Peter Fenwick (pour le
modèle de codage structuré du bzip, original et pour de TRADUCTION
nombreux raffinements), et Alistair Moffat, Radford Neal Michel Quercia, 1997.
et Ian Witten (pour le codeur arithmétique du bzip origi-
nal). Je suis très reconnaissant à ces personnes pour
leur aide, leur support et lerus conseils. Voyez le
manuel dans la distribution source pour obtenir des liens BSD Expérimental 20 Mai 1997 CAL(1)
TRADUCTION
Christophe Blaess, 1997.

FSF 9 Janvier 1997 CAT(1)


BASH_BUILTINS(1) BASH_BUILTINS(1)
NOM
cat - Concaténer des fichiers et les afficher sur la sor-
tie standard. NAME
bash, :, ., [, alias, bg, bind, break, builtin, case, cd,
SYNOPSIS command, compgen, complete, continue, declare, dirs, dis-
cat [-benstuvAET] [--number] [--number-nonblank] own, echo, enable, eval, exec, exit, export, fc, fg, for,
[--squeeze-blank] [--show-nonprinting] [--show-ends] getopts, hash, help, history, if, jobs, kill, let, local,
[--show-tabs] [--show-all] [--help] [--version] logout, popd, printf, pushd, pwd, read, readonly, return,
[fichier...] set, shift, shopt, source, suspend, test, times, trap,
type, typeset, ulimit, umask, unalias, unset, until, wait,
DESCRIPTION while - bash built-in commands, see bash(1)
Cette page de manuel documente la version GNU de cat.
BASH BUILTIN COMMANDS
cat affiche sur la sortie standard le contenu de chacun SEE ALSO
des fichiers indiqués (ou le contenu de l'entrée standard bash(1), sh(1)
si aucun nom de fichier n'est fourni, ou si le nom `-' est
indiqué).

OPTIONS GNU Bash-2.05a 2001 October 29 BASH_BUILTINS(1)


-b, --number-nonblank
Numéroter en sortie les lignes non blanches, en
commençant à 1.

-e Equivalent à -vE.

-n, --number
Numéroter les lignes en sortie, en commençant à 1.
NOM
-s, --squeeze-blank chgrp - Changer le groupe propriétaire d'un fichier.
Remplacer les lignes blanches consécutives par une
seule ligne blanche. SYNOPSIS
chgrp [options] groupe fichier...
-t Equivalent à -vT.
Options POSIX : [-R] [--]
-u Sans effet - pour compatibilité Unix seulement.
Options du draft d'Austin : [-hHLPR]
-v, --show-nonprinting
Afficher les caractères de contrôles, sauf les Description GNU de groupe : [--reference=rfile]
sauts de ligne et les tabulations en utilisant la
notation `^', et préfixer avec `M-' les caractères Options GNU (forme courte) : [-cfvR] [--help] [--version]
ayant leur huitième bit positionné. [--]

-A, --show-all DESCRIPTION


Equivalent à -vET. chgrp change l'appartenance de chacun des fichiers
indiqués pour qu'ils deviennent propriétés du groupe
-E, --show-ends indiqué.
Afficher un `$' à la fin de chaque ligne.
Le groupe peut être mentionné par son nom ou par un GID
-T, --show-tabs numérique.
Afficher le caractère TAB ainsi : `^I'.
OPTIONS POSIX
--help Afficher un message d'aide sur la sortie standard -R Modifier récursivement l'appartenance des réper-
et terminer normalement. toires et de leurs contenus. Continuer la descente
même si des erreurs surviennent.
--version
Afficher un numéro de version sur la sortie stan- -- Terminer la liste des options.
dard et terminer normalement.
OPTIONS DU DRAFT D'AUSTIN
-h Si un fichier est un lien symbolique, changer le

!
groupe du lien lui-même et pas celui de l'objet
vers lequel il pointe. Si le système ne supporte ENVIRONNEMENT
pas les groupes pour les liens symboliques, ne rien LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa-
faire. tions habituelles. Sur un système conforme XSI, NLSPATH a
la signification normale.
-H (half-logical)
(Quand elle est fournie conjointement avec -R.) Si CONFORMITÉ
un fichier est un lien symbolique vers un réper- POSIX 1003.2 ne documente que l'option -R. Toutes les
toire, changer le groupe du répertoire et des autres options peuvent ne pas être portables.
fichiers de la hiérarchie en dessous.
NOTES
-L (logique) Cette page décrit la version de chgrp trouvée dans le
(Quand elle est fournie conjointement avec -R.) Si paquetage fileutils-4.0, d'autres versions peuvent
un fichier rencontré sur la ligne de commande ou différer légèrement.
durant la traversée de l'arborescence est un lien
symbolique vers un répertoire, changer le groupe du TRADUCTION
répertoire et des fichiers de la hiérarchie en Christophe Blaess, 1997.
dessous.

-P (physique)
(Quand elle est fournie conjointement avec -R.) Si FSF 30 Août 2000 CHGRP(1)
un fichier erencontré sur la ligne de commande ou
durant la traversée de l'arborescence est un lien
symbolique, changer le groupe du lien lui-même et
pas celui de l'objet vers lequel il pointe. Si le ! " ! "
système ne supporte pas les groupes pour les liens
symboliques, ne rien faire. C'est le comportement
par défaut.

-R Changer récursivement le groupe des répertoires et NAME


de leurs contenus. chkconfig - updates and queries runlevel information for
system services
DESCRIPTION GNU DE GROUPE
Une extension GNU (nouvelle dans les fileutils 4.0) permet
d'utiliser --reference=rfile comme une description de SYNOPSIS
groupe : on considèrera le groupe auquel appartient le chkconfig --list [name]
fichier rfile. chkconfig --add name
chkconfig --del name
OPTIONS GNU chkconfig [--level levels] name <on|off|reset>
-c, --changes chkconfig [--level levels] name
Décrire seulement les fichiers dont l'appartenance
change effectivement.
DESCRIPTION
-f, --silent, --quiet chkconfig provides a simple command-line tool for main-
Ne pas afficher de message d'erreur concernant les taining the /etc/rc[0-6].d directory hierarchy by reliev-
fichiers dont le groupe ne peut pas être modifié. ing system administrators of the task of directly manipu-
lating the numerous symbolic links in those directories.
-h, --no-dereference
Agir sur un lien symbolique lui-même plutôt que sur This implementation of chkconfig was inspired by the chk-
l'objet vers lequel il pointe. Disponible unique- config command present in the IRIX operating system.
ment si l'appel-système lchown est fourni. Rather than maintaining configuration information outside
of the /etc/rc[0-6].d hierarchy, however, this version
-v, --verbose directly manages the symlinks in /etc/rc[0-6].d. This
Décrire les modifications d'appartenance. leaves all of the configuration information regarding what
services init starts in a single location.
-R, --recursive
Modifier récursivement l'appartenance des réper- chkconfig has five distinct functions: adding new services
toires et de leurs contenus. Continuer la descente for management, removing services from management, listing
même si des erreurs surviennent. the current startup information for services, changing the
startup information for services, and checking the startup
OPTIONS STANDARDS GNU state of a particular service.
--help Afficher un message d'aide sur la sortie standard,
puis terminer correctement. When chkconfig is run without any options, it displays
usage information. If only a service name is given, it
--version checks to see if the service is configured to be started
Afficher le numéro de version sur la sortie stan- in the current runlevel. If it is, chkconfig returns true;
dard, puis terminer correctement. otherwise it returns false. The --level option may be used

'
to have chkconfig query an alternative runlevel rather # description: Saves and restores system entropy pool for \
than the current one. # higher quality random number generation.
This says that the random script should be started in lev-
If one of on, off, or reset is specified after the service els 2, 3, 4, and 5, that its start priority should be 20,
name, chkconfig changes the startup information for the and that its stop priority should be 80. You should be
specified service. The on and off flags cause the service able to figure out what the description says; the \ causes
to be started or stopped, respectively, in the runlevels the line to be continued. The extra space in front of the
being changed. The reset flag resets the startup informa- line is ignored.
tion for the service to whatever is specified in the init
script in question.
SEE ALSO
By default, the on and off options affect only runlevels init(8) ntsysv(8) serviceconf(8)
3, 4, and 5, while reset affects all of the runlevels.
The --level option may be used to specify which runlevels
are affected. AUTHOR
Erik Troan <ewt@redhat.com>
Note that for every service, each runlevel has either a
start script or a stop script. When switching runlevels,
init will not re-start an already-started service, and
will not re-stop a service that is not running. Wed Oct 8 1997 CHKCONFIG(8)

OPTIONS
--level levels # #
Specifies the run levels an operation should per-
tain to. It is given as a string of numbers from 0
to 7. For example, --level 35 specifies runlevels 3
and 5.
NOM
chmod - Modifier les autorisations d'accès à un fichier.
--add name
SYNOPSIS
This option adds a new service for management by chmod [options] mode fichier...
chkconfig. When a new service is added, chkconfig
ensures that the service has either a start or a Options POSIX : [-R]
kill entry in every runlevel. If any runlevel is
missing such an entry, chkconfig creates the appro- Options GNU (forme courte): [-cfvR] [--help] [--version]
priate entry as specified by the default values in [--]
the init script.
DESCRIPTION
chmod modifie les permissions d'accès de chacun des
--del name fichiers indiqués, en suivant l'indication de mode, qui
The service is removed from chkconfig management, peut être une représentation symbolique du changement à
and any symbolic links in /etc/rc[0-6].d which per- effectuer, ou un nombre octal représentant le motif
tain to it are removed. binaire des nouvelles autorisations.

Le format symbolique des changements de mode est


--list name `[ugoa...][[+-=][rwxXstugo...]...][,...]'.
This option lists all of the services which chkcon-
fig knows about, and whether they are stopped or Plusieurs opérations symboliques peuvent être séparées par
started in each runlevel. If name is specified, des virgules.
information in only display about service name.
Une combinaison des lettres `ugoa' contrôle la catégorie
d'accès à modifier. Il peut s'agir de l'utilisateur
RUNLEVEL FILES possédant le fichier (u), des autres utilisateurs du même
Each service which should be manageable by chkconfig needs groupe que le fichier (g), des utilisateurs n'appartenant
two or more commented lines added to its init.d script. pas au groupe du fichier (o), ou de tous les utilisateurs
The first line tells chkconfig what runlevels the service (a). Si aucune catégorie n'est indiquée, l'ensemble (a)
should be started in by default, as well as the start and est pris par défaut, mais les bits correspondant à des
stop priority levels. If the service should not, by bits à 1 du umask ne sont pas affectés.
default, be started in any runlevels, a - should be used
in place of the runlevels list. The second line contains L'opérateur `+' autorise un accès, l'opérateur `-' inter-
a description for the service, and may be extended across dit un accès, et l'opérateur `=' autorise exclusivement
multiple lines with backslash continuation. l'accès indiqué.

For example, random.init has these three lines:


# chkconfig: 2345 20 80 Les lettres `rwxXstugo' sélectionne le type d'autorisation

- &
concernée : Ne pas afficher de messages d'erreurs concernant
les fichiers dont les autorisations n'ont pas pu
r lecture, être modifiées.

w écriture, -v, --verbose


Décrire les modifications apportées.
x exécution (ou parcours pour les répertoires),
-R, --recursive
X exécution, uniquement si le fichier est un réper- Modifier récursivement les autorisations des réper-
toire, ou s'il a déjà une autorisation d'exécution toires et de leurs contenus.
pour une des catégories d'utilisateur (s'il s'agit
donc bien d'un fichier exécutable), --help Afficher un message d'aide, et terminer normale-
ment.
s utiliser l'ID du propriétaire ou du groupe pro-
priétaire du fichier lors de l'exécution, --version
Afficher le numéro de version et terminer normale-
t (sticky-bit) conserver le code du programme sur le ment.
péripherique de swap après exécution. Non documenté
par POSIX, il s'agit du comportement original, mais ENVIRONNEMENT
de nos jours il sert uniquement pour les réper- LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa-
toires. Il indique que seuls le propriétaire du tions habituelles.
répertoire, et le propriétaire d'un fichier qui s'y
trouve ont le droit de supprimer ce fichier. C'est CONFORMITÉ
typiquement utilisé pour les répertoires comme /tmp POSIX 1003.2 ne documente que l'option -R. Toutes les
ayant une autorisation d'écriture générale. autres options peuvent ne pas être portables.

u les permissions dont dispose actuellement le pro- POSIX ne décrit pas l'utilisation du bit `t' (sticky). Le
priétaire du fichier, standard ne précise pas non plus si chmod doit préserver
la cohérence en effaçant ou en refusant de positionner les
g les permissions dont disposent actuellement les bits Set-UID ou Set-GID si tous les bits d'exécution sont
autres membres du groupe propriétaire du fichier, effacés.

o les permissions dont disposent tous les autres Nous avons décrit plus haut le comportement du bit `t' sur
utilisateurs. les répertoires. Chaque système attache une signification
personnel à ce bit. En particulier Linux adopte le com-
Une valeur numérique pour le mode est constituée de 1 à 4 portement de System V (void SVID version 3), en utilisant
chiffres en octal (0 a 7), calculés en additionnant les le bit Set-GID des fichiers sans autorisation d'exécution
bits de valeurs 4, 2, et 1. Un bit non mentionné étant pour le groupe comme un verrou. Pour plus de détails voyez
considéré comme nul. Le premier chiffre correspond aux le fichier /usr/src/linux/Documentation/mandatory.txt.
attributs Set-UID (4), Set-GID (2), et conservation du
code en mémoire [`stickyi bit'] (1). Le second chiffre TRADUCTION
correspond aux autorisations de lecture (4), écriture (2) Christophe Blaess, 1997.
et exécution pour l'utilisateur propriétaire du fichier.
Le troisième et le quatrième chiffres correspondent
respectivement aux autorisations d'accès pour les membres
du groupe du fichier, et pour les autres utilisateurs. FSF 29 Novembre 1996 CHMOD(1)

chmod ne modifie jamais les autorisations d'accès des


liens symboliques, l'appel système chmod(2) ne peut pas
les modifier. Ceci n'est pas un problème puisque ces $ $
autorisations ne sont jamais prises en compte. En fait,
chmod modifie les autorisations d'accès du fichier cible
du lien symbolique à condition que le lien soit explicite-
ment mentionné sur la ligne de commande. Par contre chmod
ignore purement et simplement les liens symboliques qu'il NOM
rencontre lors des descentes récursives de répertoires. chown - Modifier le propriétaire et le groupe d'un
fichier.
OPTIONS POSIX
-R Modifier récursivement les autorisations des réper- SYNOPSIS
toires et de leurs contenus. chown [options] proprietare[:groupe] fichier...

OPTIONS GNU Options POSIX : [-R]


-c, --changes
Ne décrire que les fichiers dont les permissions Options GNU (forme courte): [-cfhvR] [--help] [--version]
ont réellement changé. [--]

-f, --silent, --quiet DESCRIPTION

0 *
([NDT] chown = Change Owner).
ENVIRONNEMENT
chown modifie l'utilisateur et/ou le groupe propriétaire LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa-
de chacun des fichiers indiqués, en fonction du premier tions habituelles.
argument rencontré sur la ligne de commande, et qui ne
soit pas une option.
CONFORMITÉ
Si l'on indique uniquement un nom d'utilisateur (ou un UID POSIX 1003.2 n'autorise pas l'utilisation du point comme
numérique), celui-ci devient le propriétaire des fichiers séparateur de nom d'utilisateur et de groupe.
donnés, mais les groupes de ces fichiers ne sont pas mod-
ifiés.
TRADUCTION
Si le nom d'utilisateur est suivi d'un double-point, et Christophe Blaess, 1997.
d'un nom de groupe (ou d'un GID numérique), les fichiers
changent également de groupe.

FSF 15 Décembre 1998 CHOWN(1)


Spécificités GNU
La version GNU de chown accepte également un point pour
séparer le nom d'utilisateur de celui du groupe. Posix
réclame un double-point car il autorise l'utilisation du % %
point comme caractère d'un nom d'utilisateur.

Si le nom d'utilisateur est suivi d'un double-point, sans


nom de groupe, les fichiers appartiendront au groupe de
l'utilisateur mentionné. NOM
clear - Effacer l'écran du terminal.
Si l'on fournit un nom de groupe, précédé d'un double-
point, mais sans préciser de nom d'utilisateur, seul SYNOPSIS
l'appartenance au groupe est modifiée. Dans ce cas, chown clear
a les mêmes effets que chgrp.
DESCRIPTION
OPTIONS POSIX clear efface votre écran si c'est possible. Il cherche
-R Modifier récursivement l'appartenance des réper- dans l'environnement le type de terminal et ensuite con-
toires et de leurs contenus. sulte la base de données terminfo pour voir comment
effacer l'écran.

OPTIONS GNU VOIR AUSSI


-c, --changes tput(1), terminfo(5)
Ne décrire que les fichiers dont l'appartenance est
modifiée. TRADUCTION
Frédéric Delanoy, 2000.
-f, --silent, --quiet
Ne pas afficher de message d'erreur concernant les
fichiers dont l'appartenance n'a pas pu être mod-
ifiée.
Linux 23 Août 2000 CLEAR(1)
-h, --no-dereference
Agir sur un lien symbolique lui-même et non pas sur
la cible vers laquelle il pointe. Ceci n'est possi-
ble que si l'appel système lchown est disponible
dans le noyau.

-v, --verbose
Décrire les changements de propriétés.
NOM
cp - Copier des fichiers.
-R, --recursive
Modifier récursivement l'appartenance des réper-
SYNOPSIS
toires et de leurs contenus.
cp [options] fichier chemin
cp [options] fichier... répertoire
--help Afficher un message d'aide sur la sortie standard,
et terminer normalement.
Options POSIX : [-fipRr]
--version
Options GNU (forme courte) : [-abdfilprsuvxPR] [-S SUF-
Afficher le numéro de version sur la sortie stan-
FIXE] [-V {numbered,existing,simple}] [--sparse=WHEN]
dard, et terminer normalement.
[--help] [--version] [--]
rectement les copies des fichiers spéciaux ou des
DESCRIPTION FIFOs.
cp sert à copier des fichiers (et eventuellement des
répertoires). On peut aussi bien copier un fichier donné -r Copier récursivement les répertoires mais la ges-
vers une destination précise que copier un ensemble de tion des fichiers spéciaux n'est pas définie. En
fichiers dans un répertoire. fait l'option -r est autorisée, et même encouragée
à se comporter comme l'option -R, toutefois le com-
Si le dernier argument correspond à un nom de répertoire, portement (stupide) de la version GNU n'est pas
cp copie dans ce répertoire chaque fichier indiqué en con- interdit.
servant le même nom.
Spécificité GNU
Sinon, s'il n'y a que deux fichiers indiqués, il copie le En général les fichiers sont écrits immédiatement après
premier sur le second. lecture de l'original, sauf si l'on utilise l'option
--sparse décrite plus bas.
Une erreur se produit si le dernier argument n'est pas un
répertoire, et si plus de deux fichiers sont indiqués. Par Par défaut, cp ne copie pas les répertoires (voir l'option
défaut, on n'effectue pas la copie de répertoires. -r).

Ainsi `cp -r /a /b' copiera /a dans /b/a et /a/x dans cp refuse généralement de copier un fichier sur lui-même,
/b/a/x au cas où /b existe déjà, mais il copiera /a sur /b avec l'exception suivante : si les options --force et
et /a/x dans /b/x si /b n'existait pas encore. --backup sont indiquées, et si les fichiers origine et
copie sont identiques et se rapportent à un fichier
Les autorisations d'accès des fichiers et des répertoires régulier, cp effectuera une copie de sauvegarde (voir plus
créés seront les mêmes que celles des fichiers d'origine bas). Ceci peut servir à faire une sauvegarde d'un
masquées avec un ET binaire avec 0777, et modifiées par le fichier avant de le modifier.
umask de l'utilisateur (sauf si l'on invoque l'option -p).

Pendant la copie récursive de répertoires, les nouveaux OPTIONS GNU


répertoires verront leur masque temporairement étendu par -a, --archive
un OU binaire avec S_IRWXU (0700), afin d'autoriser le Préserver autant que possible la structure et les
processus d'y lire, écrire et vérifier le contenu. attributs du fichier original lors de la copie.
Cette option est équivalente à -dpR.
cp ne fait rien lorsque l'on tente de copier un fichier
sur lui-même (sauf éventuellement afficher un message -b, --backup
d'erreur). Effectuer une copie de sauvegarde des fichiers
écrasés ou supprimés.
Lorsque la copie se fait sur un fichier existant, celui-ci
est ouvert en utilisant `open(chemin, O_WRONLY | -d, --no-dereference
O_TRUNC)'. Lorsque la copie a lieu dans un nouveau Copier les liens symboliques en tant que tels
fichier, on invoque `open(chemin, O_WRONLY | O_CREAT, plutôt que de copier les fichiers vers lesquels ils
mode)'. Si l'ouverture d'un fichier existant échoue, et pointent. Préserver également les liens matériels
si l'option -f a été invoquée, cp essaye de supprimer, entre les fichiers sources durant la copie.
avec unlink(2), le fichier existant, puis de recréer un
nouveau fichier. -f, --force
Effacer les fichiers cibles existants.

OPTIONS POSIX -i, --interactive


Posix défini quatre options et demi : Interroger l'utilisateur avant d'écraser des
fichiers réguliers existants.
-f Effacer les fichiers cibles existants (voir ci-
dessus). -l, --link
Effectuer des liens matériels plutôt que des copies
-i Interroger l'utilisateur avant d'écraser des des fichiers réguliers.
fichiers réguliers existants. La question est
affichée sur stderr, et la réponse lue depuis -P, --parents
stdin. Construire le nom de chaque fichier destination en
ajoutant au répertoire cible un slash et le nom du
-p Conserver le propriétaire, le groupe, les permis- fichier source indiqué. Le dernier argument de cp
sions d'accès et les horodatages du fichier origi- doit être un répertoire existant. Par exemple, la
nal. Si la conservation du propriétaire ou du commande `cp --parents a/b/c rep_existant' copie le
groupe est impossible, les bits Set-UID et Set-GID fichier a/b/c en rep_existant/a/b/c, tout en créant
sont effacés. L'horodatage sera quand même les sous-répertoires intermédiaires manquants.
légèrement différent entre l'original et la copie
car l'opération de copie nécessite un accès en lec- -p, --preserve
ture au fichier source. Conserver le propriétaire, le groupe, les permis-
sions d'accès et les horodatages du fichier origi-
-R Copier récursivement les répertoires, et gérer cor- nal.
!
Afficher le nom de chaque fichier avant de le
-r Copier récursivement les répertoires, les sous- copier.
répertoires, et les fichiers réguliers qu'ils con-
tiennent. Les fichiers spéciaux et les FIFOs sont -x, --one-file-system
considérés comme des fichiers normaux, desquels ont Ignorer les sous-répertoires se trouvant sur un
essayera de lire des données pour les écrire dans système de fichiers différent de celui du départ de
le fichier destination. Ainsi `cp' risque de blo- la copie.
quer indéfiniment durant la lecture d'une FIFO ou
d'un fichier spécial /dev/tty. Il faut considérer OPTIONS DE SAUVEGARDE GNU
ceci comme un bug. Cela signifie qu'il faut éviter Les versions GNU des programmes comme cp, mv, ln, install
l'option -r, et la remplacer par -R. N'oublions et patch créeront au besoin une copie de sauvegarde des
pas que l'ouverture d'un fichier spécial inconnu, fichiers à écraser, à modifier ou à détruire. On demande
par exemple un scanner peut avoir des effets une copie de sauvegarde à l'aide de l'option -b, on
indésirables sur le matériel. indique la nomenclature à adopter avec l'option -V, et si
la sauvegarde se fait avec un suffixe, celui-ci est
-r Copier récursivement les répertoires, les sous- précisé avec l'option -S.
répertoires, en préservant tous les types de
fichiers rencontrés (voir option -r ci-dessus). -b, --backup
Créer une copie de sauvegarde des fichiers à
--sparse=QUAND écraser ou à détruire.
[NDT : sparse = clairsemé] Un fichier à trous
(sparse file) contient des séquences d'octets nuls -S SUFFIXE, --suffix=SUFFIXE
n'occupant pas de place sur le disque. L'appel Ajouter le SUFFIXE indiqué à chaque fichier de
système `read' lit ces données comme des zéros. Non sauvegarde créé. Si cette option n'est pas
seulement cela permet d'économiser de la place sur indiquée, on utilisera la valeur de la variable
le disque, mais on gagne également de la vitesse de d'environnement SIMPLE_BACKUP_SUFFIX. Si la vari-
lecture. De nombreux fichiers binaires (exécutables able SIMPLE_BACKUP_SUFFIX n'existe pas, la valeur
par exemple) contiennent des séquences importantes par défaut est `~'.
de zéros. Par défaut, cp détecte les trous dans les
fichiers en utilisant une heuristique grossière et -V METHODE, --version-control=METHODE
restituera les trous dans les fichiers de sortie. Préciser la nomenclature des fichiers de sauvegarde
La METHODE indiquée peut être `numbered' (`t'),
L'argument QUAND peut prendre l'une des valeurs `existing' (`nil'), ou `never' (`simple'). Si
suivantes : cette option n'est pas indiquée, la valeur de la
variable d'environnement VERSION_CONTROL est
auto Le comportement par défaut, le fichier de utilisée, et si la variable VERSION_CONTROL
sortie est troué si des trous sont détectés n'existe pas, la valeur par défaut est `existing'.
dans le fichier d'entrée.
Cette option correspond à la variable `version-con-
always Toujours trouer les fichiers de sortie. trol' sous Emacs. Les METHODES valides (les
Cette option sert lorsque les fichiers abbréviations non-ambigües sont acceptées) sont :
d'entrée se trouvent sur un système de
fichiers n'acceptant pas les trous, et que t, numbered
les fichiers de sortie se trouveront sur un Toujours faire une sauvegarde numérotée.
système les acceptant.
nil, existing
never Ne jamais essayer de faire de trous dans les Faire une sauvegarde numérotée des fichiers
fichiers de sortie. Si vous trouvez une en ayant déjà une précédente, et une sauveg-
utilité à cette option, faites nous le arde simple pour les autres.
savoir...
never, simple
-s, --symbolic-link Faire toujours une sauvegarde simple.
Créer des liens symboliques plutôt que des copies
des fichiers réguliers. Tous les noms de fichiers OPTIONS STANDARDS GNU
sources doivent être absolus (commençant par '/') à --help Afficher un message d'aide sur la sortie standard,
moins que les fichiers destinations résident dans et terminer correctement.
le répertoire en cours. Cette option affiche un
message d'erreur pour les systèmes de fichiers ne --version
supportant pas les liens symboliques. Afficher un numéro de version sur la sortie stan-
dard, et terminer correctement.
-u, --update
Ne pas effectuer la copie si le fichier destination -- Fin de la liste d'options.
existant (autre qu'un répertoire) a une date de
modification égale ou plus récente que celle du ENVIRONMENT
fichier source. Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont
leurs significations habituelles. Pour la version GNU,
-v, --verbose les variables SIMPLE_BACKUP_SUFFIX et VERSION_CONTROL con-
'
figurent la nomenclature adoptée pour les sauvegardes de
fichiers. Linux 12 Décembre 1998 CRON(8)

CONFORMITÉ
POSIX 1003.2.
" & "
TRADUCTION
Christophe Blaess, 1997.
NOM
cron - Démon permettant de lancer des commandes différées
FSF 5 Mai 1999 CP(1) (Vixie Cron).

SYNOPSIS
cron
" & " DESCRIPTION
Cron devrait normallement être lancé par un script /etc/rc
ou /etc/rc.local. Cette commande revient immédiatement, il
n'est pas nécessaire de la lancer avec un '&'.
NOM
cron - Démon permettant de lancer des commandes différées Cron recherche dans le répertoire /var/spool/cron, des
(Vixie Cron). fichiers de crontab ayant des noms existants dans
/etc/passwd. Les fichiers trouvés sont chargés en mémoire.
SYNOPSIS Cron recherche également /etc/crontab, qui a un format
cron différent (voir crontab(5)).

DESCRIPTION Ensuite, cron s'éveille toutes les minutes, examine les


Cron devrait normallement être lancé par un script /etc/rc crontabs mémorisés, et vérifie chaque commande pour savoir
ou /etc/rc.local. Cette commande revient immédiatement, il s'il doit la lancer dans la minute à venir. Lors de
n'est pas nécessaire de la lancer avec un '&'. l'exécution d'une commande, toute sortie est envoyée par
mail au propriétaire de la crontab (ou à l'utilisateur
Cron recherche dans le répertoire /var/spool/cron, des dont le nom est mentionné dans la variable d'environnement
fichiers de crontab ayant des noms existants dans MAILTO si elle existe).
/etc/passwd. Les fichiers trouvés sont chargés en mémoire.
Cron recherche également /etc/crontab, qui a un format De plus, cron vérifie chaque minute si la date de modifi-
différent (voir crontab(5)). cation de son répertoire de stockage (ainsi que la date de
/etc/crontab) a changé. Si c'est le cas, cron examinera
Ensuite, cron s'éveille toutes les minutes, examine les les dates de modifications de chaque fichier crontab, et
crontabs mémorisés, et vérifie chaque commande pour savoir rechargera ceux qui ont été changés. Ainsi, cron n'a pas
s'il doit la lancer dans la minute à venir. Lors de besoin d'être redémarré après la modification d'un fichier
l'exécution d'une commande, toute sortie est envoyée par crontab. Notez que la commande crontab(1) met à jour la
mail au propriétaire de la crontab (ou à l'utilisateur date de modification du répertoire de stockage si un
dont le nom est mentionné dans la variable d'environnement changement a lieu.
MAILTO si elle existe).
VOIR AUSSI
De plus, cron vérifie chaque minute si la date de modifi- crontab(1), crontab(5)
cation de son répertoire de stockage (ainsi que la date de
/etc/crontab) a changé. Si c'est le cas, cron examinera AUTEUR
les dates de modifications de chaque fichier crontab, et Paul Vixie <paul@vix.com>
rechargera ceux qui ont été changés. Ainsi, cron n'a pas
besoin d'être redémarré après la modification d'un fichier TRADUCTION
crontab. Notez que la commande crontab(1) met à jour la Christophe Blaess, 1998.
date de modification du répertoire de stockage si un
changement a lieu.

VOIR AUSSI Linux 12 Décembre 1998 CRON(8)


crontab(1), crontab(5)

AUTEUR
Paul Vixie <paul@vix.com>

TRADUCTION
Christophe Blaess, 1998.
NOM
crontab - Editer son fichier crontab personnel.
- &
SYNOPSIS TRADUCTION
crontab [ -u utilisateur ] fichier Christophe Blaess, 1997.
crontab [ -u utilisateur ] { -l | -r | -e }

DESCRIPTION
Crontab est le programme utilisé pour installer, désin- Linux 22 Avril 1997 CRONTAB(1)
staller, ou afficher le contenu des tables permettant de
piloter le fonctionnement du démon cron(8) de Vixie Cron.
Chaque utilisateur dispose de sa propre table crontab, et
bien que celles-ci se trouvent dans /var, elles ne sont ' '
pas conçues pour être éditées directement.

Si le fichier allow existe, alors vous devez être men-


tionnés dans celui-ci pour pouvoir utiliser cette com-
mande. Si le fichier allow n'existe pas, mais que le NOM
fichier deny existe, alors vous ne devez pas être men- cut - Supprimer une partie de chaque ligne d'un fichier.
tionnés dans celui-ci, si vous désirez utiliser cette com-
mande. Si aucun de ces deux fichiers n'existe alors, SYNOPSIS
selon la configuration du site, soit le Super-utilisateur cut {-b liste_octets, --bytes=liste_octets} [-n] [--help]
uniquement à le droit d'utiliser crontab, soit tous les [--version] [fichier...]
utilisateurs le peuvent.
cut {-c character-list, --characters=liste_caractères}
Si l'option -u est indiquée, elle permet de préciser le [--help] [--version] [fichier...]
nom de l'utilisateur dont la crontab doit être manipulée.
Si cette option n'est pas indiquée, crontab examiner cut {-f liste_champs, --fields=liste_champs} [-d sépara-
"votre" table, c'est à dire la table de la personne invo- teur] [-s] [--delimiter=séparateur] [--only-delimited]
quant la commande. [--help] [--version] [fichier...]

Notez qu'un appel à su(8) peut induire crontab en erreur. DESCRIPTION


Ainsi si vous avez effectué un su(8) vous devez toujours Cette page de manuel documente la version GNU de cut.
utiliser l'option -u par précaution.
cut affiche une partie de chaque ligne de chacun des
La première forme de cette commande sert à installer une fichiers mentionnés, ou de l'entrée standard si aucun
nouvelle table crontab, en utilisant le fichier indiqué, fichier n'est indiqué. Un nom de fichier `-' correspond
ou l'entrée standard si le nom de fichier est ``-''. également à l'entrée standard.

L'option -l permet d'imprimer la table crontab en cours La partie affichée est sélectionnée par les options
sur la sortie standard. présentées ci-dessous.

L'option -r supprime la table crontab en cours. OPTIONS


Les liste_d_octets, liste_de_caractères, et
L'option -e permet d'éditer la table en cours, en util- liste_de_champs se présentent sous forme d'un ou plusieurs
isant l'éditeur indiqué par les variables d'environnement nombres ou intervalles (deux nombres séparés par un
VISUAL ou EDITOR. Une fois que vous sortez de l'éditeur, tiret), séparés par des virgules. La numérotation des
la table modifiée sera installée automatiquement. octets, caractères ou champs commence à 1. Des inter-
valles incomplets peuvent être indiqués : `-m' signifiant
VOIR AUSSI `1-m'; `n-' signifiant de `n' à la fin de la ligne.
crontab(5), cron(8)
-b, --bytes liste_d_octets
FICHIERS Afficher uniquement les octets aux positions
/etc/cron.allow indiquées dans la liste_d_octets. Les tabulations
/etc/cron.deny et les caractères BackSpaces sont traités comme
tous les autres caractères, ils occupent 1 octet.
STANDARDS
La commande crontab est conforme au standard IEEE -c, --characters liste_de_caractères
Std1003.2-1992 (``POSIX''). Cette nouvelle syntaxe diffère Afficher uniquement les caractères aux positions
des versions précédentes de Vixie Cron, tout autant que de indiquées dans la liste_de_caractères. Pour
la syntaxe SVR3 classique. l'instant c'est équivalent à -b, mais cette option
différera avec l'internationalisation. Les tabula-
DIAGNOSTIQUE tions et les caractères BackSpaces sont traités
Un gentil message d'aide est affiché si vous invoquez comme tous les autres caractères, ils occupent 1
crontab avec des arguments erronés. caractère.

AUTEURS -f, --fields liste_de_champs


Paul Vixie <paul@vix.com> N'afficher que les champs indiqués dans la
liste_de_champs. Les champs sont séparés, par

0 *
défaut, par une Tabulation.
t tabulation horizontale
-d, --delimiter séparateur
Avec -f, les champs sont délimités par le premier Champs horaires :
caractère du séparateur à la place de la Tabula-
tion. %H heure (00..23)

-n Ne pas couper les caractères multi-octets (sans %I heure (01..12)


effet pour le moment).
%k heure ( 0..23)
-s, --only-delimited
Avec -f, ne pas afficher les lignes qui ne contien- %l heure ( 1..12)
nent pas le caractère séparateur de champs.
%M minute (00..59)
--help Afficher un message d'aide sur la sortie standard
et terminer normalement. %p notation locale pour AM ou PM.

--version %r heure actuelle (sur 12 heures) (hh:mm:ss [AP]M)


Afficher un numéro de version sur la sortie stan-
dard et terminer normalement. %s secondes écoulées depuis le 01-01-1970 à 00:00:00
T.U (extension non standard)

TRADUCTION %S secondes (00..61)


Christophe Blaess, 1997.
%T heure actuelle, (sur 24 heures) (hh:mm:ss)

%X représentation locale de l'heure (%H:%M:%S)


FSF 9 Janvier 1997 CUT(1)
%Z fuseau horaire (par ex. MET), ou rien si le fuseau
horaire n'est pas déterminé
# % # % Champs de date :

%a abréviation locale du jour de la semaine (Dim ..


Sam)
NOM
date - Afficher ou configurer la date et l'heure du %A nom local du jour de la semaine (Dimanche ..
système. Samedi)
SYNOPSIS %b abréviation locale du nom du mois (Jan..Dec)
date [-u] [-d chaîne_date] [-s chaîne_date] [--utc]
[--universal] [--date=chaîne_date] [--set=chaîne_date] %B nom local du mois (Janvier .. Décembre)
[--help] [--version] [+FORMAT] [MMJJhhmm[[SS]AA][.ss]]
%c date et heure locales (Sat Nov 04 12:02:33 EST
1989)
DESCRIPTION
Cette page de manuel documente la version GNU de date. %d jour du mois (01..31)
date sans argument affiche la date et l'heure actuelles %D date (mm/jj/aa)
(avec le format indiqué par la directive `%c' décrite
plus-bas). %h comme %b
Si un argument commençant par un `+' est indiqué, la date %j jour de l'année (001..366)
et l'heure sont affichées avec un format contrôlé par cet
argument. La structure de la chaîne précisant le format %m mois (01..12)
est semblable à celle utilisée avec la fonction strf-
time(3). %U numéro de semaine dans l'année (00..53). La semaine
commence le Dimanche.
Les caractères présents dans cette chaîne sont affichés
tels quels, sauf les directives, commençant toutes par %w Jour de la semaine (0..6). Le 0 correspond au
'%'. Dimanche.
Ces directives sont les suivantes : %W numéro de semaine dans l'année (00..53). La semaine
commence le Lundi.
% un caractère % littéral.
%x représentation locale de la date (mm/jj/aa)
n saut de ligne
%y deux derniers chiffres de l'année (00..99) date --date '3 months 1 day'

%Y année (1970...) Pour afficher le numéro du jour de Noêl de l'année en


cours :
Par défaut, date complète les champs numériques avec des
zéros. La version GNU de date dispose des options non date --date '25 Dec' +%j
standards suivantes :
Pour afficher la date actuelle dans un format incluant le
- (tiret) ne pas compléter le champ jour du mois suivi du nom complet du mois :

_ (souligne) remplir le champ avec des espaces date '+%d %B'

Si l'on fournit un argument ne commençant pas par `+', Il est parfois indésirable que les 9 premiers jours du
date le considère comme une heure à utiliser pour config- mois soient complétés par un zéro. l'argument `%d' est
urer l'horloge système. Cet argument doit être constitué responsable de ce complément sur deux chiffres. Par exem-
uniquement de chiffres, ayant la signification suivante : ple `date -d 1-may '+%d %B'' donnera `01 May'.

MM mois Pour afficher la même chose sans le zéro de complément, on


peut utiliser l'option non standard `-'.
JJ jour du mois
date -d 1-may '+%-d %B'
hh heure

mm minute TRADUCTION
Christophe Blaess, 1997.
SS Deux premiers chiffres de l'année (facultatif)

AA Deux derniers chiffres de l'année (facultatif)


FSF 22 Décembre 1996 DATE(1L)
ss secondes (facultatif)

Seul le Super-Utilisateur peut configurer l'horloge du ## ##


système.

OPTIONS
-d chaîne_date, --date chaîne_date
Afficher la date et l'heure indiquées par la chaîne NOM
chaîne_date. L'affichage est fait avec le format dd - Convertir un fichier en le copiant.
par défaut, à moins qu'un argument commençant par
un `+' ne fournisse un autre format SYNOPSIS
dd [--help] [--version] [if=fichier] [of=fichier]
--help Afficher un message d'aide sur la sortie standard, [ibs=octets] [obs=octets] [bs=octets] [cbs=octets]
et terminer normalement. [skip=blocs] [seek=blocs] [count=blocs]
[conv={ascii,ebcdic,ibm,block,unblock,lcase,ucase,swab,noer-
-s chaîne_date, --set chaîne_date ror,notrunc, sync}]
Configurer l'horloge système avec la date et
l'heure indiquées par chaîne_date, qui peut con- DESCRIPTION
tenir éventuellement des noms littéraux de mois, de dd copie un fichier (par défaut, depuis l'entrée standard
fuseau horaire, `am' ou `pm', etc... vers la sortie standard) en permettant de sélectionner la
taille de bloc, et d'effectuer des conversions.
-u, --universal
Afficher ou configurer l'heure en utilisant le OPTIONS
Temps Universel (heure du méridien de Greenwich) Tous les nombres peuvent être suivis d'un multiplicateur
plutôt que le temps local. correspondant à :
b=512, c=1, k=1024, w=2, xm=nombre m
--version
Afficher un numéro de version sur la sortie stan- if=fichier
dard, et terminer normalement. Lire les données depuis le fichier indiqué plutôt
que depuis l'entrée standard.
EXEMPLES
Pour afficher la date de l'avant-veille : of=fichier
Ecrire les données dans le fichier mentionné, et
date --date '2 days ago' non pas sur la sortie standard. Si conv=notrunc
n'est pas indiqué, le fichier est limité à la
Pour afficher la date du jour à venir dans 3 mois plus un taille spécifiée par seek= (0 octets si seek= n'est
jour : pas fourni).

!
ibs=nombre et terminer correctement.
Lire le nombre indiqué d'octets en une fois.
--version
obs=nombre Afficher un numéro de version sur la sortie stan-
Ecrire le nombre indiqué d'octets en une fois. dard, et terminer correctement.

bs=nombre -- Fin de la liste d'options.


Lire et écrire le nombre indiqué d'octets en une
fois. A priorité sur ibs et obs. ENVIRONMENT
Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont
cbs=nombre leurs significations habituelles.
Convertir le nombre indiqué d'octets en une fois.
CONFORMITÉ
skip=nombre POSIX 1003.2.
Ignorer le nombre indiqué de blocs (dont la taille
est fournie par ibs) au début de la lecture.
TRADUCTION
seek=nombre Christophe Blaess, 1997.
Ignorer le nombre indiqué de blocs (dont la taille
est fournie par ibs) au début de l'écriture.

count=nombre FSF 15 Décembre 1998 DD(1)


Copier seulement le nombre indiqué de blocs (dont
la taille est fournie par ibs).

conv=conversion[,conversion]... #! #!
Modifier le fichier comme indiqué par l'argument
conversion, qui peut prendre les valeurs suivantes:

ascii Convertir l'EBCDIC en ASCII. NOM


df - Fournit la quantité d'espace occupé des systèmes de
ebcdic Convertir l'ASCII en EBCDIC. fichiers.

ibm Convertir l'ASCII en EBCDIC IBM. SYNOPSIS


df [options] [fichier...]
block Compléter les blocs se terminant par un saut
de ligne avec des espaces, jusqu'à atteindre Options POSIX : [-kP]
la taille mentionnée par cbs.
Options GNU (versions courtes) : [-ahikmPv] [-t type_fs]
unblock [-x type_fs] [--print-type] [--no-sync] [--sync] [--help]
Remplacer les espaces en fin de blocs (de [--version] [--]
taille cbs) par un saut de ligne.
DESCRIPTION
lcase Transformer les majuscules en minuscules. df indique les quantités d'espaces disques utilisées et
disponibles sur les systèmes de fichiers.
ucase Transformer les minuscules en majuscules.
Sans argument, df indiquera les quantités correspondant à
swab Echanger par paire les octets lus en entrée. tous les systèmes de fichiers montés, quelques soient
Contrairement à la commande dd d'Unix, la leurs types. Sinon, df affichera les données correspon-
version GNU fonctionne également lorsqu'on dant aux systèmes contenant chaque fichier fournit en
copie un nombre impair d'octets. Dans ce argument.
cas, le dernier octet est tout simplement
copié. PRÉCISIONS POSIX
Les valeurs sont indiquées en unités de 512 octets par
noerror défaut, mais si l'option -k est utilisée, l'unité est 1024
Continuer même après des erreurs de lecture. octets. Le format de sortie n'est pas défini si l'option
-P n'est pas utilisée. Si le fichier n'est pas un fichier
notrunc régulier, un répertoire, ou une FIFO, le résultat est
Ne pas limiter la taille du fichier de sor- imprévisible.
tie.
PRÉCISIONS GNU
sync Compléter chaque bloc lu avec des NULs pour Les valeurs sont fournies en unités de 1024 octets par
atteindre la taille ibs. défaut, sauf si la variable d'environnement POSIXLY_COR-
RECT existe, auquel cas le comportement POSIX est adopté.
OPTIONS STANDARDS GNU
--help Afficher un message d'aide sur la sortie standard, Si un fichier indiqué en argument est un périphérique

'
disque contenant un système de fichiers monté, df -t type, --type=type
affichera l'espace disponible sur ce système de fichiers Limiter la liste aux systèmes de fichiers du type
plutôt que sur celui contenant le noeud du périphérique. indiqué. On peut fournir plusieurs types de
systèmes en utilisant plusieurs options -t. Par
OPTIONS POSIX défaut, rien n'est omis.
-k Utiliser des unités de 1024 octets plutôt que les
unités de 512 octets par défaut. -T, --print-type
Afficher le type de chaque système de fichiers.
-P Affichage sur six colonnes, précédées de l'en-tête Les types affichés sont indiqués par le système (de
`Filesystem N-blocks Used Available Capacity manière spécifique, par exemple en lisant
Mounted on' (avec N=512, ou N=1024 si l'option -k /etc/mtab). Voir également mount(8).
est utilisée).
-x type, --exclude-type=type
OPTIONS GNU Limiter l'affichage aux systèmes n'ayant PAS le
-a, --all type indiqué. Plusieurs types de systèmes de
Inclure dans le listing les systèmes de fichiers fichiers peuvent être éliminés en utilisant
ayant une taille de 0 blocs, et qui sont omis par plusieurs options -x. Par défaut, rien n'est omis.
défaut. Il s'agit typiquement de pseudo-systèmes de
fichiers particuliers comme les entrées d'un auto- -v Ignoré. Pour compatibilité avec System V. df.
monteur. De même les systèmes de type "ignore" ou
"auto" utilisés par certains systèmes d'exploita- OPTIONS STANDARDS GNU
tion ne sont inclus qu'avec cette option. --help Afficher un message d'aide sur la sortie standard,
et terminer correctement.
-h, --human-readable
Ajouter à chaque valeur une lettre comme M pour --version
Méga-octet, afin d'améliorer la lisiblité. Afficher un numéro de version sur la sortie stan-
dard, et terminer correctement.
-i, --inodes
Afficher les informations sur l'utilisation des i- -- Fin de la liste d'options.
noeuds plutôt que les blocs. Un i-noeud (noeud
d'index) contient des informations sur un fichier ENVIRONNEMENT
comme son propriétaire, ses dates d'accés et sa La variable POSIXLY_CORRECT determine le choix des unités.
position sur le disque. Si elle n'existe pas, et si la variable BLOCKSIZE a une
valeur commencant par HUMAN alors, le comportement est
-k, --kilobytes celui de l'option -h (à moins qu'il soit surchargé par une
Afficher les valeurs avec des unités de 1024 option -k ou -m). Les variables LANG, LC_ALL, LC_CTYPE et
octets. LC_MESSAGES ont leurs significations habituelles.

-m, --megabytes CONFORMITÉ


Afficher les valeurs avec des unités de 1 048 576 POSIX 1003.2
octets (un méga-octet).
VOIR AUSSI
--no-sync mount(8)
Ne pas invoquer l'appel système sync avant
d'obtenir les informations sur l'utilisation du NOTES
disque. Ceci peut permettre à df de s'exécuter Cette page décrit la version de df se trouvant dans le
sensiblement plus vite, mais sur certains systèmes package fileutils-3.16. D'autres versions peuvent
(notamment SunOS) les résultats peuvent être forte- diffèrer légèrement. Envoyez les corrections concernant
ment dépassés. Il s'agit du comportement par cette page de manuel (en anglais) à aeb@cwi.nl,
défaut. aw@mail1.bet1.puv.fi, et ragnar@lightside.ddns.org, et (en
francais) à ccb@club-internet.fr. Signalez les bugs dans
-P, --portability le program à fileutils-bugs@gnu.ai.mit.edu.
Utiliser le format d'affichage POSIX Par rapport à
l'affichage par défaut, les informations sur un
système de fichiers sont toujours affichées sur une TRADUCTION
ligne exactement. Ceci signifie que si un système Christophe Blaess, 1998.
de fichiers monté a plus de 20 caractères de long
(par exemple un montage à travers le réseau), les
colonnes sont mal alignées.
FSF 5 Mai 1999 DF(1)
--sync Invoquer l'appel système sync avant d'obtenir les
informations sur l'utilisation du disque. Sur cer-
tains systèmes (notamment SunOS) ceci fournit des
résultats beaucoup plus à jour, mais df s'exécute # %( " & # %( "
parfois beaucoup plus lentement, surtout si des
systèmes de fichiers sont très utilisés.

- &
NOM
dmesg - Afficher et contrôler le tampon des messages du NOM
noyau. du - Statistiques sur l'utilisation du disque.

SYNOPSIS SYNOPSIS
dmesg [ -c ] [ -n nivaeu ] [ -s taille ] du [options] [fichier...]

DESCRIPTION Options POSIX : [-askx]


dmesg est utilisé pour examiner ou contrôler le tampon des
messages du noyau. Options GNU (forme courte): [-abchklmsxDLS] [--help]
[--version] [--]
Le programme aide les utilisateurs à afficher les messages
du démarrage de la machine. Au lieu de copier ces messages DESCRIPTION
à la main, il suffit de faire du affiche la quantité d'espace disque utilisée par chacun
dmesg > boot.messages des arguments, et pour chaque sous-répertoire des réper-
et envoyer par courrier électronique le fichier boot.mes- toires indiqués en argument. Toutes les mesures contien-
sages à quelqu'un capable d'identifier un éventuel nent l'ensemble de la hiérarchie des sous-répertoires dans
problème. le système de fichiers. Sans argument, du mesure l'espace
occupé par le répertoire courant et ses descendants.
OPTIONS
-c Efface le tampon des messages du noyau après les L'espace est mesure en blocs d'un Ko par défaut, à moins
avoir affichés. que la variable d'environnement POSIXLY_CORRECT soit con-
figurée, auquel cas les blocs représentent 512 octets.
-s taille
utilise un tampon de la taille indiquée au lieu OPTIONS POSIX
d'utiliser la taille courante. Par défaut, 8196 -a Afficher les statistiques pour tous les fichiers,
octets sont utilisés par le démon syslog du noyau pas seulement les répertoires.
dans les versions 2.0.33 et 2.1.103. Si vous
utiliser un tampon plus large que celui par défaut, -k Afficher la taille en kilo-octets
cette option vous permet de voir le tampon tout
entier. -s Afficher seulement le total pour chaque argument.

-n niveau -x Ignorer les répertoires situés sur un système de


règle le niveau des messages à afficher sur la con- fichiers différent de celui de l'argument étudié.
sole. Par exemple, -n 1 supprime l'affichage de
tous les messages, exceptés les messages graves. OPTIONS GNU
Tous les niveaux d'affichage des messages sont -a, --all
enregistrés dans /proc/kmsg, ainsi syslogd(8) peut Afficher les statistiques pour tous les fichiers,
être toujours utilisé pour contrôler exactement où pas seulement les répertoires.
les messages du noyau apparaissent. Quand l'option
-n est utilisée, dmesg n'affichera ou n'effacera -b, --bytes
pas le tampon des messages du noyau. Afficher les tailles en octets.

Quans les deux options sont utilisées, seule la -c, --total


dernière option sur la ligne de commande est prise Afficher un total complet de tous les arguments,
en compte. après les avoir tous affiché. Ceci permet de
connaître l'espace occupé par un répertoire en
VOIR AUSSI. excluant certains fichiers.
syslogd(8)
-h, --human
AUTEUR Afficher les tailles de manière facile à lire par
Theodore Ts'o (tytso@athena.mit.edu) un humain, en ajoutant un suffixe correspondant à
l'unite (K, M, G).
TRADUCTION
Thierry Vignaud <tvignaud@mandrakesoft.com>, 1999. -k, --kilobytes
Afficher la taille en kilo-octets. Cette option a
priorité sur la variable d'environnement
POSIXLY_CORRECT.

Linux 19 Mars 1999 DMESG(8) -l, --count-links


Compter la taille de tous les fichiers, même s'ils
ont déjà été pris en compte via un autre lien
physique.
#' #' -s, --summarize
Afficher seulement le total pour chaque argument.
0 !*
SYNOPSIS
-x, --one-file-system env [-] [-i] [-u name] [--ignore-environment]
Ignorer les répertoires situés sur un système de [--unset=nom] [--help] [--version] [nom=valeur]... [com-
fichiers différent de celui de l'argument étudié. mande [args...]]
env
-D, --dereference-args
Déréférencer les liens symboliques indiqués en tant DESCRIPTION
qu'argument sur la ligne de commande. Ne pas Cette page de manuel documente la version GNU de env.
déréférencer les autres liens symboliques. Ceci
permet de mesurer la place disque occupée par des env exécute une commande dans un environnement modifié par
répertoires comme /usr/tmp quand il s'agit de liens les spécifications fournies sur la ligne de commande
symboliques vers un autre répertoire.
Les arguments du type 'nom=valeur' remplissent la variable
-L, --dereference d'environnement nom avec la valeur indiquée.
Déréférencer les liens symboliques (prendre en
compte l'espace utilisé par le fichier ou le réper- valeur peut être vide (`nom='). Remplir une variable avec
toire pointé par le lien, à la place de l'espace une valeur vide n'est pas la même chose que l'effacer de
utilisé seulement par le lien). l'environnement.

-S, --separate-dirs Le premier argument restant correspond au programme à


Compter la taille de chaque répertoire séparement, exécuter. Il est recherché en fonction de la variable
sans inclure les tailles des sous-répertoires. d'environnement PATH. Tous les arguments ultérieurs sont
passés en ligne de commande au programme invoqué.
--help Afficher un message d'aide et terminer normalement.
Si aucune commande n'est fournie après les spécifications
--version d'environnement, ce dernier est affiché. L'effet est le
Afficher un numéro de version et terminer normale- même que de fournir le nom de commande `printenv'.
ment.
OPTIONS
BOGUES --help Afficher un message d'aide sur la sortie standard
Sur les systèmes BSD, du affiche des tailles correspondant et terminer normalement.
à la moitie de la taille réelle pour les fichiers situés
sur un système HP-UX monté par NFS. Sur les systèmes HP- -u, --unset nom
UX, les tailles sont doublées pour les fichiers montés par Effacer la variable nom de l'environnement, si elle
NFS depuis un système BSD. Ceci est dû à un défaut d'HP- y était présente.
UX, qui affecte également la version HP-UX de la commande
du. -, -i, --ignore-environment
Démarrer avec un environnement vide, et non pas
ENVIRONNEMENT avec l'environnement hérité par env.
La variable POSIXLY_CORRECT determine le choix des unités.
Si elle n'existe pas, et si la variable BLOCKSIZE a une --version
valeur commencant par HUMAN alors, le comportement est Afficher un numéro de version sur la sortie stan-
celui de l'option -h (à moins qu'il soit surchargé par une dard et terminer normalement.
option -k ou -m). Les variables LANG, LC_ALL, LC_CTYPE et
LC_MESSAGES ont leurs significations habituelles.
TRADUCTION
CONFORMITÉ Christophe Blaess, 1997.
POSIX 1003.2

TRADUCTION FSF 22 Décembre 1996 ENV(1L)


Christophe Blaess, 1997.

FSF 15 Décembre 1998 DU(1)


!# ( " *+ & & !# ( "

NOM
% ) % ) fdisk - Manipuler les tables de partitions pour Linux.

SYNOPSIS
fdisk [-u] périphérique
NOM
env - Exécuter un programme dans un environnement modifié. fdisk -l [-u] [périphérique ...]

! !
fdisk -s partition ... sur l'entête de volume. Ne modifiez pas son type ni ne
créez de système de fichiers dessus, car vous perdriez
fdisk -v alors la table des partitions. N'utilisez ce type de
label que quand vous travaillez sous Linux sur des
DESCRIPTION machines IRIX/SGI ou quand vous utilisez des disques
Les disques durs peuvent être divisés en un ou plusieurs IRIX/SGI sous Linux.
disques logiques appelés partitions. Cette division est
décrite dans la table des partitions trouvée sur le Une table de partitions de type DOS peut décrire un nombre
secteur 0 du disque. illimité de partitions. Dans le secteur 0, il y a de la
place pour décrire 4 partitions (appelées `primaires').
Dans le monde BSD, on parle de `tranches de disque' et de L'une d'entre elles peut être une partition étendue; c'est
`label de disque'. une sorte de boîte contenant des partitions logiques, dont
les descripteurs sont trouvés dans une liste chaînée de
Linux a besoin d'au moins une partition, pour son système secteurs, chacun précédant les partitions logiques corre-
de fichiers racine. Il peut utiliser des fichiers de swap spondantes. Les quatre partitions primaires, présentes ou
ou des partitions de swap, mais ces dernières sont plus pas, portent les numéros 1-4. Les partitions logiques
efficaces. C'est pourquoi, en général, on utilise une sont numérotées à partir de 5.
seconde partition Linux en tant que partition de swap.
Sur les matériels compatibles Intel, le BIOS qui démarre Dans une table de partitions de type DOS, le décalage de
le système ne peut souvent accéder qu'aux 1024 premiers départ et la taille de chaque partition sont conservés de
cylindres du disque. Pour cette raison, les personnes deux façons : comme un nombre absolu de secteurs (en 32
possédant des disques volumineux créent souvent une bits), ou comme un triplet Cylindres/Têtes/Secteurs (en
troisième partition, de quelques MB de taille, montée en 10+8+6 bits). La première manière fonctionne bien - avec
général en /boot, pour conserver l'image du noyau et un des secteurs de 512 bytes, cela marchera jusqu'à 2 TB. La
petit nombre de fichiers auxiliaires nécessaires au démar- seconde possibilité souffre de deux problèmes différents.
rage, pour être sûr que ce matériel soit accessible par le Primo, ces champs C/T/S ne peuvent être remplis que
BIOS. Il peut y avoir des raisons de sécurité, de lorsque les nombre de têtes et de secteurs par piste sont
facilité d'administration et de sauvegarde ou de tests connus. Secundo, même si l'on connaissait ces nombres,
pour utiliser plus que le nombre minimal de partitions. les 24 bits qui sont disponibles ne suffiraient pas. DOS
utilise uniquement C/T/S, Windows utilise les deux, Linux
fdisk (dans la première forme d'invocation) est un pro- ne l'utilise jamais.
gramme dirigé par un menu utilisé pour la création et la
manipulation de tables de partitions. Il comprend les Si c'est possible, fdisk déterminera la géométrie du
tables de partitions de type DOS, et les labels de disque disque automatiquement. Ce n'est pas nécessairement la
BSD ou SUN. géométrie physique du disque (en effet, les disques mod-
ernes n'ont pas réellement de géométrie physique, et
Le périphérique est en général l'un des suivants : sûrement pas une géométrie décrite dans la forme simpliste
/dev/hda Cylindres/Têtes/Secteurs), mais c'est la géométrie de
/dev/hdb disque utilisée par MS-DOS pour la table des partitions
/dev/sda que fdisk peut détecter.
/dev/sdb
(/dev/hd[a-h] pour les disques IDE, /dev/sd[a-p] pour les D'habitude, tout se passe bien, et il n'y a aucun problème
disques SCSI, /dev/ed[a-d] pour les disques ESDI, si Linux est le seul système sur le disque. Néanmoins, si
/dev/xd[ab] pour les disques XT). Un nom de périphérique le disque doit être partagé avec d'autres systèmes
référence le dique entier. d'exploitation, c'est en général une bonne idée de laisser
créer au moins une partition par un fdisk d'un autre
La partition est un nom de périphérique suivi d'un numéro système d'exploitation. Quand Linux démarre, il regarde
de partition. Par exemple, /dev/hda1 est la première par- la table des partitions, et essaie de déduire quelle
tition sur le premier disque dur IDE du système. Les dis- (fausse) géométrie est requise pour une bonne coopération
ques IDE peuvent avoir jusqu'à 63 partitions, les disques avec les autres systèmes.
SCSI jusqu'à 15. Pour de plus amples informations, lisez
/usr/src/linux/Documentation/devices.txt. Chaque fois qu'une table des partitions est écrite, un
test de cohérence est effectué sur les entrées de la table
Un label de disque de type BSD/SUN peut décrire 8 des partitions. Ce test vérifie que les début et fin
partitions, dont la troisième devrait être un `disque physiques et logiques sont identiques, et que la partition
entier'. Ne créez pas de partition qui ait son premier commence et se termine avec une limite de cylindre (sauf
secteur sur le cylindre 0 (comme une partition de swap), pour la première partition).
car cela détruirait le label du disque.
Certaines versions de MS-DOS créent une première partition
Un label de disque de type IRIX/SGI peut décrire 15 parti- qui ne commencent pas sur une limite de cylindre, mais sur
tions, dont la onzième devrait être une partition entière le secteur 2 du premier cylindre. Les partitions com-
de `volume', alors que la neuvième devrait être un `entête mençant au cylindre 1 ne peuvent débuter sur une limite de
de volume'. L'entête de volume couvre également la table cylindre, mais cela ne pourrait causer des problèmes que
des partitions, çàd qu'elle débute au bloc zéro et s'étend si vous avez OS/2 sur votre machine.
par défaut sur 5 cylindres. L'espace restant dans
l'entête de volume peut être utilisé par des entrées de Un sync() et un ioctl() BLKRRPART (relire la table des
répertoires d'entête. Aucune partition ne peut empiéter partitions à partir du disque) sont exécutés avant la sor-
! !!
tie quand la table des partitions a été mise à jour. Il y beau programme qui a des exigences strictes sur les tables
a longtemps, il était nécessaire de redémarrer la machine de partitions qu'il accepte, et qui produit des tables de
après l'utilisation de fdisk. Je ne crois pas que cela partitions de haute qualité. A utiliser si vous le pou-
soit encore le cas - en effet, redémarrer trop rapidement vez. fdisk est un programme boggé qui fait des choses
peut causer la perte de données non encore écrites sur assez floues - d'habitude, il arrive à produire des résul-
disque. Notez qu'à la fois le noyau et le matériel disque tats raisonnables. Son seul avantage est qu'il permet le
peut mettre des données dans des tampons. support des labels de disque BSD, et d'autres tables de
partitions non DOS. A éviter si vous le pouvez. sfdisk
est destiné uniquement aux hackers - l'interface utilisa-
AVERTISSEMENT DOS 6.x teur est quelque peu rebutante, mais il travaille mieux
La commande DOS 6.x FORMAT recherche certaines informa- que fdisk et est plus puissant que fdisk et cfdisk. De
tions sur le premier secteur de la zône de données de la plus, il peut être utilisé de façon non interactive.)
partition, et suppose que cette information est plus
fiable que l'information contenue dans la table des parti- Le label de disque de type IRIX/SGI n'est pas supporté
tions. Le FORMAT de DOS suppose que FDISK (de DOS) efface actuellement par le noyau. De plus, les répertoires
les 512 premiers bytes de la zône de données de la parti- d'entête, IRIX/SGI ne sont pas encore entièrement sup-
tion chaque fois qu'un changement de taille se produit. portés.
FORMAT regardera cette information additionnelle même si
l'option /U est donnée -- nous considérons que c'est un Il manque l'option `écrire la table des partitions dans un
bogue dans FORMAT et FDISK de DOS. fichier'.

Si vous utilisez cfdisk ou fdisk pour modifier la taille TRADUCTION


d'une entrée de la table des partitions DOS, alors vous Frédéric Delanoy, 2000.
devez aussi utiliser dd pour mettre à zéro les 512 pre-
miers bytes de cette partition avant d'utiliser FORMAT de
DOS pour formater cette partition. Par exemple, si vous
avez utilisé cfdisk pour créer une entrée dans la table Linux 14 Août 2000 FDISK(8)
des partitions DOS pour /dev/hda1, alors (après la sortie
de fdisk ou de cfdisk et après avoir redémarré Linux pour
que les informations sur la table des partitions soient ! % ! %
valides) vous devriez utiliser la commande "dd
if=/dev/zero of=/dev/hda1 bs=512 count=1" pour mettre à
zéro les 512 premiers bytes de la partition.

SOYEZ EXTRÊMEMENT PRUDENT si vous utilisez la commande dd, NOM


car une petite faute de frappe peut rendre toutes les file - Déterminer le type d'un fichier.
données de votre disque inutilisables.
SYNOPSIS
Pour de meilleurs résultats, vous devriez toujours file [ -bcnsvzL ] [ -f nomfichier ] [ -m fichiersmagiques
utiliser un programme de partitionnement spécifique au ] fichier ...
système d'exploitation. Par exemple, vous devriez créer
des partitions DOS avec le programme FDISK DOS, et les DESCRIPTION
partitions Linux avec l'un des programmes Linux fdisk ou Cette page de manuel documente la version 3.27 de la com-
cfdisk. mande file. file teste chaque argument pour essayer de le
classifier. Il y a trois types de tests, effectués dans
cet ordre : tests de systèmes de fichiers, tests de nombre
OPTIONS magique, et tests de langage. Le premier test qui réussit
-v Afficher le numéro de version de fdisk et se ter- provoque l'affichage du type du fichier.
miner normalement.
Le type affiché contient en général l'un des mots text (le
-l Lister les tables de partitionspour les fichier ne contient que des caractères ASCII et peut prob-
périphériques spécifiés et ensuite se terminer. Si ablement être lu sur un terminal ASCII ), executable (le
aucun périphérique n'est fourni, ceux mentionnés fichier contient le résultat de la compilation d'un pro-
dans /proc/partitions (si ce fichier existe) sont gramme dans une forme compréhensible par
utilisés. certains noyaux Unix ou autres), ou data signifiant tout
le reste (les données, étant en général `binary', ç.à.d.
-u Pendant le listing des tables de partitions, donner binaires, ou `non-printable', ç.à.d. non affichables).
la taille en secteurs plutôt qu'en cylindres. Les exceptions sont les formats de fichiers bien connus
(fichiers cores, archives tar) dont on sait qu'ils conti-
-s partition ennent des données binaires. Quand vous modifiez le
La taille de la partition (en blocs) est affichée fichier /usr/share/magic ou le programme lui-même, con-
sur la sortie standard. servez ces mots-clés . Certains programmes se reposent
sur le fait que tous les fichiers accessibles en lecture
BOGUES dans un répertoire doivent être présetné sous le terme
Il existe plusieurs programmes *fdisk. Chacun a ses ``texte'' par file. Ne faites pas comme à Berkeley, en
points forts et ses points faibles. Essayez-les dans changeant ``shell commands text'' en ``shell script''.
l'ordre cfdisk, fdisk, sfdisk. (En effet, cfdisk est un
! !'
Les tests de systèmes de fichiers sont basés sur l'examen programmes qui veulent recevoir le type du fichier
de la sortie de l'appel-système stat(2). Le programme de sortie à travers un tube.
vérifie si le fichier est vide, ou s'il s'agit d'un cer-
tain type de fichier spéciaux. Tous les types de fichiers -v Afficher le numéro de version et se terminer nor-
connus appropriés présents sur votre système (sockets, malement.
liens symboliques ou tubes nommés (FIFOs) sur les systèmes
qui les implémentent) sont reconnus lorsqu'ils sont -z Essayer de regarder à l'intérieur des fichiers
définis dans le fichier d'entête du système sys/stat.h. compressés.

Les tests de nombres magiques sont utilisés pour vérifier -L suivre les liens symboliques, comme l'option du
des fichiers contenant des données dans des formats fixes même nom utilisée par ls(1). (sur les systèmes
particuliers. L'exemple type est un fichier binaire supportant les liens symboliques).
exécutable (programme compilé) a.out, dont le format est
défini dans a.out.h, et peut-être aussi dans exec.h dans -s Normalement, file n'essaie de lire et déterminer
le répertoire d'inclusion standard. Ces fichiers contien- que le type des fichiers présents comme arguments,
nent un ``nombre magique'' qui indique au système et que stat(2) rapporte en tant que fichiers ordi-
d'exploitation UNIX que le fichier est un binaire naires. Ceci peut éviter des problèmes, car la
exécutable, et qui donne le type précis parmi ces multi- lecture de fichiers spéciaux peut avoir des
ples types possibles. Le concept de ``nombre magique'' a conséquences bizarres. Fournir l'option -s indique
été appliqué par extension aux fichiers de données. Tout à file de lire également les fichiers arguments
fichier contenant un identificateur invariable a une place les fichiers arguments qui sont des fichiers
fixe dans le fichier peut d'habitude être décrit de cette blocs, ou des fichiers spéciaux de périphériques.
façon. L'information sur ces fichiers est lue à partir du C'est utile pour déterminer le type de systèmes de
fichier magique /usr/share/magic. fichiers des données situées dans des partitions
de disque brutes, ç.à.d. des fichiers spéciaux
Si un argument semble être un fichier ASCII, file essaie bloc. Cette option indique également à file de ne
de deviner le langage dans lequel il a été ecrit. Les pas accorder d'importance à la taille de fichier
tests de langage recherchent des chaînes de caractères indiquée par stat(2) puisque, sur certains
particulières (cf names.h) qui peuvent apparaître systèmes, il indique des tailles nulle pour des
n'importe où dans les premiers blocs d'un fichier. Par partitions de disque brutes.
exemple, le mot-clé .br indique que le fichier est proba-
blement un fichier d'entrée troff(1), comme le mot-clé FICHIERS
struct indique un programme C. Ces tests sont moins /usr/share/magic - liste des nombres magiques (par défaut)
fiables que les deux autres types de tests, et donc ils
sont pratiqués en dernier lieu. Les routines de tests de ENVIRONNEMENT
langage testent également quelques types divers (comme les La variable d'environnement MAGIC peut être utilisée pour
archives tar(1)), et déterminent si un fichier de type donner les noms des fichiers de nombres magiques utilisés
inconnu doit être étiqueté `ascii text' (texte ascii) ou par défaut.
`data' (données).
VOIR AUSSI
OPTIONS magic(4) - description du format du fichier magique.
-b Ne pas faire précéder les lignes de sortie par les strings(1), od(1), hexdump(1) - outils d'examen de
noms des fichiers (mode court). fichiers non-textes.

-c Afficher pour vérification l'analyse d'un fichier CONFORMITÉ


magique. Cette option est habituellement utilisée Ce programme est supposé outrepasser la définition de
en conjonction avec -m pour débogger un nouveau l'interface System V pour FILE(CMD), pour ce qu'on peut
fichier magique avant de l'installer. comprendre du langage vague qui y est utilisé. Son com-
portement est en grande partie compatible avec le pro-
-f nomfichier gramme System V du même nom. Cette version connaît cepen-
Lire les noms de fichiers à examiner à partir du dant plus de nombres magiques, et donc produira des sor-
fichier nomfichier (un par ligne) avant la liste ties différentes (même si plus précises) dans de nombreux
des arguments. Il doit y avoir au moins un nom- cas.
fichier ou un argument nom de fichier; pour tester
l'entrée standard, utilisez ``-'' comme argument La seule différence importante entre cette version et
nom de fichier. celle de System V est que cette version traite n'importe
quel espace blanc comme un délimiteur, de sorte que les
-m liste espaces dans les chaînes de caractères de motifs doivent
Indiquer une liste de fichiers de rechange con- être marqués par un caractère d'échappement. Par exemple,
tenant les nombres magiques. Cela peut être un >10 string language impress (données imPRESS)
seul fichier, ou une liste de fichiers séparés par d'un fichier magique existant devrait être changé en
des `:' >10 string language\ impress (données imPRESS)
en plus, dans cette version, si une chaîne de caractères
-n Forcer le vidage de la sortie standard après la de motif contient un backslash, il doit être marqué par un
vérification d'un fichier. Ce n'est utile que caractère d'échappement. Par exemple,
durant la vérification d'une liste de fichiers. 0 string \begindata document Andrew Toolkit
Cette option est prévue pour être utilisée par des d'un fichier magique existant devrait être changé en
!- !&
0 string \\begindata document Andrew Toolkit Modifié par Rob McMahon, cudcv@warwick.ac.uk, en 1989 pour
étendre l'opérateur `&' d'un simple `x&y != 0' à un `x&y
Les versions 3.2 et ultérieures de SunOS de Sun Microsys- op z'.
tems incluent une commande file(1) dérivée de celle de
System V, mais comprenant quelques extensions. Ma version Modifié par Guy Harris, guy@netapp.com, en 1993, pour :
ne diffère que peu de celle de Sun. Elle inclut l'exten-
sion de l'opérateur `&' utilisé, par exemple, dans remettre en place l'opérateur `&' "ancien style"
>16 long&0x7fffffff >0 not stripped dans son état original parce que 1) la modification
de Rob McMahon modifia l'ancien style d'utilisa-
RÉPERTOIRE MAGIQUE tion, parce que 2) l'opérateur `&' "nouveau style"
Les entrées du fichier magique ont été obtenues à partir de SunOS, que supporte cette version de file,
de sources variées, principalement via USENET, et ont reçu traite également `x&y op z', et parce que 3) la
une contribution de différents auteurs. Christos Zoulas modification de Rob n'était pas du tout documentée
(adresse en bas) collectera les entrées additionnelles ou ;
corrigées du fichier magique. Une mise à jour des entrées
du fichier magique sera distribuée périodiquement. ajouter des niveaux multiples de `>' ;

L'ordre des entrées présentes dans le fichier magique est ajouter les mots-clés ``beshort'', ``leshort'',
important. Selon le système que vous utilisez, l'ordre etc. pour regarder les nombres dans le fichier dans
dans lequel elles sont placées peut être incorrect. Si un ordre d'octets spécifique, plutôt que dans
votre ancienne commande file utilise un fichier magique, l'ordre natif des octets du programme exécutant
gardez l'ancien fichier magique pour pouvoir effectuer des file.
comparaisons (renommez-le en /usr/share/magic.orig).
Changements par Ian Darwin et par des auteurs variés,
EXEMPLES incluant Christos Zoulas (christos@astron.com), 1990-1999.
$ file file.c file /dev/hda
file.c: C program text NOTICE LEGALE
file: ELF 32-bit LSB executable, Intel 80386, version 1, Copyright (c) Ian F. Darwin, Toronto, Canada, 1986, 1987,
dynamically linked, not stripped 1988, 1989, 1990, 1991, 1992, 1993.
/dev/hda: block special
Ce logiciel n'est pas sujet et ne peut pas être rendu
$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10} sujet à n'importe quelle licence de la Compagnie
/dev/hda: x86 boot sector Américaine des Téléphones et Télégraphes (American Tele-
/dev/hda1: Linux/i386 ext2 filesystem phone and Telegraph Company), Sun Microsystems Inc., Digi-
/dev/hda2: x86 boot sector tal Equipment Inc., Lotus Development Inc., les régents de
/dev/hda3: x86 boot sector, extended partition table l'Université de Californie, le Consortium X ou le MIT, ou
/dev/hda4: Linux/i386 ext2 filesystem encore la Free Software Foundation.
/dev/hda5: Linux/i386 swap file
/dev/hda6: Linux/i386 swap file Ce logiciel n'est pas sujet à une restriction d'exporta-
/dev/hda7: Linux/i386 swap file tion du Département du Commerce des Etats-Unis, et peut
/dev/hda8: Linux/i386 swap file être exporté dans n'importe quel pays ou planète.
/dev/hda9: empty
/dev/hda10: empty L'autorisation est donnée à quiconque d'utiliser ce logi-
ciel dans n'importe quel but, et de le modifier et de le
HISTORIQUE distribuer librement, en respectant les restrictions suiv-
Il y a eu une commande file dans chaque UNIX depuis au antes :
moins la version de recherche 6 (page de manuel datée de
janvier 1975). La version de System V a introduit un 1. L'auteur n'est pas responsable des conséquences de
changement majeur : la liste externe des types de nombres l'utilisation de ce logiciel, quelles qu'elles soient,
magiques. Ceci a considérablement ralenti le programme même si elles se produisent à cause de défauts qui y sont
mais l'a rendu beaucoup plus flexible. présents.

Ce programme, basé sur la version System V, a été écrit 2. L'origine de ce logiciel ne doit pas être mal
par Ian Darwin sans jeter un coup d'oeil au code d'une représentée, que ce soit par revendication explicite ou
autre personne. par omission. Puisque peu d'utilisateurs lisent le code
source, les crédits doivent apparaître dans la documenta-
John Gilmore révisa largement le code, l'améliorant par tion.
rapport à la première version. Geoff Collyer trouva
plusieurs inadéquations, et fournit quelques entrées du 3. Les versions modifiées doivent être renseignées comme
fichier magique. Le programme a connu une évolution con- telles, et ne peuvent pas être présentées comme étant le
tinue depuis lors. logiciel original. Puisque peu d'utilisateurs lisent le
code source, les CREDITS doivent apparaître dans la docu-
AUTEUR mentation.
Ecrit par Ian F. Darwin, adresse UUCP {utzoo | ihnp4}!dar-
win!ian, adresse Internet ian@sq.com, adresse postale P.O. 4. Cette notice ne peut être modifiée ou altérée.
Box 603, Station F, Toronto, Ontario, CANADA M4Y 2L8.
Quelques fichiers de support (getopt, strtok) distribués
!0 *
avec ce paquetage sont sujets eux mêmes termes que ceux Ce programme est plus lent que les commandes file de cer-
présents ci-dessus. tains vendeurs de Unix.

Quelques simples fichiers de support (strtol, strchr) dis- Cette page de manuel, en particulier cette section, est
tibués avec ce paquetage sont dans le domaine public, et trop longue.
sont marqués comme tels.
DISPONIBILITÉ
Les fichiers tar.h et is_tar.c ont été écrits par John Vous pouvez obtenir la dernière version de l'auteur origi-
Gilmore pour son programme tar du domaine public, et ne nal par FTP anonyme sur ftp.astron.com dans le répertoire
sont pas couverts par les restrictions ci-dessus. /pub/file/file-X.YY.tar.gz

BOGUES TRADUCTION
Il y a sûrement une meilleure façon d'automatiser la con- Frédéric Delanoy, 2000.
struction du fichier Magique à partir du répertoire mag-
ique. Quelle est-elle ? Il vaudrais mieux compiler le
fichier magique en binaire (via, p.ex., ndbm(3) ou, mieux
encore, en chaînes de caractères ASCII de longueur fixe Linux 5 Septembre 2000 FILE(1)
pour une utilisation dans des environnements réseaux
hétérogènes) pour un démarrage plus rapide. Ensuite, le
programme tournerait aussi vite que la version 7 du pro-
gramme du même nom, avec la flexibilité de la version de ! # ! #
System V.

file utilise plusieurs algorithmes qui favorisent la


vitesse par rapport à la précision, et donc il peut se
tromper sur le contenu des fichiers ASCII. NOM
find - Rechercher des fichiers dans une hiérarchie de
Le support des fichiers ASCII (principalement pour les répertoires.
langages de programmation) est simpliste, inefficace, et
requiert une recompilation pour une mise à jour. SYNOPSIS
find [chemin...] [expression]
Il devrait avoir une clause ``else'' pour suivre une
série de lignes de continuation. DESCRIPTION
Cette page de manuel documente la version GNU de find.
Le fichier magique et les mots-clés devraient avoir le
support des expressions régulières. Son utilisation des find parcourt les arborescences de répertoires commençant
tabulations ASCII comme un délimiteur de champ est horri- en chacun des chemins mentionnés, en évaluant les expres-
ble et rend difficile l'édition des fichiers. sions fournies pour chaque fichier rencontré.

Il serait souhaitable de permettre les lettres majuscules L'évaluation de l'expression se fait de gauche à droite,
dans les mots-clés pour différencier, par exemple, les en suivant des règles de précédence décrite dans la sec-
commandes troff(1) des macros des pages de manuel. L'util- tion OPÉRATEURS, jusqu'à ce que le résultat soit connu
isation d'expressions régulières devrait rendre cela (par exemple la partie gauche vraie pour un opérateur OU
facile. ou fausse pour un opérateur ET).

Le programme ne reconnaît pas FORTRAN. Il devrait être Le premier argument commençant par `-', `(', `)', `,', ou
capable de le faire en recherchant quelques mots-clés qui `!' est considéré comme le début de l'expression, tous
apparaîssent indentés par rapport au début de la ligne. Le les arguments précédents sont des chemins à parcourir.
support des expressions régulières devrait rendre cela
facile. Tous les arguments ultérieurs sont considérés comme le
reste de l'expression régulière.
La liste de mots-clés de ascmagic appartient probablement
au fichier Magique. Ceci pourrait être fait en utilisant Si aucun chemin n'est mentionné, le répertoire en cours
un mot-clé comme `*' pour la valeur de déplacement. sert de point de départ.

Une autre optimisation pourrait être de réordonner le Si aucune expression n'est fournie, find utilise l'expres-
fichier magique de sorte que l'on puisse passer les tests sion `-print' par défaut.
pour le premier octet, le premier mot, etc., une fois
qu'on l'a trouvé. Se plaindre des conflits dans les find se termine avec le code de retour 0 si tous les
entrées du fichier magique. Eventuellement créer une règle fichiers ont pu être examinés correctement, et supérieur à
de sorte que les entrées soient triées sur base du 0 si une erreur s'est produite.
déplacement par rapport au début du fichier plutôt que sur
la position à l'intérieur du fichier magique. EXPRESSIONS
L'expression est constituée d'options (affectant l'ensem-
Le programme devrait fournir un moyen d'estimer le degré ble des opérations plutôt que le traitement d'un fichier
d'exactitude d'une supposition. particulier, et renvoyant toujours vrai), de tests (ren-
voyant une valeur vraie ou fausse), et d'actions (ayant
des effets de bords et renvoyant une valeur vraie ou toire, il sait qu'il y a 2 fois moins de sous-
fausse), tous ces éléments étant séparés par des répertoires que de liens vers le répertoire. Une
opérateurs. fois qu'il a rencontré le nombre prévu de sous-
répertoires, il est donc sûr que le reste des
Quand un opérateur est manquant, l'opération par défaut entrées est constitué de fichiers autres que des
-and est appliquée. Si l'expression ne contient pas sous-répertoires. Ces fichiers sont des feuilles
d'action autre que -prune, find applique l'action -print ([NDT] `leaf') dans l'arborescence des répertoires.
par défaut sur tous les fichiers pour lesquels l'expres- S'il n'y a que les noms de fichiers à examiner, il
sion est vraie. n'a plus besoin de vérifier leur nature, et ceci
fournit une augmentation notable de la vitesse de
OPTIONS traitement.
Toutes les options renvoient toujours la valeur vraie.
Elles ont toujours un effet global, plutôt que de s'appli- -version, --version
quer uniquement à leur emplacement dans l'expression. Afficher un numéro de version sur la sortie stan-
Néanmoins, pour améliorer la lisibilité, il est préférable dard et terminer normalement.
de les placer au début de l'expression.
-xdev Ne pas parcourir les répertoires situés sur
-daystart d'autres systèmes de fichiers.
Mesurer les temps (avec -amin, -atime, -cmin,
-ctime, -mmin, et -mtime) depuis le début de la TESTS
journée plutot que depuis 24 heures. Les arguments numériques peuvent être indiqués comme suit:

-depth Traiter d'abord les sous-répertoires avant le +n supérieur à n,


répertoire lui-même.
-n inférieur à n,
-follow
Déréférencer les liens symboliques pour accéder aux n égal à n.
fichiers vers lesquels ils pointent. Ceci implique
l'option -noleaf. -amin n
dernier accès au fichier il y a n minutes.
-help, --help
Afficher un message d'aide sur la sortie standard -anewer file
et terminer normalement. dernier accès au fichier plus récent que la
dernière modification de file. Le comportement de
-maxdepth n l'option -anewer est modifié par l'option -follow
Descendre au plus n niveaux (n étant un entier uniquement si celle-ci la précède sur la ligne de
positif ou nul), dans les répertoires parcourus. commande.
`-maxdepth 0' signifie que les tests et les actions
ne s'appliquent qu'aux arguments de la ligne de -atime n
commande. dernier accès au fichier il y a n*24 heures.

-mindepth n -cmin n
Ne pas appliquer les tests ou les actions à des dernière modification du statut du fichier il y a n
niveaux de profondeur inférieurs à n. n est un minutes.
entier positif ou nul. `-mindepth 1' signifie que
les tests et les actions s'appliquent à tous les -cnewer file
fichiers sauf aux arguments de la ligne de com- dernière modification du statut du fichier plus
mande. récente que la dernière modification du fichier
file. Le comportement de l'option -cnewer est mod-
-mount Ne pas parcourir les répertoires situés sur ifié par l'option -follow uniquement si celle-ci la
d'autres systèmes de fichiers. Il s'agit d'une précède sur la ligne de commande.
alternative à l'option -xdev, assurant la compati-
bilité avec d'anciennes versions de find. -ctime n
dernière modification du statut du fichier il y a
-noleaf n*24 heures.
Ne pas faire d'optimisation en supposant que les
répertoires contiennent 2 fois moins de sous-réper- -empty fichier vide. De plus ce fichier doit être régulier
toires que leurs nombres de liens physiques. Cette ou être un répertoire.
option est nécéssaires lorsque l'on parcourt des
systèmes de fichiers ne suivant pas les conventions -false toujours faux.
Unix sur les liens de répertoires, comme les
systèmes MS-DOS, les CD-ROM ou les points de mon- -fstype type
tage de volumes AFS. Chaque répertoire sur un fichier se trouvant sur un système de fichiers du
système de fichiers Unix dispose au moins de deux type indiqué. Les types de systèmes de fichiers
liens physiques, son nom et `.'. De plus chaque dépendent de la version d'Unix. Une liste non-
sous-répertoire a également un lien `..' vers le exhaustive des systèmes acceptés sur certaines ver-
répertoire parent. Quand find examine un réper- sions d'Unix sont : ufs, 4.2, 4.3, nfs, tmp, mfs,
!
S51K, S52K. Vous pouvez utiliser -printf avec la Fichier dont l'U-ID numérique ne correspond à aucun
directive %F pour examiner les types de vos utilisateur.
systèmes de fichiers.
-nogroup
-gid n Fichier de GID numérique valant n. Fichier dont le G-ID numérique ne correspond à
aucun groupe d'utilisateurs.
-group nom_groupe
fichier appartenant au groupe nom_groupe -path motif
(éventuellement ID numérique). Fichier dont le nom complet correspond au motif
fourni. Lors du développement des méta-caractères,
-ilname motif `/' et `.' ne sont pas traités différement des
identique à -lname, mais sans différencier les autres caractères, ainsi par exemple :
majuscules et les minuscules. find . -path './sr*sc'
affichera l'élément de répertoire intitulé
-iname pattern './src/misc' (s'il en existe un). Pour ignorer une
identique à -name, mais sans différencier les arborescence complète de répertoires, utilisez
majuscules et les minuscules. Par exemple les l'option -prune plutôt que de vérifier chaque
motifs `fo*' et `F??' correspondent aux noms de fichier de l'arbre. Par exemple, pour ignorer le
fichiers `Foo', `FOO', `foo', `fOo', etc... répertoire `src/emacs' et tous ses sous-réper-
toires, tout en affichant le nom de tous les autres
-inum n fichiers, faites quelque chose comme :
fichier dont le numéro d'i-noeud est n. find . -path './src/emacs' -prune -o
-print
-ipath motif
identique à -path, mais sans différencier les -perm mode
majuscules et les minuscules. Fichier dont les autorisations d'accès sont fixées
exactement au mode indiqué (en notation symbolique
-iregex motif ou octale). La notation symbolique utilise le mode
identique à -regex, mais sans différencier les 0 comme point de départ.
majuscules et les minuscules.
-perm -mode
-links n Fichier ayant au moins toutes les autorisations
fichier ayant n liens. indiquées dans le mode.

-lname motif -perm +mode


fichier répresentant un lien symbolique, dont le Fichier ayant certaines des autorisations indiquées
contenu correspond au motif indiqué. Lors du dans le mode.
développement des méta-caractères, `/' et `.' ne
sont pas traités différement des autres caractères -regex motif
(voir l'exemple dans la description de l'option Nom de fichier correspondant à l'expression
-path). régulière motif. Il s'agit d'une correspondance
sur le nom de fichier complet, pas d'une recherche.
-mmin n Par exemple, pour mettre en correspondance un
Fichier dont les données ont été modifiées il y a n fichier nommé `./fubar3', vous pouvez utiliser les
minutes. expressions régulières `.*bar.' ou `.*b.*3', mais
pas `b.*r3'.
-mtime n
Fichier dont les données ont été modifiées il y a -size n[bckw]
n*24 heures. Fichier utilisant n unités d'espace. Les unités
sont des blocs de 512 octets par défaut (ou si un
-name motif suffixe `b' suit le nombre n), des octets si un
Fichier dont le nom de base (sans les répertoires suffixe `c' suit n, des kilo-octets si un suffixe
du chemin d'accès), correspond au motif du shell. `k' est utilisé, ou des mots de 2 octets si un `w'
Les méta-caractères (`*', `?', et `[]') ne sont suit le nombre n. La taille ne prend pas en compte
jamais mis en correspondance avec un point `.' au les blocs indirects, mais elle comptabilise les
début du nom. Pour ignorer un répertoire, ainsi blocs des fichiers éparpillés pas encore alloués.
que tous ses sous-répertoires, utiliser l'option
-prune; vous trouverez un exemple dans la descrip- -true Toujours vrai.
tion de l'option -path.
-type c
-newer fichier Fichier du type c:
Fichier modifié plus récemment que le fichier
indiqué. L'option -newer n'est affectée par b fichier spécial en mode bloc (avec buffer)
l'option -follow que si celle-ci la précède sur la
ligne de commande. c fichier spécial en mode caractère (sans
buffer)
-nouser
'
d répertoire
-ok commande ;
p tube nommé (FIFO) comme -exec mais interroge d'abord l'utilisateur
(en utilisant l'entrée standard). Si la réponse ne
f fichier régulier commence pas par `y' ou `Y', la commande n'est pas
exécutée, et le test devient faux.
l liens symbolique
-print vrai; affiche le nom complet du fichier sur la sor-
s socket tie standard, suivi d'un saut de ligne.

-uid n Fichier dont l'U-ID numérique vaut n. -print0


vrai; affiche le nom complet du fichier sur la sor-
-used n tie standard, suivi d'un caractère nul. Ceci permet
fichier dont le dernier accès date de n jours après aux fichiers dont le nom contient un saut de ligne,
la dernière modification de son statut. d'être correctement interprétés par les programmes
utilisant les données en sortie de find.
-user utilisateur
fichier appartenant à l'utilisateur indiqué (U-ID -printf format
numérique éventuellement) vrai; affiche le format indiqué sur la sortie stan-
dard, en interprétant les séquences d'échappement
-xtype c `\' et les directives`%'. La largeur et la
comme -type sauf si le fichier est un lien symbol- précision des champs peuvent être spécifiés comme
ique. Dans ce cas, si l'option -follow n'a pas été dans la fonction printf(3) du langage C. Con-
fournie, le test est vrai si le fichier destination trairement à -print, -printf n'ajoute pas de saut
du lien est de type c; Si l'option -follow a été de ligne à la fin de la chaîne. Les séquences
réclamée, le test est vrai si c vaut `l'. d'échappement et les directives % sont les suiv-
Autrement dit, pour les liens symboliques, -xtype antes :
vérifie le type des fichiers que l'option -type ne
vérifie pas. \a Sonnerie.

ACTIONS \b Effacement Arrière (Backspace)


-exec commande ;
Exécute la commande; vrai si le code de retour 0 \c Arrêter immédiatement l'impression du format
est renvoyé. Tous les arguments suivants de find et vider le flux de sortie.
sont considérés comme des arguments pour la ligne
de commande, jusqu'à ce qu'on rencontre un `;'. La \f Saut de page
chaîne `{}' est remplacée par le nom du fichier en
cours de traitement, et ceci dans toutes ses \n Saut de ligne
occurences, pas seulement aux endroits où elle est
isolée, comme c'est le cas avec d'autres versions \r Retour Chariot
de find. Ces deux chaînes peuvent avoir besoin
d'être protégées du développement de la ligne de \t Tabulation horizontale
commande par le shell, en utilisant le caractère
d'échappement (`\') ou une protection par des apos- \v Tabulation Verticale
trophes. La commande est exécutée depuis le réper-
toire de départ. \\ Un caractère `Backslash' littéral (`\').

-fls fichier Un `\' suivi de n'importe quel autre caractère est


vrai; comme -ls mais écrit dans le fichier comme le traité comme un caractère ordinaire; ils sont donc
fait -fprint. affichés tous les deux.

-fprint fichier %% Un caractère pourcentage littéral (%)


vrai; écrit le nom complet dans le fichier. Si
fichier n'existe pas au démarrage de find, il est %a Date du dernier accès au fichier, dans le
créé. S'il existe, il est écrasé. Les noms de format renvoyé par la fonction C ctime(3).
fichiers ``/dev/stdout'' et ``/dev/stderr'' sont
traités de manière spécifique, ils correspondent %Ak Date du dernier accès au fichier, dans le
respectivement à la sortie standard, et à la sortie format spécifié par k, qui doit être soit un
des erreurs. `@', soit une directive pour la fonction C
strftime(3). Les valeurs possibles pour k
-fprint0 fichier sont indiquées ci-dessous, certaines
vrai; comme -print0 mais écrit dans le fichier d'entre-elles ne sont pas disponibles sur
comme le fait -fprint. tous les systèmes, à cause des différences
entre les fonctions strftime(3) existantes.
-fprintf fichier format
vrai; comme -printf mais écrit dans le fichier @ secondes écoulées depuis le 1er Jan-
comme le fait -fprint. vier 1970 à 00h 00 GMT.
- &
W numéro de la semaine dans l'année,
Champs horaires : les semaines commençant le Lundi
(00..53)
H heure (00..23)
x représentation locale de la date
I heure (01..12) (mm/jj/aa)

k heure ( 0..23) y les deux dernier chiffres de l'année


(00..99)
l heure ( 1..12)
Y année (1970...)
M minute (00..59)
%b Taille du fichier en nombre de blocs de 512
p AM, ou PM, avec la désignation octets (arrondi par excès).
locale
%c Date de dernière modification du statut du
r heure, sur un cadran de 12 heures fichier, dans le format renvoyé par la fonc-
(hh:mm:ss [AP]M) tion C ctime(3).

S secondes (00..61) %Ck Date de dernière modification du statut du


fichier, dans le format spécifié par k,
T heure, sur un cadran de 24 heures comme pour la directive %A.
(hh:mm:ss)
%d Profondeur du fichier dans l'arborescence
X représentation locale de l'heure des répertoires, 0 signifiant que le fichier
(H:M:S) est un argument de la ligne de commande.

Z fuseau horaire (par exemple MET), ou %f Nom du fichier, sans nom de répertoire.
rien si le fuseau horaire est
indéterminé. %F Type de système de fichiers sur lequel se
trouve le fichier. Cette valeur peut être
Champs de date : utilisée pour l'option -fstype.

a abréviation locale du jour de la %g Nom du groupe propriétaire du fichier, ou G-


semaine (Dim .. Sam) ID numérique si le groupe n'a pas de nom.

A nom local entier du jour de la %G G-ID numérique du fichier.


semaine, de longueur variable
(Dimanche .. Samedi) %h Répertoires en tête du nom de fichier, (tout
sauf le dernier nom).
b abréviation locale du mois
(Jan..Dec) %H Argument de la ligne de commande à partir
duquel le fichier a été trouvé.
B nom local entier du mois, de
longueur variable (Janvier .. Décem- %i Numero d'i-noeud du fichier (en décimal).
bre)
%k Taille du fichier, en nombre de blocs de 1
c date et heure locales (Sam Nov 04 Kilo-Octet, arrondi par excès.
12:02:33 EST 1989)
%l Destination du lien symbolique (vide si le
d quantième du mois (01..31) fichier n'est pas un lien symbolique).

D date (mm/jj/aa) %m Bits d'autorisation d'accès au fichier (en


octal).
h comme b
%n Nombre de liens physiques sur le fichier.
j jour de l'année (001..366)
%p Nom du fichier.
m mois (01..12)
%P Nom du fichier, ainsi que le nom de l'argu-
U numéro de la semaine dans l'année, ment de ligne de commande à partir duquel le
les semaines commençant le Dimanche fichier a été trouvé.
(00..53)
%s Taille du fichier en octets.
w jour de la semaine (0..6), 0 corre-
spond à Dimanche %t Date de dernière modification du fichier,
dans le format renvoyé par la fonction C
0 '*
ctime(3).
FSF 15 Janvier 1997 FIND(1L)
%Tk Date de dernière modification du fichier,
dans le format spécifié par k, comme pour la
directive %A.

%u Nom du propriétaire du fichier, ou U-ID


! % , - ' . ! %
numérique si l'utilisateur n'a pas de nom.

%U U-ID numérique du proprietaire du fichier.


NOM
Un caractère `%' suivi de tout autre caractère est finger - Rechercher des informations sur un utilisateur.
éliminé (mais le second caractère est affiché).
SYNOPSIS
-prune vrai si l'option -depth n'est pas fournie; ne pas finger [-lmsp] [user ...] [user@host ...]
descendre dans l'arborescence du répertoire en
cours. DESCRIPTION
faux si l'option -depth est fournie, et sans effet. finger affiche des informations sur les utilisateurs.

-ls vrai, affiche le nom du fichier en cours dans le Options:


format `ls -dils' sur la sortie standard. La
taille est comptée en blocs de 1 Ko, à moins que la
variable d'environnement POSIXLY_CORRECT soit posi- -s Finger affiche le nom de login, le nom réel, le
tionnée, auquel cas la taille est calculée en blocs terminal et l'autorisation d'écriture (``*'' signi-
de 512 octets. fie que l'écriture sur le terminal est interdite),
le temps d'inactivité, la date de login, l'adresse
OPERATEURS et le numéro de téléphone de travail.
Dans l'ordre de précédence décroissante :
La date de login est affichée sous la forme mois,
( expr ) jour, heure, minutes, à moins qu'elle ne remonte à
Force la précédence. plus de six mois, auquel cas l'année est affichée à
la place de l'heure et des minutes.
! expr Vrai si expr est fausse.
Si le terminal, le temps d'inactivité ou la date de
-not expr login sont inconnus ou indisponibles, ils sont rem-
Comme ! expr. placés par des astérisques.

expr1 expr2 -l produit un affichage multi-lignes contenant toutes


ET (implicite); expr2 n'est pas évaluée si expr1 les informations de l'option -s avec en plus le
est fausse. répertoire de démarrage de l'utilisateur, son
numéro de téléphone personnel, l'état de sa boîte
expr1 -a expr2 aux lettres, et le contenu des fichiers ".plan",
Comme expr1 expr2. ".project" et ".forward" de son répertoire de
démarrage.
expr1 -and expr2
Comme expr1 expr2. Les numéros de téléphone à onze chiffres sont
affichés sous la forme ``+N-NNN-NNN-NNNN''. Les
expr1 -o expr2 numéros à dix ou sept chiffres sont affichés comme
OU; expr2 n'est pas évaluée si expr1 est vraie. des numéros à onze chiffres tronqués. Les numéros
à cinq chiffres sont affichés sous la forme ``xN-
expr1 -or expr2 NNNN''. Les numéros à quatre chiffres sont
Comme expr1 -o expr2. affichés sous la forme ``xNNNN''.

expr1 , expr2 Si l'écriture sur le terminal est interdite, le


Liste; expr1 et expr2 sont toujours évaluées toutes texte ``(messages off)'' est ajouté à la ligne con-
les deux. La valeur de expr1 est ignorée; la tenant le numéro du terminal. Avec l'option -l,
valeur de la liste est celle de expr2. chaque utilisateur est affiché séparément; si un
même utilisateur est connecté plusieurs fois, tous
VOIR AUSSI les terminaux associés sont affichés en bloc.
locate(1L), locatedb(5L), updatedb(1L), xargs(1L) Finding
Files (en-ligne dans Info, ou en version imprimée) L'état de la boîte aux lettres est affiché sous la
forme ``No Mail.'' si elle est vide, ``Mail last
read DDD MMM ## HH:MM YYYY (TZ)'' si l'utilisateur
TRADUCTION a consulté sa boîte aux lettres depuis la dernière
Christophe Blaess, 1997. arrivée de courrier, ou ``New mail received ...'',
`` Unread since ...'' s'il est arrivé du courrier
depuis la dernière consultation.

' '
0 - No errors
-p supprime l'affichage des fichiers ".plan" et ".pro- 1 - File system errors corrected
ject". 2 - System should be rebooted
4 - File system errors left uncorrected
-m désactive la recherche automatique des noms 8 - Operational error
d'utilisateur. User est généralement un nom de 16 - Usage or syntax error
login; cependant la recherche s'effectue aussi sur 128 - Shared library error
le nom réel si l'on ne spécifie pas l'option -m. The exit code returned when all file systems are checked
La recherche s'effectue sans differencier les using the -A option is the bit-wise OR of the exit codes
majuscules et les minuscules. for each file system that is checked.

Sans options, finger utilise le style d'affichage corre- In actuality, fsck is simply a front-end for the various
spondant à -l s'il y a des opérandes, et -s sinon. Noter file system checkers (fsck.fstype) available under Linux.
que dans les deux formats certains champs peuvent manquer The file system-specific checker is searched for in /sbin
si l'information correspondante n'est pas disponible. first, then in /etc/fs and /etc, and finally in the direc-
tories listed in the PATH environment variable. Please
Sans argument, finger affiche les informations concernant see the file system-specific checker manual pages for fur-
tous les utilisateurs actuellement connectés. ther details.

Finger peut être utilisé pour chercher des utilisateurs OPTIONS


sur une machine distante. Ces utilisateurs sont spécifiés -s Serialize fsck operations. This is a good idea if
sous la forme user@host ou @host, le format d'affichage you checking multiple filesystems and the checkers
par défaut est -l dans le premier cas et -s dans le sec- are in an interactive mode. (Note: e2fsck(8) runs
ond. L'option -l est la seule qui peut être transmise à in an interactive mode by default. To make
une machine distante. e2fsck(8) run in a non-interactive mode, you must
either specify the -p or -a option, if you wish for
VOIR AUSSI errors to be corrected automatically, or the -n
chfn(1), passwd(1), w(1), who(1). option if you do not.)

HISTORIQUE -t fslist
La commande finger est apparue dans BSD 3.0. Specifies the type(s) of file system to be checked.
When the -A flag is specified, only filesystems
that match fslist are checked. The fslist parame-
ter is a comma-separated list of filesystems and
TRADUCTION options specifiers. All of the filesystems in this
Michel Quercia, 1997. comma-separated list may be prefixed by a negation
operator 'no' or '!', which requests that only
those filesystems not listed in fslist will be
checked. If all of the filesystems in fslist are
BSD Expérimental 24 Mai 1997 FINGER(1) not prefixed by a negation operator, then only
those filesystems listed in fslist will be checked.

Options specifiers may be included in the comma


!( " !( " separated fslist. They must have the format
opts=fs-option, and may be prefixed by a negation
operator. If an options specifier is present, then
only filesystems whose /etc/fstab entry do (or do
not, if the options specifier was prefixed by a
NAME negation operator) contain fs-option in their
fsck - check and repair a Linux file system options field of the /etc/fstab file will be
checked.
SYNOPSIS
fsck [ -sACVRTNP ] [ -t fstype ] filesys [ ... ] [--] [ For compatibility with Mandrake distributions whose
fsck-options ] boot scripts depend upon an unauthorized UI change
to the fsck program, if a filesystem type of loop
DESCRIPTION is found in fslist, it is treated as if opts=loop
fsck is used to check and optionally repair a one or more were specified as an argument to the -t option.
Linux file systems. filesys can be a device name (e.g.
/dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, Normally, the filesystem type is deduced by search-
/home), or an ext2 label or UUID specifier (e.g. ing for filesys in the /etc/fstab file and using
UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). the corresponding entry. If the type can not be
The fsck program will try to run filesystems on different deduced, and there is only a single filesystem
physical disk drives in parallel to reduce total amount given as an argument to the -t option, fsck will
time to check all of the filesystems. use the specified filesystem type. If this type is
not available, then the default file system type
The exit code returned by fsck is the sum of the following (currently ext2) is used.
conditions:

' '!
-A Walk through the /etc/fstab file and try to check Options and arguments which follow the -- are
all file systems in one run. This option is typi- treated as file system-specific options to be
cally used from the /etc/rc system initalization passed to the file system-specific checker.
file, instead of multiple commands for checking a
single file system. Please note that fsck is not designed to pass arbi-
trarily complicated options to filesystem-specific
The root filesystem will be checked first unless checkers. If you're doing something complicated,
the -P option is specified (see below). After please just execute the filesystem-specific checker
that, filesystems will be checked in the order directly. If you pass fsck some horribly compli-
specified by the fs_passno (the sixth) field in the cated option and arguments, and it doesn't do what
/etc/fstab file. Filesystems with a fs_passno you expect, don't bother reporting it as a bug.
value of 0 are skipped and are not checked at all. You're almost certainly doing something that you
Filesystems with a fs_passno value of greater than shouldn't be doing with fsck.
zero will be checked in order, with filesystems
with filesystems with the lowest fs_passno number Currently, standardized file system-specific options are
being checked first. If there are multiple somewhat in flux. Although not guaranteed, the following
filesystems with the same pass number, fsck will options are supported by most file system checkers:
attempt to check them in parallel, although it will
avoid running multiple filesystem checks on the -a Automatically repair the file system without any
same physical disk. questions (use this option with caution). Note
that e2fsck(8) supports -a for backwards compati-
Hence, a very common configuration in /etc/fstab bility only. This option is mapped to e2fsck's -p
files is to set the root filesystem to have a option which is safe to use, unlike the -a option
fs_passno value of 1 and to set all filesystems to that most file system checkers support.
have a fs_passno value of 2. This will allow fsck
to automatically run filesystem checkers in paral- -r Interactively repair the filesystem (ask for con-
lel if it is advantageous to do so. System admin- firmations). Note: It is generally a bad idea to
istrators might choose not to use this configura- use this option if multiple fsck's are being run in
tion if they need to avoid multiple filesystem parallel. Also note that this is e2fsck's default
checks running in parallel for some reason --- for behavior; it supports this option for backwards
example, if the machine in question is short on compatibility reasons only.
memory so that excessive paging is a concern.
AUTHOR
-C Display completion/progress bars for those filesys- Theodore Ts'o (tytso@mit.edu)
tems checkers (currently only for ext2) which sup-
port them. Fsck will manage the filesystem check- FILES
ers so that only one of them will display a /etc/fstab.
progress bar at a time.
ENVIRONMENT VARIABLES
-N Don't execute, just show what would be done. The fsck program's behavior is affected by the following
environment variables:
-P When the -A flag is set, check the root filesystem
in parallel with the other filesystems. This is FSCK_FORCE_ALL_PARALLEL
not the safest thing in the world to do, since if If this environment variable is set, fsck will
the root filesystem is in doubt things like the attempt to run all of the specified filesystems in
e2fsck(8) executable might be corrupted! This parallel, regardless of whether the filesystems
option is mainly provided for those sysadmins who appear to be on the same device. (This is useful
don't want to repartition the root filesystem to be for RAID systems or high-end storage systems such
small and compact (which is really the right solu- as those sold by companies such as IBM or EMC.)
tion).
FSCK_MAX_INST
-R When checking all file systems with the -A flag, This environment variable will limit the maximum
skip the root file system (in case it's already number of file system checkers that can be running
mounted read-write). at one time. This allows configurations which have
a large number of disks to avoid fsck starting too
-T Don't show the title on startup. many file system checkers at once, which might
overload CPU and memory resources available on the
-V Produce verbose output, including all file system- system. If this value is zero, then an unlimited
specific commands that are executed. number of processes can be spawned. This is cur-
rently the default, but future versions of fsck may
fsck-options attempt to automatically determine how many file
Options which which are not understood by fsck are system checks can be run based on gathering
passed to the filesystem-specific checker. These accounting data from the operating system.
arguments must not take arguments, as there is no
way for fsck to be able to properly guess which PATH The PATH environment variable is used to find file
arguments take options and which don't. system checkers. A set of system directories are
searched first: /sbin, /sbin/fs.d, /sbin/fs,
' ''
/etc/fs, and /etc. Then the set of directories -A num Afficher num lignes supplémentaires après la ligne
found in the PATH environment are searched. correspondante.
-B num Afficher num lignes supplémentaires avant la ligne
FSTAB_FILE correspondante.
This environment variable allows the system admin- -C est équivalent à -2.
istrator to override the standard location of the -V Afficher le numéro de version de grep sur la sortie
/etc/fstab file. It is also use for developers who d'erreur standard. Ce numéro de version devra être
are testing fsck. inclus dans tous les rapports de bugs (voir plus
bas).
SEE ALSO -b Avant chaque ligne, afficher son décalage (en
fstab(5), mkfs(8), fsck.minix(8), fsck.ext2(8) or octet) au sein du fichier d'entrée.
e2fsck(8), fsck.xiafs(8). -c Ne pas afficher les résultats normaux. A la place,
afficher un compte des lignes correspondantes pour
chaque fichier d'entrée. Avec l'option -v (voir
plus bas), afficher les nombres de lignes ne corre-
E2fsprogs version 1.27 March 2002 FSCK(8) spondant pas au motif.
-e motif
Utiliser le motif indiqué. Ceci permet de protéger
les motifs commençant par -.
-f fichier
Lire le motif dans le fichier indiqué.
% % -h Ne pas afficher le nom des fichiers dans les résul-
tats lorsque plusieurs fichiers sont parcourus.
-i Ignorer les différences majuscules/minuscules aussi
bien dans le motif que dans les fichiers d'entrée.
([NDT] Comme toujours, ceci ne fonctionne pas avec
NOM les caractères accentués...)
grep, egrep, fgrep - Afficher les lignes correspondant à -L Ne pas afficher les résultats normaux. A la place,
un motif donné. indiquer le nom des fichiers pour lesquels aucun
résultat n'aurait été affiché.
SYNOPSIS -l Ne pas afficher les résultats normaux. A la place,
grep [ -[[AB] ]num ] [ -[CEFGVBchilnsvwx] ] [ -e ] motif | indiquer le nom des fichiers pour lesquels des
-ffichier ] [ fichiers... ] résultats auraient été affiches.
-n Ajouter à chaque ligne de sortie un préfixe con-
DESCRIPTION tenant son numéro dans le fichier d'entrée.
Grep Recherche dans les fichiers d'entrée indiqués les -q Silence. Ne pas afficher les résultats normaux.
lignes correspondant à un certain motif. -s Ne pas afficher les messages d'erreurs concernant
les fichiers inexistants ou illisibles.
Si aucun fichier n'est fourni, ou si le nom `-' est men- -v Inverser la mise en correspondance, pour sélection-
tionné, la lecture se fait depuis l'entrée standard. ner les lignes ne correspondant pas au motif.
-w Ne sélectionner que les lignes contenant une corre-
Par défaut, grep affiche les lignes correspondant au spondance formant un mot complet. La sous-chaîne
motif. correspondante doit donc être soit au début de la
ligne, soit précédée d'un caractère n'appartenant
Il existe trois variantes principales de grep, controlées pas à un mot. De même elle doit se trouver soit à
par les options suivantes. la fin de la ligne, soit être suivie par un car-
actère n'appartenant pas à un mot. Les caractères
-G Interprète le motif comme une expression régulière composants les mots sont les lettres, les chiffres
simple (voir plus bas). C'est le comportement par et le souligné (`_'). ([NDT] Bien entendu les
défaut. minuscules accentuées ne sont pas des lettres !
-E Interprète le motif comme une expression régulière elles servent donc à séparer les mots...)
étendue (voir plus bas). -x Ne sélectionner que les correspondances qui occu-
-F Interprète le motif comme une liste de chaînes pent une ligne entière.
figées, séparées par des Sauts de Lignes (NewLine).
La correspondance est faite avec n'importe laquelle EXPRESSIONS RÉGULIÈRES
de ces chaînes. Une expression régulière est un motif qui permet de
décrire un ensemble de chaînes. Les expressions régulières
De plus, il existe deux variantes du programme : egrep et sont construites comme des opérations arithmétiques, en
fgrep. Egrep est similaire (sans être identique) à utilisant des opérateurs divers pour combiner des expres-
grep -E, et est compatible avec les versions UNIX his- sions plus petites.
toriques de egrep. Fgrep est identique à grep -F.
Grep comprend deux versions différentes pour la syntaxe
Toutes les variantes de grep acceptent les options suiv- des expressions régulières : ``simple'' et ``étendue.''
antes : Dans la version GNU de grep, il n'y a pas de différence
-num Les correspondances seront affichées avec num dans les fonctionnalités disponibles en utilisant l'une ou
lignes supplémentaires avant et après. Néanmoins, l'autre des syntaxes. Dans d'autres implémentations, les
grep n'affichera jamais une ligne plus d'une fois. expressions régulières simples sont moins puissantes. La
'- '&
description ci-dessous correspond aux expressions éten- {,m} L'élément précédent est facultatif et doit être mis
dues, les différences avec les expressions simples étant en correspondance m fois au plus.
résumées ensuite. {n,m} L'élément précédent doit être mis en correspondance
au moins n fois, mais au plus m fois.
Les briques élémentaires sont les expressions régulières
correspondant à un simple caractère. La plupart des car- Deux expressions régulières peuvent être juxtaposées,
actères, y compris toutes les lettres et les chiffres, l'expression en résultant correspondra à toute chaîne
sont des expressions régulières se correspondant à eux- formée par la juxtaposition de deux sous-chaînes corre-
mêmes. Tout méta-caractère ayant une signification spondant respectivement aux deux sous-expression.
spéciale doit être protégé en le faisant précéder d'un
BackSlash. Deux expressions régulières peuvent être reliées par
l'opérateur infixe |; l'expression résultante correspondra
Une liste de caractères, encadrée par [ et ] peut être à toute chaîne correspondant à l'une ou l'autre des deux
mise en correspondance avec n'importe quel caractère sous-expressions.
unique appartenant à la liste. Si le premier caractère de
la liste est l'accent circonflexe ^ alors la mise en cor- Les répétitions ont priorité sur les juxtapositions, qui à
respondance se fait avec n'importe quel caractère absent leur tour ont priorité sur les alternatives. Une sous-
de la liste. Par exemple, l'expression régulière expression peut être entourée par des parenthèses pour
[0123456789] convient pour n'importe quel chifre unique. modifier ces règles de précédence.

Un intervalle de caractères ASCII peut être indiqué en La référence inverse \n, ou n est un chiffre, correspond à
donnant le premier et le dernier caractère séparés par un la sous-chaîne déjà mise en correspondance avec la nième
tiret. sous-expression régulière entre parenthèses.

Finalement il existe certaines classes de caractères Dans les expressions régulières simples, les méta-car-
prédéfinies. Leurs noms sont assez explicites : actères ?, +, {, |, (, et ) perdent leurs significations
[:alnum:], [:alpha:], [:cntrl:], [:digit:] (chiffres), spéciales, il faut utiliser à la place leurs versions avec
[:graph:], [:lower:] (minuscules), [:print:] (affich- BackSlash \?, \+, \{, \|, \(, et \).
ables), [:punct:], [:space:], [:upper:] (majuscules), et
[:xdigit:] (chiffres héxadécimaux). par exemple, Dans egrep le méta-caractère { perd sa signification
[[:alnum:]] correspond à [0-9A-Za-z], à la différence que spéciale, il faut utiliser \{ à la place.
le dernier dépend de l'encodage ASCII, alors que le pre-
mier est plus portable. Remarquez que les crochets dans DIAGNOSTIQUE
les noms de classes font partie intégrante du nom symbol- Normalement, le code de retour est 0 si des correspon-
ique, et qu'ils doivent donc être inclus en plus des cro- dances ont été trouvées, et 1 si aucune correspondance n'a
chets encadrant la liste. La plupart des méta-caractères été faite. L'option -v inverse le sens du code de retour.
perdent leurs significations spéciales au sein des listes. Le code de retour correspond à des erreurs de syntaxe dans
Pour inclure un ] littéral, mettez-le en premier dans la le motif, des fichiers d'entrée inaccessibles, ou d'autres
liste. De même, pour inclure un ^ littéral, placez-le erreurs système.
n'importe ou sauf au début de la liste. Enfin, pour
inclure un - placez-le en dernier. BOGUES
Envoyez les rapports de bug ([NDT] en anglais !) à bug-
Le point . correspond à n'importe quel caractère unique. gnu-utils@prep.ai.mit.edu. Assurez-vous d'inclure le mot
Le symbole \w est un synonyme de [[:alnum:]] et \W un syn- ``grep'' quelque part dans le champ ``Subject:''.
onyme de [^[:alnum]].
Dans les constructions {m,n} de grandes valeurs de
L'accent circonflexe ^ et le symbole dollar $ sont des répétition peuvent pousser grep à utiliser beaucoup de
méta-caratères correspondant respectivement à une chaîne mémoire. De plus, certaines autres expressions régulières
vide au début et en fin de ligne. Les symboles \< et \> obscures peuvent prendre un temps exponentiellement long,
correspondent respectivement à une chaîne vide en début et et mener à un manque de mémoire.
en fin de mot. Le symbole \b correspond à une chaîne vide
à l'extrémité d'un mot, et \B correspond à une chaîne vide Les références inverses sont très lentes et peuvent néces-
ne se trouvant pas à une extrémité de mot. siter un temps exponentiellement long.

Une expression régulière correspondant à un caractère


unique peut être suivie par l'un des opérateurs de TRADUCTION
répétition suivants : Christophe Blaess, 1997.
? L'élément précédent est facultatif et doit être mis
en correspondance une fois au maximum.
* L'élément précédent doit être mis en correspondance
zéro ou plusieurs fois. FSF 15 Janvier 1997 GREP(1)
+ L'élément précédent doit être mis en correspondance
au moins une fois.
{n} L'élément précédent doit être mis en correspondance
exactement n fois. ' ## " ' ## "
{n,} L'élément précédent doit être mis en correspondance
n fois ou plus.
'0 -*
DESCRIPTION
The groupdel command modifies the system account files,
NAME deleting all entries that refer to group. The named group
groupadd - Create a new group must exist.

SYNOPSIS You must manually check all filesystems to insure that no


groupadd [-g gid [-o]] [-r] [-f] group files remain with the named group as the file group ID.

DESCRIPTION CAVEATS
The groupadd command creates a new group account using the You may not remove the primary group of any existing user.
values specified on the command line and the default val- You must remove the user before you remove the group.
ues from the system. The new group will be entered into
the system files as needed. The options which apply to FILES
the groupadd command are /etc/group - group information
/etc/gshadow - secure group information
-g gid The numerical value of the group's ID. This value
must be unique, unless the -o option is used. The SEE ALSO
value must be non-negative. The default is to use chfn(1), chsh(1), useradd(8), userdel(8), usermod(8),
the smallest ID value greater than 500 and greater passwd(1), groupadd(8), groupmod(8)
than every other group. Values between 0 and 499
are typically reserved for system accounts. AUTHOR
Julianne Frances Haugh (jfh@austin.ibm.com)
-r This flag instructs groupadd to add a system
account. The first available gid lower than 499
will be automatically selected unless the -g option
is also given on the command line.
This is an option added by Red Hat.

-f This is the force flag. This will cause groupadd to


exit with an error when the group about to be added
already exists on the system. If that is the case, NOM
the group won't be altered (or added again). gzip, gunzip, zcat - Compresser ou décompresser des
This option also modifies the way -g option works. fichiers.
When you request a gid that it is not unique and
you don't specify the -o option too, the group cre- SYNOPSIS
ation will fall back to the standard behavior gzip [ -acdfhlLnNrtvV19 ] [-S suffixe] [ nom ... ]
(adding a group as if neither -g or -o options were gunzip [ -acfhlLnNrtvV ] [-S suffixe] [ nom ... ]
specified). zcat [ -fhLV ] [ nom ... ]
This is an option added by Red Hat.
DESCRIPTION
FILES gzip réduit la taille des fichiers nommés en utilisant le
/etc/group - group account information codage Lempel-Ziv (LZ77). Quand c'est possible, chaque
/etc/gshadow - secure group account information fichier est remplacé par un autre fichier portant l'exten-
sion .gz, en gardant les mêmes modes de permissions, et
SEE ALSO les mêmes date de dernier accès et de modification.
chfn(1), chsh(1), useradd(8), userdel(8), usermod(8), (L'extension par défaut est -gz pour VMS, z pour MSDOS,
passwd(1), groupdel(8), groupmod(8) OS/2 FAT, Windows NT FAT et Atari.) Si aucun fichier
n'est spécifié, ou si un nom de fichier est "-", l'entrée
AUTHOR standard est compressée sur la sortie standard. gzip
Julianne Frances Haugh (jfh@austin.ibm.com) n'essaiera de compresser que les fichiers réguliers. En
particulier, il ignorera les liens symboliques.

Si le nom du fichier compressé est trop long pour son


GROUPADD(8) système de fichiers, gzip le tronque. gzip n'essaie de
tronquer que les parties du nom du fichier plus longues
que 3 caractères. (Une partie est délimitées par des
points.) Si le nom n'est constitué que de petites parties,
' #% " ' #% " les parties les plus longues sont tronquées. Par exemple,
si les noms de fichiers sont limités à 14 caractères,
gzip.msdos.exe sera compressé en gzi.msd.exe.gz. Les noms
ne sont pas tronqués sur les systèmes qui ne comportent
NAME pas de limites en ce qui concerne la longueur des noms de
groupdel - Delete a group fichiers.

SYNOPSIS Par défaut, gzip garde le nom du fichier original et son


groupdel group horodatage dans le fichier compressé. Ceux-ci sont
utilisés durant la décompression du fichier avec l'option

- -
-N. C'est utile quand le nom du fichier compressé a été compressé est légèrement plus grand que l'original.
tronqué ou quand l'horodate n'a pas été préservée lors L'expansion dans le pire des cas est de quelques octets
d'un transfert de fichier. pour l'entête du fichier gzip, plus 5 octets tous les
blocs de 32Ko, ou une expansion de 0.015% pour les grands
Les fichiers compressés peuvent être restaurés dans leur fichiers. Notez que le nombre de blocs de disque réelle-
forme originale en utilisant gzip -d ou gunzip ou bien ment utilisé n'augmente presque jamais. gzip préserve les
encore zcat. Si le nom original sauvé dans le fichier modes, permissions et horodates des fichiers pendant la
compressé ne convient pas à son système de fichiers, un compression ou la décompression.
nouveau nom est construit à partir de l'original pour le
rendre conforme.
OPTIONS
gunzip prend une liste de fichiers sur la ligne de comman- -a --ascii
des et remplace chaque fichier dont le nom se termine par Mode texte ascii : convertit les fins de lignes en
.gz, -gz, .z, -z, _z or .Z, et qui commence par le nombre utilisant les conventions locales. Cette option
magique correct, par un fichier décompressé sans l'exten- n'est supportée que sur les systèmes non Unix. Pour
sion originale. gunzip reconnaît également les extensions MSDOS, CR LF est converti en LF pendant la compres-
spéciales .tgz et .taz comme des raccourcis pour .tar.gz sion, et LF est converti en CR LF pendant la décom-
et .tar.Z respectivement. Pendant la compression, gzip pression.
utilise l'extension .tgz si nécessaire au lieu de tronquer
un fichier d'extension .tar . -c --stdout --to-stdout
Ecrire la sortie sur la sortie standard ; garder
gunzip peut actuellement décompresser les fichiers créés les fichiers originaux non modifiés. S'il y a de
par gzip, zip, compress, compress -H ou pack. La détec- multiples fichiers, la sortie consiste en une
tion du format d'entrée se fait automatiquement. Quand il séquence de membres compressés indépendamment. Pour
utilise les deux premiers formats, gunzip vérifie un CRC obtenir une meilleure compression, gzip concatène
32 bit. Pour pack, gunzip vérifie la longueur du fichier tous les fichiers d'entrées avant de les com-
décompressé. Le format compress standard n'a pas été prévu presser.
pour permettre des contrôles de cohérence. Néanmoins, gun-
zip est quelquefois capable de détecter un fichier .Z -d --decompress --uncompress
défectueux. Si vous obtenez une erreur durant la décom- Décompresser.
pression d'un fichier .Z, ne supposez pas que le fichier
.Z est correct uniquement parce que l'uncompress standard -f --force
ne se plaint pas. Cela signifie en général que l'uncom- Forcer la compression ou la décompression même si
press standard ne vérifie pas son entrée, et génère une le fichier est cible de plusieurs liens durs, ou si
sortie "dégradée" sans s'en offusquer. Le format -H du le fichier correspondant existe, ou encore si les
compress de SCO (méthode de compression LZH) n'inclut pas données compressées sont lues ou écrites à partir
de CRC mais permet tout de même quelques tests de d'un terminal. Si les données d'entrée ne sont pas
cohérence. dans un format reconnu par gzip, et si l'option
--stdout est également fournie, copier les données
Les fichiers créés par zip ne peuvent être décompressés en entrée sans modification sur la sortie standard
par gzip que s'ils n'ont qu'un seul membre compressé avec : laisser zcat se comporter comme cat. Si -f n'est
la méthode de "dégonflement". Cette caractéristique n'est pas donné, et quand il ne tourne pas en
prévue que pour faciliter la conversion de fichiers arrière-plan, gzip interroge l'utilisateur pour
.tar.zip au format .tar.gz. Pour extraire des fichiers zip vérifier si un fichier existant doit être écrasé ou
contenant plusieurs membres, utilisez unzip au lieu de non.
gunzip.
-h --help
zcat est identique à gunzip -c. (Sur certains systèmes, Afficher un écran d'aide et se terminer.
zcat peut être installé en tant que gzcat pour préserver
le lien original vers compress.) zcat décompresse ou bien -l --list
une liste de fichiers obtenue à partir de la ligne de com- Pour chaque fichier compressé, afficher les champs
mandes, ou bien son entrée standard, et décompresse les suivants :
données sur la sortie standard. zcat décompressera les
fichiers ayant le nombre magique correct qu'ils aient un compressed size : taille du fichier compressé
suffixe .gz ou non. uncompressed size : taille du fichier décom-
pressé
gzip utilise l'algorithme de Lempel-Ziv utilisé par zip et ratio : coefficient de compression (0.0% si
PKZIP. Le pourcentage de compression obtenu dépend de la inconnu)
taille de l'entrée, et de la distributions des uncompressed_name: nom du fichier décompressé
sous-chaînes de caractères communes. Typiquement, des
fichiers textes du type code source en anglais seront com- La taille du fichier compressé vaut -1 pour les
pressés à hauteur de 60-70%. La compression est en général fichiers n'étant pas au format gzip, comme les
nettement meilleure que celle obtenue par LZW (utilisé par fichiers compressés .Z. Pour obtenir la taille
compress), le codage de Huffman (utilisé dans pack), ou le décompressée pour de tels fichiers, vous pouvez
codage de Huffman adaptatif (compact). utiliser :

La compression est toujours effectuée, même si le fichier zcat fichier.Z | wc -c


- -!
fichiers donnés quelque soit leur suffixe, comme
En combinaison avec l'option --verbose, les champs dans
suivants sont également affichés :
gunzip -S "" * (*.* pour MSDOS)
method: méthode de compression
crc: CRC 32-bit des données décompressées Des versions précédentes de gzip utilisaient le
date & time: horodate du fichier décompressé suffixe .z. Ceci a été changé pour éviter un con-
flit avec pack (1).
Les méthodes de compression actuellement supportées
sont deflate, compress, lzh (SCO compress -H) et -t --test
pack. La valeur du CRC affichée est de ffffffff Tester. Vérifier l'intégrité du fichier compressé.
pour les fichiers n'étant pas au format gzip
-v --verbose
Avec --name, le nom décompressé, la date et heure Mode volubile. Afficher le nom et le pourcentage de
sont celles stockées dans le fichier compressé réduction pour chaque fichier compressé ou décom-
(s'il y en a). pressé.

Avec --verbose, les totaux de taille et de coeffi- -V --version


cient de compression pour tous les fichiers sont Version. Afficher le numéro de version et les
également affichés, à moins que certaines tailles options de compilation puis se terminer.
ne soient inconnues. Avec --quiet, les lignes de
titres et de totaux ne sont pas affichées. -# --fast --best
Réguler la vitesse de compression en utilisant le
-L --license chiffre # spécifié, où -1 ou --fast indique la
Afficher la license d'utilisation de gzip et se méthode de compression la plus rapide (la moins
terminer. bonne compression), et -9 ou --best indique la
méthode de compression la plus lente (la meilleure
-n --no-name compression). Le niveau de compression par défaut
Pendant la compression, ne pas sauver les noms et -6 (càd biaisé en faveur d'une forte compression au
horodates des fichiers originaux par défaut. (Le lieu de la vitesse d'exécution.
nom original est toujours sauvé si le nom du
fichier a dû être tronqué.) Pendant la décompres- UTILISATION AVANCÉE
sion, ne pas restaurer le nom du fichier original De multiple fichiers compressés peuvent être concaténés.
s'il est présent (uniquement supprimer le suffixe Dans ce cas gunzip extraiera tous les membres ensemble.
gzip du nom du fichier compressé), et ne pas Par exemple,
restaurer l'horodate originale si elle est présente
(prendre celle du fichier compressé). Cette option gzip -c file1 > foo.gz
est activée par défaut durant la décompression. gzip -c file2 >> foo.gz

-N --name Alors
Pendant la compression, toujours sauver les noms et gunzip -c foo
horodates des fichiers originaux; c'est le com-
portement par défaut. Pendant la décompression, est équivalent à
restaurer le nom du fichier original et son horo-
date s'ils sont présents. Cette option est utile cat file1 file2
sur les systèmes ayant une limite sur la longueur
des noms de fichiers ou quand l'horodate a été per- Dans le cas où un membre d'un fichier .gz est endommagé,
due lors d'un transfert de fichier. les autres membres peuvent toujours être récupérés (si le
membre endommagé est supprimé). Néanmoins, vous pouvez
-q --quiet obtenir une meilleur compression en compressant tous les
Supprimer tous les avertissements. membres ensemble :

-r --recursive cat file1 file2 | gzip > foo.gz


Parcourir la structure du répertoire récursivement.
Si l'un des noms de fichiers spécifiés sur la ligne compresse mieux que
de commandes est un répertoire, gzip descendra dans
ce répertoire et compressera tous les fichiers gzip -c file1 file2 > foo.gz
qu'il y trouve (ou les décompressera dans le cas de
gunzip ). Si vous voulez recompresser des fichiers concaténés pour
obtenir une meilleure compression, faites
-S .suf --suffix .suf
Utiliser le suffixe .suf au lieu de .gz. N'importe gzip -cd old.gz | gzip > new.gz
quel suffixe peut être donné, mais les suffixes
différents de .z et .gz devraient être évités pour Si un fichier compressé est constitué de plusieurs mem-
empêcher une confusion lors du transfert de bres, la taille décompressée et le CRC rapportés par
fichiers sur d'autres systèmes. Un suffixe vide l'option --list s'appliquent uniquement au dernier membre.
force gunzip à essayer de décompresser tous les Si vous avez besoin de la taille décompressée de tous les
- -'
membres, vous pouvez utiliser répertoire (çàd un lien symbolique, un socket, une
FIFO ou un fichier spécial de périphérique), elle
gzip -cd file.gz | wc -c n'est pas altérée.
-- has xx other links: unchanged
Si vous voulez créer un fichier archive contenant de mul- Le fichier d'entrée est "visé" par un ou des liens
tiples membres de sorte que les membres puissent être durs; il est laissé inchangé. Voyez ln(1) pour
ensuite extraits indépendamment, utilisez un archiveur plus d'information. Utilisez l'option -f pour
comme tar ou zip. GNU tar supporte l'option -z pour invo- forcer la compression de fichiers liés plus d'une
quer gzip de façon transparente. gzip est conçu comme un fois.
complément à tar, pas comme son remplaçant.
INCONVÉNIENTS
ENVIRONNEMENT Pendant l'écriture de données compressées sur une bande
La variable d'environnement GZIP peut contenir un ensemble magnétique, il est généralement nécessaire d'ajouter des
d'options par défaut pour gzip. Ces options sont zéros à la sortie jusqu'à arriver à une limite de bloc
interprétées en premier lieu et peuvent être surchargées (padding). Quand les données sont lues et que le bloc
explicitement par les paramètres explicites présents sur entier est envoyé à gunzip pour la décompression, gunzip
la ligne de commandes. Par exemple, détecte qu'il y a des déchets excédentaires à la fin des
données compressées, et émet par défaut un avertissement.
pour sh: GZIP="-8v --name"; export GZIP Vous devez utiliser l'option --quiet pour supprimr cet
pou csh: setenv GZIP "-8v --name" avertissement. Cette option peut être placée dans la
pour MSDOS: set GZIP=-8v --name variable d'environnement GZIP comme suit :

Sur Vax/VMS, le nom de la variable d'environnement est- pour sh: GZIP="-q" tar -xfz --block-compress /dev/rst0
GZIP_OPT, pour éviter un conflit avec l'ensemble de sym- pour csh: (setenv GZIP -q; tar -xfz --block-compr
boles utilisés lors de l'invocation du programme. /dev/rst0

VOIR AUSSI Dans l'exemple ci-dessus, gzip est invoqué explicitement


compact(1). compress(1), gzexe(1), pack(1), unzip(1), par l'option -z du tar GNU. Assurez-vous que la même
zcmp(1), zforce(1), zip(1), zmore(1), znew(1), taille de bloc (option -b de tar) est utilisée pour la
lecture et l'écriture de données compressées sur des ban-
DIAGNOSTIQUES des. (Cet exemple suppose que vous utilisez la version
La valeur de sortie vaut normalement 0; si une erreur se GNU de tar.)
produit, la valeur de sortie sera de 1. Si un avertisse-
ment se produit, la valeur de sortie sera de 2. BOGUES
L'option --list rapporte des tailles incorrectes si elles
Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...] excèdent 2 GB. L'option --liste rapporte des tailles de
Les options invalides sont indiquées sur la ligne -1 et un CRC de ffffffff si le fichier compressé est situé
de commandes. sur un medium à accès non aléatoire (séquentiel par exem-
fichier: not in gzip format ple).
Le fichier spécifié à gunzip n'a pas été com-
pressé. Dans quelques rares cas, l'option --best donne une moins
fichier: Corrupt input. Use zcat to recover some data. bonne compression que le niveau de compression par défaut
Le fichier compressé a été endommagé. Les données (-6). Sur certains fichiers hautement redondants, compress
se situant jusqu'au point d'échec peuvent être compresse mieux que gzip.
récupérées en utilisant
zcat file > recover TRADUCTION
fichier: compressed with xx bits, can only handle yy bits Frédéric Delanoy, 2000.
fichier a été compressé (en utilisant LZW) par un
programme qui peut traiter plus de bits que le
code de décompression sur la machine utilisée.
Recompressez le fichier avec gzip, qui compresse Linux 29 Août 2000 GZIP(1)
mieux et utilise moins de mémoire.
fichier: already has .gz suffix -- no change
Le fichier est supposé être déjà compressé. Renom-
mez le fichier et réessayez. % # % #
fichier already exists; do you wish to overwrite (y or n)?
Répondez "y" si vous voulez que le fichier de sor-
tie soit remplacé, répondez "n" sinon.
gunzip: corrupt input
Une violation de mémoire SIGSEGV a été détectée, NOM
ce qui signifie en général que le fichier d'entrée head - Afficher le début d'un fichier.
a été corrompu.
xx.x% SYNOPSIS
Pourcentage du fichier d'entrée sauvé par la com- head [-c N[bkm]] [-n N] [-qv] [--bytes=N[bkm]] [--lines=N]
pression. (Pertinent uniquement pour -v et -l.) [--quiet] [--silent] [--verbose] [--help] [--version]
-- not a regular file or directory: ignored [fichier...]
Qaund l'entrée n'est pas un fichier régulier ou un
-- -&
head [-Nbcklmqv] [fichier...] SYNOPSIS
id [-gnruG] [--group] [--name] [--real] [--user]
DESCRIPTION [--groups] [--help] [--version] [utilisateur]
Cette page de manuel documente la version GNU de head.
DESCRIPTION
head affiche la première partie (10 lignes par défaut) de Cette page de manuel documente la version GNU de id.
chacun des fichiers mentionnés. La lecture se fait sur
l'entrée standard si aucun fichier n'est indiqué, ou si le id affiche des informations concernant l'utilisateur
nom `-' est fourni. indiqué, ou le processus appelant si aucun utilisateur
n'est mentionné.
Si plusieurs fichiers sont fournis, un en-tête est affiché
avant chacun d'eux, mentionnant le nom du fichier entre Par défaut, il affiche l'U-ID réel, le G-ID réel, l'U-ID
`==>' et `<=='. effectif s'il diffère de l'U-ID réel, le G-ID effectif
s'il diffère du G-ID réel, et les G-IDs des groupes
OPTIONS supplémentaires. Chaque valeur est affichée précédée d'un
head accepte deux formats d'options : le nouveau où les libellé l'identifiant, et suivie entre parenthèses des
nombres sont des arguments suivant les options indiquées noms de groupe ou d'utilisateur.
par des lettres et l'ancien dans lequel les nombres
précèdent les lettres d'option. Les options permettent à id de n'afficher qu'une partie de
ces informations.
-c N, --bytes N
Afficher les N premiers octets. N est un entier non OPTIONS
nul, suivi éventuellement d'une lettre indiquant -g, --group
une unité différente de l'octet. Afficher uniquement le Group-ID.

b Bloc de 512 octets. -G, --groups


Afficher uniquement les groupes supplémentaires.
k Bloc de 1 Ko.
--help Afficher un message d'aide sur la sortie standard
m Bloc de 1 Mo. et terminer normalement.

-n N, --lines N -n, --name


Afficher les N premières lignes. Afficher les noms de groupe ou d'utilisateur à la
place du numéro d'ID. Nécéssite -u, -g, ou -G.
-q, --quiet, --silent
Ne pas afficher les en-têtes mentionnant les noms -r, --real
de fichiers. Afficher les U-ID et G-ID réels plutot que ceux
effectifs. Nécéssite -u, -g, ou -G.
-v, --verbose
Toujours afficher les en-têtes mentionnant les noms -u, --user
de fichiers. N'afficher que l'User-ID.

--help Afficher un message d'aide sur la sortie standard --version


et terminer normalement. Afficher un numéro de version sur la sortie stan-
dard et terminer normalement.
--version
Afficher un numéro de version sur la sortie stan-
dard et terminer normalement. TRADUCTION
Christophe Blaess, 1997.

TRADUCTION
Christophe Blaess, 1997.
FSF 9 Janvier 1997 ID(1L)

FSF 12 Janvier 1997 HEAD(1)


" (/ & & * "

# #
NAME
init, telinit - process control initialization

NOM SYNOPSIS
id - Afficher les UIDs et GIDs effectifs et réels. /sbin/init [ -a ] [ -s ] [ -b ] [ -z xxx ] [ 0123456Ss ]
/sbin/telinit [ -t sec ] [ 0123456sSQqabcUu ]

-0 &*
provided that these files exist.
DESCRIPTION
Init CHANGING RUNLEVELS
Init is the parent of all processes. Its primary role is After it has spawned all of the processes specified, init
to create processes from a script stored in the file waits for one of its descendant processes to die, a power-
/etc/inittab (see inittab(5)). This file usually has fail signal, or until it is signaled by telinit to change
entries which cause init to spawn gettys on each line that the system's runlevel. When one of the above three condi-
users can log in. It also controls autonomous processes tions occurs, it re-examines the /etc/inittab file. New
required by any particular system. entries can be added to this file at any time. However,
init still waits for one of the above three conditions to
occur. To provide for an instantaneous response, the
RUNLEVELS telinit Q or q command can wake up init to re-examine the
A runlevel is a software configuration of the system which /etc/inittab file.
allows only a selected group of processes to exist. The
processes spawned by init for each of these runlevels are If init is not in single user mode and receives a power-
defined in the /etc/inittab file. Init can be in one of fail signal (SIGPWR), it reads the file /etc/powerstatus.
eight runlevels: 0-6 and S or s. The runlevel is changed It then starts a command based on the contents of this
by having a privileged user run telinit, which sends file:
appropriate signals to init, telling it which runlevel to
change to. F(AIL) Power is failing, UPS is providing the power. Exe-
cute the powerwait and powerfail entries.
Runlevels 0, 1, and 6 are reserved. Runlevel 0 is used to
halt the system, runlevel 6 is used to reboot the system, O(K) The power has been restored, execute the
and runlevel 1 is used to get the system down into single powerokwait entries.
user mode. Runlevel S is not really meant to be used
directly, but more for the scripts that are executed when L(OW) The power is failing and the UPS has a low battery.
entering runlevel 1. For more information on this, see the Execute the powerfailnow entries.
manpages for shutdown(8) and inittab(5).
If /etc/powerstatus doesn't exist or contains anything
Runlevels 7-9 are also valid, though not really docu- else then the letters F, O or L, init will behave as if it
mented. This is because "traditional" Unix variants don't has read the letter F.
use them. In case you're curious, runlevels S and s are
in fact the same. Internally they are aliases for the Usage of SIGPWR and /etc/powerstatus is discouraged. Some-
same runlevel. one wanting to interact with init should use the
/dev/initctl control channel - see the source code of the
sysvinit package for more documentation about this.
BOOTING
After init is invoked as the last step of the kernel boot When init is requested to change the runlevel, it sends
sequence, it looks for the file /etc/inittab to see if the warning signal SIGTERM to all processes that are unde-
there is an entry of the type initdefault (see init- fined in the new runlevel. It then waits 5 seconds before
tab(5)). The initdefault entry determines the initial run- forcibly terminating these processes via the SIGKILL sig-
level of the system. If there is no such entry (or no nal. Note that init assumes that all these processes (and
/etc/inittab at all), a runlevel must be entered at the their descendants) remain in the same process group which
system console. init originally created for them. If any process changes
its process group affiliation it will not receive these
Runlevel S or s bring the system to single user mode and signals. Such processes need to be terminated separately.
do not require an /etc/inittab file. In single user mode,
a root shell is opened on /dev/console. TELINIT
/sbin/telinit is linked to /sbin/init. It takes a one-
When entering single user mode, init reads the console's character argument and signals init to perform the appro-
ioctl(2) states from /etc/ioctl.save. If this file does priate action. The following arguments serve as direc-
not exist, init initializes the line at 9600 baud and with tives to telinit:
CLOCAL settings. When init leaves single user mode, it
stores the console's ioctl settings in this file so it can 0,1,2,3,4,5 or 6
re-use them for the next single-user session. tell init to switch to the specified run level.

When entering a multi-user mode for the first time, init a,b,c tell init to process only those /etc/inittab file
performs the boot and bootwait entries to allow file sys- entries having runlevel a,b or c.
tems to be mounted before users can log in. Then all
entries matching the runlevel are processed. Q or q tell init to re-examine the /etc/inittab file.

When starting a new process, init first checks whether the S or s tell init to switch to single user mode.
file /etc/initscript exists. If it does, it uses this
script to start the process. U or u tell init to re-execute itself (preserving the
state). No re-examining of /etc/inittab file hap-
Each time a child terminates, init records the fact and pens. Run level should be one of Ss12345, otherwise
the reason it died in /var/run/utmp and /var/log/wtmp, request would be silently ignored.
& &
more space on the stack. Init can then manipulate the
telinit can also tell init how long it should wait between command line so that ps(1) shows the current run-
sending processes the SIGTERM and SIGKILL signals. The level.
default is 5 seconds, but this can be changed with the -t
sec option.
INTERFACE
telinit can be invoked only by users with appropriate Init listens on a fifo in /dev, /dev/initctl, for mes-
privileges. sages. Telinit uses this to communicate with init. The
interface is not very well documented or finished. Those
The init binary checks if it is init or telinit by looking interested should study the initreq.h file in the src/
at its process id; the real init's process id is always 1. subdirectory of the init source code tar archive.
From this it follows that instead of calling telinit one
can also just use init instead as a shortcut. SIGNALS
Init reacts to several signals:
ENVIRONMENT
Init sets the following environment variables for all its SIGHUP
children: Init looks for /etc/initrunlvl and /var/log/initrun-
lvl. If one of these files exist and contain an
PATH /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin ASCII runlevel, init switches to the new runlevel.
This is for backwards compatibility only! . In the
INIT_VERSION normal case (the files don't exist) init behaves like
As the name says. Useful to determine if a script telinit q was executed.
runs directly from init.

RUNLEVEL SIGUSR1
The current system runlevel. On receipt of this signals, init closes and re-opens
its control fifo, /dev/initctl. Useful for
PREVLEVEL bootscripts when /dev is remounted.
The previous runlevel (useful after a runlevel
switch). SIGINT
Normally the kernel sends this signal to init when
CONSOLE CTRL-ALT-DEL is pressed. It activates the ctrlaltdel
The system console. This is really inherited from action.
the kernel; however if it is not set init will set
it to /dev/console by default. SIGWINCH
The kernel sends this signal when the KeyboardSignal
BOOTFLAGS key is hit. It activates the kbrequest action.
It is possible to pass a number of flags to init from the
boot monitor (eg. LILO). Init accepts the following flags:
CONFORMING TO
-s, S, single Init is compatible with the System V init. It works
Single user mode boot. In this mode /etc/inittab is closely together with the scripts in the directories
examined and the bootup rc scripts are usually run /etc/init.d and /etc/rc{runlevel}.d. If your system uses
before the single user mode shell is started. this convention, there should be a README file in the
directory /etc/init.d explaining how these scripts work.

1-5 Runlevel to boot into. FILES


/etc/inittab
/etc/initscript
-b, emergency /dev/console
Boot directly into a single user shell without run- /etc/ioctl.save
ning any other startup scripts. /var/run/utmp
/var/log/wtmp
/dev/initctl
-a, auto
The LILO boot loader adds the word "auto" to the com- WARNINGS
mand line if it booted the kernel with the default Init assumes that processes and descendants of processes
command line (without user intervention). If this is remain in the same process group which was originally cre-
found init sets the "AUTOBOOT" environment variable ated for them. If the processes change their group, init
to "yes". Note that you cannot use this for any secu- can't kill them and you may end up with two processes
rity measures - of course the user could specify reading from one terminal line.
"auto" or -a on the command line manually.
DIAGNOSTICS
If init finds that it is continuously respawning an entry
-z xxx more than 10 times in 2 minutes, it will assume that there
The argument to -z is ignored. You can use this to is an error in the command string, generate an error mes-
expand the command line a bit, so that it takes some sage on the system console, and refuse to respawn this
& &!
entry until either 5 minutes has elapsed or it receives a
signal. This prevents it from eating up system resources
when someone makes a typographical error in the /etc/init- TRADUCTION
tab file or the program for the entry is removed. Christophe Blaess, 1997.

AUTHOR
Miquel van Smoorenburg (miquels@cistron.nl), initial man-
ual page by Michael Haardt (u31b3hs@pool.informatik.rwth- Linux 8 Juin 1997 KILL(1)
aachen.de).

SEE ALSO
getty(1), login(1), sh(1), runlevel(8), shutdown(8), ( (
kill(1), inittab(5), initscript(5), utmp(5)

23 August 2001 INIT(8) NOM


last, lastb - Afficher une liste des utilisateurs
dernièrement connectés.

SYNOPSIS
last [-R] [-num] [ -n num ] [-adx] [ -f fichier ] [nom...]
[tty...]
lastb [-R] [-num] [ -n num ] [ -f fichier ] [-adx]
[nom...] [tty...]
NOM DESCRIPTION
kill - Envoyer un signal à un processus. Last parcourt le fichier /var/log/wtmp (ou le fichier
indiqué par l'option -f) pour présenter une liste de
SYNOPSIS toutes les connexions et déconnexions des utilisateurs,
kill [ -s signal | -p ] [ -a ] pid ... depuis la création du fichier.
kill -l [ signal ]
Des noms d'utilisateurs ou de terminaux peuvent être
DESCRIPTION spécifiés, afin que last ne montre que les connex-
kill envoie le signal indiqué aux processus mentionnés. Si ions/déconnexions correspondant à ces arguments. Le nom
on ne précise pas de signal, TERM est envoyé. Ce dernier des terminaux peuvent être abrégés, ainsi last 0 est
tuera les processus qui ne l'interceptent pas. équivalent à last tty0.
Si l'on désire tuer des processus qui interceptent TERM, Quand last reçoit un signal SIGINT (engendré par la touche
il peut être necessaire d'envoyer le signal KILL (9), qui d'interruption, généralement Controle-C) ou un signal
ne peut pas être intercepté. SIGQUIT (déclenché par la touche Quit, généralement Cont-
role-\), il indiquera le point où il est arrivé dans le
La plupart des shells modernes ont une commande kill fichier, et dans le cas de SIGINT, last se terminera.
intégrée.
Le pseudo-utilisateur reboot est enregistré à chaque
OPTIONS redémarrage du système, ainsi last reboot affichera une
pid ... liste de toutes les réinitialisations depuis la création
Indique la liste des PID auxquels kill doit envoyer du fichier de journalisation.
un signal. Chaque pid peut être un Id de proces-
sus, ou un nom de processus. Lastb se comporte comme last, mais il utilise le fichier
/var/log/btmp qui journalise toutes les tentatives
-s Indique le signal à envoyer. Celui-ci peut être infructueuses de connexion.
spécifié par son nom ou par son numéro.
OPTIONS
-p Indique que kill doit simplement fournir l'Id du -num Cet argument indique à last le nombre de lignes
processus dont le nom est fourni, sans lui envoyer d'enregistrement à afficher.
de signal.
-n num est équivalent à -num.
-l Affiche une liste des noms de signaux connus. Ceux-
ci sont fournis dans /usr/include/linux/signal.h -R Cet argument empêche l'affichage du champ hostname.
VOIR AUSSI -a Demande à last d'afficher le nom d'hôte en dernière
bash(1), tcsh(1), kill(2), sigvec(2) colonne. Principalement utile en combinaison avec
l'option suivante.
AUTEUR
Inspiré de BSD 4.4. La possibilité de traduire le nom du -d Pour les connexions non-locales, Linux journalise
processus en PID a été ajoutée par Salvatore Valente <sva- le nom d'hôte ainsi que son adresse IP. Avec cette
lente@mit.edu>.
& &'
option, l'adresse IP est à nouveau reconvertie en Julianne Frances Haugh (jfh@austin.ibm.com)
nom d'hôte. Phillip Street

-x Afficher également les arrêts du système et les


modifications de niveau d'exécution (run level).
LASTLOG(8)
NOTES
Les fichiers wtmp et btmp sont parfois absents. Le
système ne journalise les informations que si les fichiers
sont deja présents, mais ne les crée pas de lui-même. %(( %((
Il s'agit d'un choix local de configuration. Si vous
désirez utiliser ces journalisations, vous pouvez créer
les fichiers avec une simple commande touch (par exemple,
touch /var/log/wtmp). NAME
less - opposite of more
AUTEUR
Miquel van Smoorenburg, miquels@cistron.nl SYNOPSIS
less -?
VOIR AUSSI less --help
shutdown(8), login(1), init(8). less -V
less --version
less [-[+]aBcCdeEfgGiImMnNqQrsSuUVwX]
TRADUCTION [-b bufs] [-h lines] [-j line] [-k keyfile]
Christophe Blaess, 1997. [-{oO} logfile] [-p pattern] [-P prompt] [-t tag]
[-T tagsfile] [-x tab] [-y lines] [-[z] lines]
[+[+]cmd] [--] [filename]...
(See the OPTIONS section for alternate option syntax with
Linux 9 Juin 1997 LAST(1) long option names.)

DESCRIPTION
Less is a program similar to more (1), but which allows
( " ( " backward movement in the file as well as forward movement.
Also, less does not have to read the entire input file
before starting, so with large input files it starts up
faster than text editors like vi (1). Less uses termcap
NAME (or terminfo on some systems), so it can run on a variety
lastlog - examine lastlog file of terminals. There is even limited support for hardcopy
terminals. (On a hardcopy terminal, lines which should be
SYNOPSIS printed at the top of the screen are prefixed with a
lastlog [-u login-name] [-t days] caret.)

DESCRIPTION Commands are based on both more and vi. Commands may be
lastlog formats and prints the contents of the last login preceded by a decimal number, called N in the descriptions
log, /var/log/lastlog. The login-name, port, and last below. The number is used by some commands, as indicated.
login time will be printed. The default (no flags) causes
lastlog entries to be printed, sorted by the numerical
UID. Entering -u login-name flag will cause the lastlog COMMANDS
record for login-name only to be printed. Entering -t In the following descriptions, ^X means control-X. ESC
days will cause only the lastlogins more recent than days stands for the ESCAPE key; for example ESC-v means the two
to be printed. The -t flag overrides the use of -u. character sequence "ESCAPE", then "v".

If the user has never logged in the message "**Never h or H Help: display a summary of these commands. If you
logged in**" will be displayed instead of the port and forget all the other commands, remember this one.
time.
SPACE or ^V or f or ^F
FILES Scroll forward N lines, default one window (see
/var/log/lastlog - lastlog logging file option -z below). If N is more than the screen
size, only the final screenful is displayed. Warn-
CAVEATS ing: some systems use ^V as a special literaliza-
Large gaps in uid numbers will cause the lastlog program tion character.
to run longer with no output to the screen (i.e. if
mmdf=800 and last uid=170, program will appear to hang as z Like SPACE, but if N is specified, it becomes the
it processes uid 171-799). new window size.

AUTHORS ESC-SPACE

&- &&
Like SPACE, but scrolls a full screenful, even if if N is not specified and standard input, rather
it reaches end-of-file in the process. than a file, is being read.)

RETURN or ^N or e or ^E or j or ^J p or % Go to a position N percent into the file. N should


Scroll forward N lines, default 1. The entire N be between 0 and 100.
lines are displayed, even if N is more than the
screen size. { If a left curly bracket appears in the top line
displayed on the screen, the { command will go to
d or ^D the matching right curly bracket. The matching
Scroll forward N lines, default one half of the right curly bracket is positioned on the bottom
screen size. If N is specified, it becomes the new line of the screen. If there is more than one left
default for subsequent d and u commands. curly bracket on the top line, a number N may be
used to specify the N-th bracket on the line.
b or ^B or ESC-v
Scroll backward N lines, default one window (see } If a right curly bracket appears in the bottom line
option -z below). If N is more than the screen displayed on the screen, the } command will go to
size, only the final screenful is displayed. the matching left curly bracket. The matching left
curly bracket is positioned on the top line of the
w Like ESC-v, but if N is specified, it becomes the screen. If there is more than one right curly
new window size. bracket on the top line, a number N may be used to
specify the N-th bracket on the line.
y or ^Y or ^P or k or ^K
Scroll backward N lines, default 1. The entire N ( Like {, but applies to parentheses rather than
lines are displayed, even if N is more than the curly brackets.
screen size. Warning: some systems use ^Y as a
special job control character. ) Like }, but applies to parentheses rather than
curly brackets.
u or ^U
Scroll backward N lines, default one half of the [ Like {, but applies to square brackets rather than
screen size. If N is specified, it becomes the new curly brackets.
default for subsequent d and u commands.
] Like }, but applies to square brackets rather than
ESC-) or RIGHTARROW curly brackets.
Scroll horizontally right N characters, default
half the screen width (see the -# option). While ESC-^F Followed by two characters, acts like {, but uses
the text is scrolled, it acts as though the -S the two characters as open and close brackets,
option (chop lines) were in effect. Note that if respectively. For example, "ESC ^F < >" could be
you wish to enter a number N, you must use ESC-), used to go forward to the > which matches the < in
not RIGHTARROW, because the arrow is taken to be a the top displayed line.
line editing command (see the LINE EDITING sec-
tion). ESC-^B Followed by two characters, acts like }, but uses
the two characters as open and close brackets,
ESC-( or LEFTARROW respectively. For example, "ESC ^B < >" could be
Scroll horizontally left N characters, default half used to go backward to the < which matches the > in
the screen width (see the -# option). the bottom displayed line.

r or ^R or ^L m Followed by any lowercase letter, marks the current


Repaint the screen. position with that letter.

R Repaint the screen, discarding any buffered input. ' (Single quote.) Followed by any lowercase letter,
Useful if the file is changing while it is being returns to the position which was previously marked
viewed. with that letter. Followed by another single
quote, returns to the position at which the last
F Scroll forward, and keep trying to read when the "large" movement command was executed. Followed by
end of file is reached. Normally this command a ^ or $, jumps to the beginning or end of the file
would be used when already at the end of the file. respectively. Marks are preserved when a new file
It is a way to monitor the tail of a file which is is examined, so the ' command can be used to switch
growing while it is being viewed. (The behavior is between input files.
similar to the "tail -f" command.)
^X^X Same as single quote.
g or < or ESC-<
Go to line N in the file, default 1 (beginning of /pattern
file). (Warning: this may be slow if N is large.) Search forward in the file for the N-th line con-
taining the pattern. N defaults to 1. The pattern
G or > or ESC-> is a regular expression, as recognized by ed. The
Go to line N in the file, default the end of the search starts at the second line displayed (but see
file. (Warning: this may be slow if N is large, or the -a and -j options, which change this).
&0 0*
the last pattern. If the previous search was modi-
Certain characters are special if entered at the fied by ^N, the search is made for the N-th line
beginning of the pattern; they modify the type of NOT containing the pattern. If the previous search
search rather than become part of the pattern: was modified by ^E, the search continues in the
next (or previous) file if not satisfied in the
^N or ! current file. If the previous search was modified
Search for lines which do NOT match the by ^R, the search is done without using regular
pattern. expressions. There is no effect if the previous
search was modified by ^F or ^K.
^E or *
Search multiple files. That is, if the N Repeat previous search, but in the reverse direc-
search reaches the END of the current file tion.
without finding a match, the search contin-
ues in the next file in the command line ESC-n Repeat previous search, but crossing file bound-
list. aries. The effect is as if the previous search
were modified by *.
^F or @
Begin the search at the first line of the ESC-N Repeat previous search, but in the reverse direc-
FIRST file in the command line list, regard- tion and crossing file boundaries.
less of what is currently displayed on the
screen or the settings of the -a or -j ESC-u Undo search highlighting. Turn off highlighting of
options. strings matching the current search pattern. If
highlighting is already off because of a previous
^K Highlight any text which matches the pattern ESC-u command, turn highlighting back on. Any
on the current screen, but don't move to the search command will also turn highlighting back on.
first match (KEEP current position). (Highlighting can also be disabled by toggling the
-G option; in that case search commands do not turn
^R Don't interpret regular expression metachar- highlighting back on.)
acters; that is, do a simple textual compar-
ison. :e [filename]
Examine a new file. If the filename is missing,
?pattern the "current" file (see the :n and :p commands
Search backward in the file for the N-th line con- below) from the list of files in the command line
taining the pattern. The search starts at the line is re-examined. A percent sign (%) in the filename
immediately before the top line displayed. is replaced by the name of the current file. A
pound sign (#) is replaced by the name of the pre-
Certain characters are special as in the / command: viously examined file. However, two consecutive
percent signs are simply replaced with a single
^N or ! percent sign. This allows you to enter a filename
Search for lines which do NOT match the pat- that contains a percent sign in the name. Simi-
tern. larly, two consecutive pound signs are replaced
with a single pound sign. The filename is inserted
^E or * into the command line list of files so that it can
Search multiple files. That is, if the be seen by subsequent :n and :p commands. If the
search reaches the beginning of the current filename consists of several files, they are all
file without finding a match, the search inserted into the list of files and the first one
continues in the previous file in the com- is examined. If the filename contains one or more
mand line list. spaces, the entire filename should be enclosed in
double quotes (also see the -" option).
^F or @
Begin the search at the last line of the ^X^V or E
last file in the command line list, regard- Same as :e. Warning: some systems use ^V as a spe-
less of what is currently displayed on the cial literalization character. On such systems,
screen or the settings of the -a or -j you may not be able to use ^V.
options.
:n Examine the next file (from the list of files given
^K As in forward searches. in the command line). If a number N is specified,
the N-th next file is examined.
^R As in forward searches.
:p Examine the previous file in the command line list.
ESC-/pattern If a number N is specified, the N-th previous file
Same as "/*". is examined.

ESC-?pattern :x Examine the first file in the command line list.


Same as "?*". If a number N is specified, the N-th file in the
list is examined.
n Repeat previous search, for N-th line containing
0 0
:d Remove the current file from the list of files.
The following four commands may or may not be valid,
= or ^G or :f depending on your particular installation.
Prints some information about the file being
viewed, including its name and the line number and
byte offset of the bottom line being displayed. If v Invokes an editor to edit the current file being
possible, it also prints the length of the file, viewed. The editor is taken from the environment
the number of lines in the file and the percent of variable VISUAL if defined, or EDITOR if VISUAL is
the file above the last displayed line. not defined, or defaults to "vi" if neither VISUAL
nor EDITOR is defined. See also the discussion of
- Followed by one of the command line option letters LESSEDIT under the section on PROMPTS below.
(see OPTIONS below), this will change the setting
of that option and print a message describing the ! shell-command
new setting. If a ^P (CONTROL-P) is entered imme- Invokes a shell to run the shell-command given. A
diately after the dash, the setting of the option percent sign (%) in the command is replaced by the
is changed but no message is printed. If the name of the current file. A pound sign (#) is
option letter has a numeric value (such as -b or replaced by the name of the previously examined
-h), or a string value (such as -P or -t), a new file. "!!" repeats the last shell command. "!"
value may be entered after the option letter. If with no shell command simply invokes a shell. On
no new value is entered, a message describing the Unix systems, the shell is taken from the environ-
current setting is printed and nothing is changed. ment variable SHELL, or defaults to "sh". On MS-
DOS and OS/2 systems, the shell is the normal com-
-- Like the - command, but takes a long option name mand processor.
(see OPTIONS below) rather than a single option
letter. You must press RETURN after typing the | <m> shell-command
option name. A ^P immediately after the second <m> represents any mark letter. Pipes a section of
dash suppresses printing of a message describing the input file to the given shell command. The
the new setting, as in the - command. section of the file to be piped is between the
first line on the current screen and the position
-+ Followed by one of the command line option letters marked by the letter. <m> may also be ^ or $ to
this will reset the option to its default setting indicate beginning or end of file respectively. If
and print a message describing the new setting. <m> is . or newline, the current screen is piped.
(The "-+X" command does the same thing as "-+X" on
the command line.) This does not work for string- s filename
valued options. Save the input to a file. This only works if the
input is a pipe, not an ordinary file.
--+ Like the -+ command, but takes a long option name
rather than a single option letter.
OPTIONS
-! Followed by one of the command line option letters, Command line options are described below. Most options
this will reset the option to the "opposite" of its may be changed while less is running, via the "-" command.
default setting and print a message describing the
new setting. This does not work for numeric or Most options may be given in one of two forms: either a
string-valued options. dash followed by a single letter, or two dashes followed
by a long option name. A long option name may be abbrevi-
--! Like the -! command, but takes a long option name ated as long as the abbreviation is unambiguous. For
rather than a single option letter. example, --quit-at-eof may be abbreviated --quit, but not
--qui, since both --quit-at-eof and --quiet begin with
_ (Underscore.) Followed by one of the command line --qui. Some long option names are in uppercase, such as
option letters, this will print a message describ- --QUIT-AT-EOF, as distinct from --quit-at-eof. Such
ing the current setting of that option. The set- option names need only have their first letter capital-
ting of the option is not changed. ized; the remainder of the name may be in either case.
For example, --Quit-at-eof is equivalent to --QUIT-AT-EOF.
__ (Double underscore.) Like the _ (underscore) com-
mand, but takes a long option name rather than a Options are also taken from the environment variable
single option letter. You must press RETURN after "LESS". For example, to avoid typing "less -options ..."
typing the option name. each time less is invoked, you might tell csh:

+cmd Causes the specified cmd to be executed each time a setenv LESS "-options"
new file is examined. For example, +G causes less
to initially display each file starting at the end or if you use sh:
rather than the beginning.
LESS="-options"; export LESS
V Prints the version number of less being run.
On MS-DOS, you don't need the quotes, but you should
q or Q or :q or :Q or ZZ replace any percent signs in the options string by double
Exits less. percent signs.
0 0!
[MS-DOS only] Sets the color of the text displayed.
The environment variable is parsed before the command x is a single character which selects the type of
line, so command line options override the LESS text whose color is being set: n=normal, s=stand-
environment variable. If an option appears in the LESS out, d=bold, u=underlined, k=blink. color is a
variable, it can be reset to its default value on the com- pair of numbers separated by a period. The first
mand line by beginning the command line option with "-+". number selects the foreground color and the second
selects the background color of the text. A single
For options like -P or -D which take a following string, a number N is the same as N.0.
dollar sign ($) must be used to signal the end of the
string. For example, to set two -D options on MS-DOS, you -e or --quit-at-eof
must have a dollar sign between them, like this: Causes less to automatically exit the second time
it reaches end-of-file. By default, the only way
LESS="-Dn9.1$-Ds4.1" to exit less is via the "q" command.

-E or --QUIT-AT-EOF
-? or --help Causes less to automatically exit the first time it
This option displays a summary of the commands reaches end-of-file.
accepted by less (the same as the h command).
(Depending on how your shell interprets the ques- -f or --force
tion mark, it may be necessary to quote the ques- Forces non-regular files to be opened. (A non-reg-
tion mark, thus: "-\?".) ular file is a directory or a device special file.)
Also suppresses the warning message when a binary
-a or --search-skip-screen file is opened. By default, less will refuse to
Causes searches to start after the last line dis- open non-regular files.
played on the screen, thus skipping all lines dis-
played on the screen. By default, searches start -F or --quit-if-one-screen
at the second line on the screen (or after the last Causes less to automatically exit if the entire
found line; see the -j option). file can be displayed on the first screen.

-bn or --buffers=n -g or --hilite-search


Specifies the number of buffers less will use for Normally, less will highlight ALL strings which
each file. Buffers are 1K, and by default 10 match the last search command. The -g option
buffers are used for each file (except if the file changes this behavior to highlight only the partic-
is a pipe; see the -B option). The number n speci- ular string which was found by the last search com-
fies a different number of buffers to use. mand. This can cause less to run somewhat faster
than the default.
-B or --auto-buffers
By default, when data is read from a pipe, buffers -G or --HILITE-SEARCH
are allocated automatically as needed. If a large The -G option suppresses all highlighting of
amount of data is read from the pipe, this can strings found by search commands.
cause a large amount of memory to be allocated.
The -B option disables this automatic allocation of -hn or ---max-back-scroll=n
buffers for pipes, so that only the number of Specifies a maximum number of lines to scroll back-
buffers specified by the -b option are used. Warn- ward. If it is necessary to scroll backward more
ing: use of -B can result in erroneous display, than n lines, the screen is repainted in a forward
since only the most recently viewed part of the direction instead. (If the terminal does not have
file is kept in memory; any earlier data is lost. the ability to scroll backward, -h0 is implied.)

-c or --clear-screen -i or --ignore-case
Causes full screen repaints to be painted from the Causes searches to ignore case; that is, uppercase
top line down. By default, full screen repaints and lowercase are considered identical. This
are done by scrolling from the bottom of the option is ignored if any uppercase letters appear
screen. in the search pattern; in other words, if a pattern
contains uppercase letters, then that search does
-C or --CLEAR-SCREEN not ignore case.
The -C option is like -c, but the screen is cleared
before it is repainted. -I or --IGNORE-CASE
Like -i, but searches ignore case even if the pat-
-d or --dumb tern contains uppercase letters.
The -d option suppresses the error message normally
displayed if the terminal is dumb; that is, lacks -jn or --jump-target=n
some important capability, such as the ability to Specifies a line on the screen where the "target"
clear the screen or scroll backward. The -d option line is to be positioned. A target line is the
does not otherwise change the behavior of less on a object of a text search, tag search, jump to a line
dumb terminal). number, jump to a file percentage, or jump to a
marked position. The screen line is specified by a
-Dxcolor or --color=xcolor number: the top line on the screen is 1, the next
0 0'
is 2, and so on. The number may be negative to start at the first occurrence of pattern in the
specify a line relative to the bottom of the file.
screen: the bottom line on the screen is -1, the
second to the bottom is -2, and so on. If the -j -Pprompt or --prompt=prompt
option is used, searches begin at the line immedi- Provides a way to tailor the three prompt styles to
ately after the target line. For example, if "-j4" your own preference. This option would normally be
is used, the target line is the fourth line on the put in the LESS environment variable, rather than
screen, so searches begin at the fifth line on the being typed in with each less command. Such an
screen. option must either be the last option in the LESS
variable, or be terminated by a dollar sign. -Ps
-J or --status-column followed by a string changes the default (short)
Displays a status column at the left edge of the prompt to that string. -Pm changes the medium (-m)
screen. The status column is used only if the -w prompt. -PM changes the long (-M) prompt. -Ph
or -W option is in effect. changes the prompt for the help screen. -P=
changes the message printed by the = command. All
-kfilename or --lesskey-file=filename prompt strings consist of a sequence of letters and
Causes less to open and interpret the named file as special escape sequences. See the section on
a lesskey (1) file. Multiple -k options may be PROMPTS for more details.
specified. If the LESSKEY or LESSKEY_SYSTEM envi-
ronment variable is set, or if a lesskey file is -q or --quiet or --silent
found in a standard place (see KEY BINDINGS), it is Causes moderately "quiet" operation: the terminal
also used as a lesskey file. bell is not rung if an attempt is made to scroll
past the end of the file or before the beginning of
-m or --long-prompt the file. If the terminal has a "visual bell", it
Causes less to prompt verbosely (like more), with is used instead. The bell will be rung on certain
the percent into the file. By default, less other errors, such as typing an invalid character.
prompts with a colon. The default is to ring the terminal bell in all
such cases.
-M or --LONG-PROMPT
Causes less to prompt even more verbosely than -Q or --QUIET or --SILENT
more. Causes totally "quiet" operation: the terminal bell
is never rung.
-n or --line-numbers
Suppresses line numbers. The default (to use line -r or --raw-control-chars
numbers) may cause less to run more slowly in some Causes "raw" control characters to be displayed.
cases, especially with a very large input file. The default is to display control characters using
Suppressing line numbers with the -n option will the caret notation; for example, a control-A (octal
avoid this problem. Using line numbers means: the 001) is displayed as "^A". Warning: when the -r
line number will be displayed in the verbose prompt option is used, less cannot keep track of the
and in the = command, and the v command will pass actual appearance of the screen (since this depends
the current line number to the editor (see also the on how the screen responds to each type of control
discussion of LESSEDIT in PROMPTS below). character). Thus, various display problems may
result, such as long lines being split in the wrong
-N or --LINE-NUMBERS place.
Causes a line number to be displayed at the begin-
ning of each line in the display. -R or --RAW-CONTROL-CHARS
Like -r, but tries to keep track of the screen
-ofilename or --log-file=filename appearance where possible. This works only if the
Causes less to copy its input to the named file as input consists of normal text and possibly some
it is being viewed. This applies only when the ANSI "color" escape sequences, which are sequences
input file is a pipe, not an ordinary file. If the of the form:
file already exists, less will ask for confirmation
before overwriting it. ESC [ ... m

-Ofilename or --LOG-FILE=filename where the "..." is zero or more characters other


The -O option is like -o, but it will overwrite an than "m". For the purpose of keeping track of
existing file without asking for confirmation. screen appearance, all control characters and all
ANSI color escape sequences are assumed to not move
If no log file has been specified, the -o and -O the cursor. You can make less think that charac-
options can be used from within less to specify a ters other than "m" can end ANSI color escape
log file. Without a file name, they will simply sequences by setting the environment variable
report the name of the log file. The "s" command LESSANSIENDCHARS to the list of characters which
is equivalent to specifying -o from within less. can end a color escape sequence.

-ppattern or --pattern=pattern -s or --squeeze-blank-lines


The -p option on the command line is equivalent to Causes consecutive blank lines to be squeezed into
specifying +/pattern; that is, it tells less to a single blank line. This is useful when viewing
0- 0&
nroff output. Sets tab stops every n positions. The default for
n is 8.
-S or --chop-long-lines
Causes lines longer than the screen width to be -X or --no-init
chopped rather than folded. That is, the remainder Disables sending the termcap initialization and
of a long line is simply discarded. The default is deinitialization strings to the terminal. This is
to fold long lines; that is, display the remainder sometimes desirable if the deinitialization string
on the next line. does something unnecessary, like clearing the
screen.
-ttag or --tag=tag
The -t option, followed immediately by a TAG, will -yn or --max-forw-scroll=n
edit the file containing that tag. For this to Specifies a maximum number of lines to scroll for-
work, there must be a file called "tags" in the ward. If it is necessary to scroll forward more
current directory, which was previously built by than n lines, the screen is repainted instead. The
the ctags (1) command. This option may also be -c or -C option may be used to repaint from the top
specified from within less (using the - command) as of the screen if desired. By default, any forward
a way of examining a new file. The command ":t" is movement causes scrolling.
equivalent to specifying -t from within less.
-[z]n or --window=n
-Ttagsfile or --tag-file=tagsfile Changes the default scrolling window size to n
Specifies a tags file to be used instead of "tags". lines. The default is one screenful. The z and w
commands can also be used to change the window
-u or --underline-special size. The "z" may be omitted for compatibility
Causes backspaces and carriage returns to be with more. If the number n is negative, it indi-
treated as printable characters; that is, they are cates n lines less than the current screen size.
sent to the terminal when they appear in the input. For example, if the screen is 24 lines, -z-4 sets
the scrolling window to 20 lines. If the screen is
-U or --UNDERLINE-SPECIAL resized to 40 lines, the scrolling window automati-
Causes backspaces, tabs and carriage returns to be cally changes to 36 lines.
treated as control characters; that is, they are
handled as specified by the -r option. -"cc or --quotes=cc
Changes the filename quoting character. This may
By default, if neither -u nor -U is given, be necessary if you are trying to name a file which
backspaces which appear adjacent to an underscore contains both spaces and quote characters. Fol-
character are treated specially: the underlined lowed by a single character, this changes the quote
text is displayed using the terminal's hardware character to that character. Filenames containing
underlining capability. Also, backspaces which a space should then be surrounded by that character
appear between two identical characters are treated rather than by double quotes. Followed by two
specially: the overstruck text is printed using the characters, changes the open quote to the first
terminal's hardware boldface capability. Other character, and the close quote to the second char-
backspaces are deleted, along with the preceding acter. Filenames containing a space should then be
character. Carriage returns immediately followed preceded by the open quote character and followed
by a newline are deleted. other carriage returns by the close quote character. Note that even after
are handled as specified by the -r option. Text the quote characters are changed, this option
which is overstruck or underlined can be searched remains -" (a dash followed by a double quote).
for if neither -u nor -U is in effect.
-~ or --tilde
-V or --version Normally lines after end of file are displayed as a
Displays the version number of less. single tilde (~). This option causes lines after
end of file to be displayed as blank lines.
-w or --hilite-unread
Temporarily highlights the first "new" line after a -# or --shift
forward movement of a full page. The first "new" Specifies the default number of positions to scroll
line is the line immediately following the line horizontally in the RIGHTARROW and LEFTARROW com-
previously at the bottom of the screen. Also high- mands. If the number specified is zero, it sets
lights the target line after a g or p command. The the default number of positions to one half of the
highlight is removed at the next command which screen width.
causes movement. The entire line is highlighted,
unless the -J option is in effect, in which case -- A command line argument of "--" marks the end of
only the status column is highlighted. option arguments. Any arguments following this are
interpreted as filenames. This can be useful when
-W or --HILITE-UNREAD viewing a file whose name begins with a "-" or "+".
Like -w, but temporarily highlights the first new
line after any forward movement command larger than + If a command line option begins with +, the
one line. remainder of that option is taken to be an initial
command to less. For example, +G tells less to
-xn or --tabs=n start at the end of the file rather than the begin-
00 **
ning, and +/xyz tells it to start at the first first match is entered into the command line.
occurrence of "xyz" in the file. As a special Repeated TABs will cycle thru the other matching
case, +<number> acts like +<number>g; that is, it filenames. If the completed filename is a direc-
starts the display at the specified line number tory, a "/" is appended to the filename. (On MS-
(however, see the caveat under the "g" command DOS systems, a "\" is appended.) The environment
above). If the option starts with ++, the initial variable LESSSEPARATOR can be used to specify a
command applies to every file being viewed, not different character to append to a directory name.
just the first one. The + command described previ-
ously may also be used to set (or change) an ini- BACKTAB [ ESC-TAB ]
tial command for every file. Like, TAB, but cycles in the reverse direction thru
the matching filenames.

LINE EDITING ^L Complete the partial filename to the left of the


When entering command line at the bottom of the screen cursor. If it matches more than one filename, all
(for example, a filename for the :e command, or the pat- matches are entered into the command line (if they
tern for a search command), certain keys can be used to fit).
manipulate the command line. Most commands have an alter-
nate form in [ brackets ] which can be used if a key does ^U (Unix) or ESC (MS-DOS)
not exist on a particular keyboard. (The bracketed forms Delete the entire command line, or cancel the com-
do not work in the MS-DOS version.) Any of these special mand if the command line is empty. If you have
keys may be entered literally by preceding it with the changed your line-kill character in Unix to some-
"literal" character, either ^V or ^A. A backslash itself thing other than ^U, that character is used instead
may also be entered literally by entering two backslashes. of ^U.

LEFTARROW [ ESC-h ]
Move the cursor one space to the left. KEY BINDINGS
You may define your own less commands by using the program
RIGHTARROW [ ESC-l ] lesskey (1) to create a lesskey file. This file specifies
Move the cursor one space to the right. a set of command keys and an action associated with each
key. You may also use lesskey to change the line-editing
^LEFTARROW [ ESC-b or ESC-LEFTARROW ] keys (see LINE EDITING), and to set environment variables.
(That is, CONTROL and LEFTARROW simultaneously.) If the environment variable LESSKEY is set, less uses that
Move the cursor one word to the left. as the name of the lesskey file. Otherwise, less looks in
a standard place for the lesskey file: On Unix systems,
^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] less looks for a lesskey file called "$HOME/.less". On
(That is, CONTROL and RIGHTARROW simultaneously.) MS-DOS and Windows systems, less looks for a lesskey file
Move the cursor one word to the right. called "$HOME/_less", and if it is not found there, then
looks for a lesskey file called "_less" in any directory
HOME [ ESC-0 ] specified in the PATH environment variable. On OS/2 sys-
Move the cursor to the beginning of the line. tems, less looks for a lesskey file called
"$HOME/less.ini", and if it is not found, then looks for a
END [ ESC-$ ] lesskey file called "less.ini" in any directory specified
Move the cursor to the end of the line. in the INIT environment variable, and if it not found
there, then looks for a lesskey file called "less.ini" in
BACKSPACE any directory specified in the PATH environment variable.
Delete the character to the left of the cursor, or See the lesskey manual page for more details.
cancel the command if the command line is empty.
A system-wide lesskey file may also be set up to provide
DELETE or [ ESC-x ] key bindings. If a key is defined in both a local lesskey
Delete the character under the cursor. file and in the system-wide file, key bindings in the
local file take precedence over those in the system-wide
^BACKSPACE [ ESC-BACKSPACE ] file. If the environment variable LESSKEY_SYSTEM is set,
(That is, CONTROL and BACKSPACE simultaneously.) less uses that as the name of the system-wide lesskey
Delete the word to the left of the cursor. file. Otherwise, less looks in a standard place for the
system-wide lesskey file: On Unix systems, the system-wide
^DELETE [ ESC-X or ESC-DELETE ] lesskey file is /usr/local/bin/.sysless. (However, if
(That is, CONTROL and DELETE simultaneously.) less was built with a different binary directory than
Delete the word under the cursor. /usr/local/bin, that directory is where the .sysless file
is found.) On MS-DOS and Windows systems, the system-wide
UPARROW [ ESC-k ] lesskey file is c:\_sysless. On OS/2 systems, the system-
Retrieve the previous command line. wide lesskey file is c:\sysless.ini.

DOWNARROW [ ESC-j ]
Retrieve the next command line. INPUT PREPROCESSOR
You may define an "input preprocessor" for less. Before
TAB Complete the partial filename to the left of the less opens a file, it first gives your input preprocessor
cursor. If it matches more than one filename, the a chance to modify the way the contents of the file are
* *
displayed. An input preprocessor is simply an executable pipe. An input pipe, instead of writing the name of a
program (or shell script), which writes the contents of replacement file on its standard output, writes the entire
the file to a different file, called the replacement file. contents of the replacement file on its standard output.
The contents of the replacement file are then displayed in If the input pipe does not write any characters on its
place of the contents of the original file. However, it standard output, then there is no replacement file and
will appear to the user as if the original file is opened; less uses the original file, as normal. To use an input
that is, less will display the original filename as the pipe, make the first character in the LESSOPEN environment
name of the current file. variable a vertical bar (|) to signify that the input pre-
processor is an input pipe.
An input preprocessor receives one command line argument,
the original filename, as entered by the user. It should For example, on many Unix systems, this script will work
create the replacement file, and when finished, print the like the previous example scripts:
name of the replacement file to its standard output. If
the input preprocessor does not output a replacement file- lesspipe.sh:
name, less uses the original file, as normal. The input #! /bin/sh
preprocessor is not called when viewing standard input. case "$1" in
To set up an input preprocessor, set the LESSOPEN environ- *.Z) uncompress -c $1 2>/dev/null
ment variable to a command line which will invoke your ;;
input preprocessor. This command line should include one esac
occurrence of the string "%s", which will be replaced by
the filename when the input preprocessor command is To use this script, put it where it can be executed and
invoked. set LESSOPEN="|lesspipe.sh %s". When an input pipe is
used, a LESSCLOSE postprocessor can be used, but it is
When less closes a file opened in such a way, it will call usually not necessary since there is no replacement file
another program, called the input postprocessor, which may to clean up. In this case, the replacement file name
perform any desired clean-up action (such as deleting the passed to the LESSCLOSE postprocessor is "-".
replacement file created by LESSOPEN). This program
receives two command line arguments, the original filename
as entered by the user, and the name of the replacement NATIONAL CHARACTER SETS
file. To set up an input postprocessor, set the LESSCLOSE There are three types of characters in the input file:
environment variable to a command line which will invoke
your input postprocessor. It may include two occurrences normal characters
of the string "%s"; the first is replaced with the origi- can be displayed directly to the screen.
nal name of the file and the second with the name of the
replacement file, which was output by LESSOPEN. control characters
should not be displayed directly, but are expected
For example, on many Unix systems, these two scripts will to be found in ordinary text files (such as
allow you to keep files in compressed format, but still backspace and tab).
let less view them directly:
binary characters
lessopen.sh: should not be displayed directly and are not
#! /bin/sh expected to be found in text files.
case "$1" in
*.Z) uncompress -c $1 >/tmp/less.$$ 2>/dev/null A "character set" is simply a description of which charac-
if [ -s /tmp/less.$$ ]; then ters are to be considered normal, control, and binary.
echo /tmp/less.$$ The LESSCHARSET environment variable may be used to select
else a character set. Possible values for LESSCHARSET are:
rm -f /tmp/less.$$
fi ascii BS, TAB, NL, CR, and formfeed are control charac-
;; ters, all chars with values between 32 and 126 are
esac normal, and all others are binary.

lessclose.sh: iso8859
#! /bin/sh Selects an ISO 8859 character set. This is the
rm $2 same as ASCII, except characters between 160 and
255 are treated as normal characters.
To use these scripts, put them both where they can be exe-
cuted and set LESSOPEN="lessopen.sh %s", and LESS- latin1 Same as iso8859.
CLOSE="lessclose.sh %s %s". More complex LESSOPEN and
LESSCLOSE scripts may be written to accept other types of dos Selects a character set appropriate for MS-DOS.
compressed files, and so on.
ebcdic Selects an EBCDIC character set.
It is also possible to set up an input preprocessor to
pipe the file data directly to less, rather than putting koi8-r Selects a Russian character set.
the data into a replacement file. This avoids the need to
decompress the entire file before starting to view it. An next Selects a character set appropriate for NeXT com-
input preprocessor that works this way is called an input puters.
* *!
rather complicated to provide flexibility, but the ordi-
utf-8 Selects the UTF-8 encoding of the ISO 10646 charac- nary user need not understand the details of constructing
ter set. personalized prompt strings.

If the LESSCHARSET environment variable is not set, the A percent sign followed by a single character is expanded
default character set is latin1. However, if the string according to what the following character is:
"UTF-8" is found in the LC_ALL, LC_CTYPE or LANG environ-
ment variables, then the default character set is utf-8 %bX Replaced by the byte offset into the current input
instead. file. The b is followed by a single character
(shown as X above) which specifies the line whose
In special cases, it may be desired to tailor less to use byte offset is to be used. If the character is a
a character set other than the ones definable by LESS- "t", the byte offset of the top line in the display
CHARSET. In this case, the environment variable LESS- is used, an "m" means use the middle line, a "b"
CHARDEF can be used to define a character set. It should means use the bottom line, a "B" means use the line
be set to a string where each character in the string rep- just after the bottom line, and a "j" means use the
resents one character in the character set. The character "target" line, as specified by the -j option.
"." is used for a normal character, "c" for control, and
"b" for binary. A decimal number may be used for repeti- %B Replaced by the size of the current input file.
tion. For example, "bccc4b." would mean character 0 is
binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, %c Replaced by the column number of the text appearing
and 8 is normal. All characters after the last are taken in the first column of the screen.
to be the same as the last, so characters 9 through 255
would be normal. (This is an example, and does not neces- %dX Replaced by the page number of a line in the input
sarily represent any real character set.) file. The line to be used is determined by the X,
as with the %b option.
This table shows the value of LESSCHARDEF which is equiva-
lent to each of the possible values for LESSCHARSET: %D Replaced by the number of pages in the input file,
or equivalently, the page number of the last line
ascii 8bcccbcc18b95.b in the input file.
dos 8bcccbcc12bc5b95.b.
ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b %E Replaced by the name of the editor (from the VISUAL
9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. environment variable, or the EDITOR environment
iso8859 8bcccbcc18b95.33b. variable if VISUAL is not defined). See the dis-
koi8-r 8bcccbcc18b95.b128. cussion of the LESSEDIT feature below.
latin1 8bcccbcc18b95.33b.
next 8bcccbcc18b95.bb125.bb %f Replaced by the name of the current input file.

If neither LESSCHARSET nor LESSCHARDEF is set, but your %i Replaced by the index of the current file in the
system supports the setlocale interface, less will use list of input files.
setlocale to determine the character set. setlocale is
controlled by setting the LANG or LC_CTYPE environment %lX Replaced by the line number of a line in the input
variables. file. The line to be used is determined by the X,
as with the %b option.
Control and binary characters are displayed in standout
(reverse video). Each such character is displayed in %L Replaced by the line number of the last line in the
caret notation if possible (e.g. ^A for control-A). Caret input file.
notation is used only if inverting the 0100 bit results in
a normal printable character. Otherwise, the character is %m Replaced by the total number of input files.
displayed as a hex number in angle brackets. This format
can be changed by setting the LESSBINFMT environment vari- %pX Replaced by the percent into the current input
able. LESSBINFMT may begin with a "*" and one character file, based on byte offsets. The line used is
to select the display attribute: "*k" is blinking, "*d" is determined by the X as with the %b option.
bold, "*u" is underlined, "*s" is standout, and "*n" is
normal. If LESSBINFMT does not begin with a "*", normal %PX Replaced by the percent into the current input
attribute is assumed. The remainder of LESSBINFMT is a file, based on line numbers. The line used is
string which may include one printf-style escape sequence determined by the X as with the %b option.
(a % followed by x, X, o, d, etc.). For example, if LESS-
BINFMT is "*u[%x]", binary characters are displayed in %s Same as %B.
underlined hexadecimal surrounded by brackets. The
default if no LESSBINFMT is specified is "*s<%X>". %t Causes any trailing spaces to be removed. Usually
used at the end of the string, but may appear any-
where.
PROMPTS
The -P option allows you to tailor the prompt to your %x Replaced by the name of the next input file in the
preference. The string given to the -P option replaces list.
the specified prompt string. Certain characters in the
string are interpreted specially. The prompt mechanism is If any item is unknown (for example, the file size if
* *'
input is a pipe), a question mark is printed instead. ?f%f:Standard input.

The format of the prompt string can be changed depending This prompt prints the filename, if known; otherwise the
on certain conditions. A question mark followed by a sin- string "Standard input".
gle character acts like an "IF": depending on the follow-
ing character, a condition is evaluated. If the condition ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...
is true, any characters following the question mark and
condition character, up to a period, are included in the This prompt would print the filename, if known. The file-
prompt. If the condition is false, such characters are name is followed by the line number, if known, otherwise
not included. A colon appearing between the question mark the percent if known, otherwise the byte offset if known.
and the period can be used to establish an "ELSE": any Otherwise, a dash is printed. Notice how each question
characters between the colon and the period are included mark has a matching period, and how the % after the %pt is
in the string if and only if the IF condition is false. included literally by escaping it with a backslash.
Condition characters (which follow a question mark) may
be: ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t

?a True if any characters have been included in the This prints the filename if this is the first prompt in a
prompt so far. file, followed by the "file N of N" message if there is
more than one input file. Then, if we are at end-of-file,
?bX True if the byte offset of the specified line is the string "(END)" is printed followed by the name of the
known. next file, if there is one. Finally, any trailing spaces
are truncated. This is the default prompt. For refer-
?B True if the size of current input file is known. ence, here are the defaults for the other two prompts (-m
and -M respectively). Each is broken into two lines here
?c True if the text is horizontally shifted (%c is not for readability only.
zero).
?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.:
?dX True if the page number of the specified line is ?pB%pB\%:byte %bB?s/%s...%t
known.
?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. :
?e True if at end-of-file. byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t

?f True if there is an input filename (that is, if And here is the default message produced by the = command:
input is not a pipe).
?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .
?lX True if the line number of the specified line is byte %bB?s/%s. ?e(END) :?pB%pB\%..%t
known.
The prompt expansion features are also used for another
?L True if the line number of the last line in the purpose: if an environment variable LESSEDIT is defined,
file is known. it is used as the command to be executed when the v com-
mand is invoked. The LESSEDIT string is expanded in the
?m True if there is more than one input file. same way as the prompt strings. The default value for
LESSEDIT is:
?n True if this is the first prompt in a new input
file. %E ?lm+%lm. %f

?pX True if the percent into the current input file, Note that this expands to the editor name, followed by a +
based on byte offsets, of the specified line is and the line number, followed by the file name. If your
known. editor does not accept the "+linenumber" syntax, or has
other differences in invocation syntax, the LESSEDIT vari-
?PX True if the percent into the current input file, able can be changed to modify this default.
based on line numbers, of the specified line is
known.
SECURITY
?s Same as "?B". When the environment variable LESSSECURE is set to 1, less
runs in a "secure" mode. This means these features are
?x True if there is a next input file (that is, if the disabled:
current input file is not the last one).
! the shell command
Any characters other than the special ones (question mark,
colon, period, percent, and backslash) become literally | the pipe command
part of the prompt. Any of the special characters may be
included in the prompt literally by preceding it with a :e the examine command.
backslash.
v the editing command
Some examples:
s -o log files
*- *&
Command line to invoke the (optional) input-post-
-k use of lesskey files processor.

-t use of tags files LESSECHO


Name of the lessecho program (default "lessecho").
metacharacters in filenames, such as * The lessecho program is needed to expand metachar-
acters, such as * and ?, in filenames on Unix sys-
filename completion (TAB, ^L) tems.

Less can also be compiled to be permanently in "secure" LESSEDIT


mode. Editor prototype string (used for the v command).
See discussion under PROMPTS.

ENVIRONMENT VARIABLES LESSKEY


Environment variables may be specified either in the sys- Name of the default lesskey(1) file.
tem environment as usual, or in a lesskey (1) file. If
environment variables are defined in more than one place, LESSKEY_SYSTEM
variables defined in a local lesskey file take precedence Name of the default system-wide lesskey(1) file.
over variables defined in the system environment, which
take precedence over variables defined in the system-wide LESSMETACHARS
lesskey file. List of characters which are considered "metachar-
acters" by the shell.
COLUMNS
Sets the number of columns on the screen. Takes LESSMETAESCAPE
precedence over the number of columns specified by Prefix which less will add before each metacharac-
the TERM variable. (But if you have a windowing ter in a command sent to the shell. If LESS-
system which supports TIOCGWINSZ or WIOCGETD, the METAESCAPE is an empty string, commands containing
window system's idea of the screen size takes metacharacters will not be passed to the shell.
precedence over the LINES and COLUMNS environment
variables.) LESSOPEN
Command line to invoke the (optional) input-prepro-
EDITOR The name of the editor (used for the v command). cessor.

HOME Name of the user's home directory (used to find a LESSSECURE


lesskey file on Unix systems). Runs less in "secure" mode. See discussion under
SECURITY.
HOMEDRIVE, HOMEPATH
Concatenation of the HOMEDRIVE and HOMEPATH envi- LESSSEPARATOR
ronment variables is the name of the user's home String to be appended to a directory name in file-
directory if the HOME variable is not set (only in name completion.
the Windows version).
LINES Sets the number of lines on the screen. Takes
INIT Name of the user's init directory (used to find a precedence over the number of lines specified by
lesskey file on OS/2 systems). the TERM variable. (But if you have a windowing
system which supports TIOCGWINSZ or WIOCGETD, the
LANG Language for determining the character set. window system's idea of the screen size takes
precedence over the LINES and COLUMNS environment
LC_CTYPE variables.)
Language for determining the character set.
PATH User's search path (used to find a lesskey file on
LESS Options which are passed to less automatically. MS-DOS and OS/2 systems).

LESSANSIENDCHARS SHELL The shell used to execute the ! command, as well as


Characters which are assumed to end an ANSI color to expand filenames.
escape sequence (default "m").
TERM The type of terminal on which less is being run.
LESSBINFMT
Format for displaying non-printable, non-control VISUAL The name of the editor (used for the v command).
characters.

LESSCHARDEF SEE ALSO


Defines a character set. lesskey(1)

LESSCHARSET
Selects a predefined character set. WARNINGS
The = command and prompts (unless changed by -P) report
LESSCLOSE the line numbers of the lines at the top and bottom of the
*0 *
screen, but the byte and percent of the line after the one
at the bottom of the screen.
NOM
If the :e command is used to name more than one file, and lilo - Installer le chargeur lilo.
one of the named files has been viewed previously, the new
files may be entered into the list in an unexpected order. SYNOPSIS
Fonction principale :
On certain older terminals (the so-called "magic cookie"
terminals), search highlighting will cause an erroneous /sbin/lilo - Installer le chargeur lilo
display. On such terminals, search highlighting is dis-
abled by default to avoid possible problems. Autres utilisations :

In certain cases, when search highlighting is enabled and /sbin/lilo -q - Obtenir la carte des noyaux gérés.
a search pattern begins with a ^, more text than the /sbin/lilo -R - Positionner les attributs par défaut pour
matching string may be highlighted. (This problem does le prochain boot.
not occur when less is compiled to use the POSIX regular /sbin/lilo -I - Rechercher le chemin d'accès au noyau en
expression package.) cours d'utilisation.
/sbin/lilo {-u|-U} - Désinstaller Lilo.
On some systems, setlocale claims that ASCII characters 0
thru 31 are control characters rather than binary charac- DESCRIPTION
ters. This causes less to treat some binary files as lilo installe le chargeur Lilo, qui sera activé au
ordinary, non-binary files. To workaround this problem, prochain démarrage de la machine. Il dispose de nombreuses
set the environment variable LESSCHARSET to "ascii" (or options.
whatever character set is appropriate).

See http://www.flash.net/~marknu/less for the latest list -v Augmente la quantité de commentaires. Ajouter un ou
of known bugs in this version of less. plusieurs -v rendra Lilo de plus en plus volubile.

-q Affiche la carte des noyaux actuellement gérés, et


COPYRIGHT qui sont proposés lors du démarrage de la machine.
Copyright (C) 2000 Mark Nudelman lilo gère une carte, située par défaut dans le
fichier /boot/map, contenant les noms et les posi-
less is part of the GNU project and is free software. You tions des divers noyaux à proposer lors du démar-
can redistribute it and/or modify it under the terms of rage. Cette option liste les noms des systèmes
either (1) the GNU General Public License as published by proposés lors du boot.
the Free Software Foundation; or (2) the Less License.
See the file README in the less distribution for more -m map-file
details regarding redistribution. You should have Utiliser le fichier map-file pour stocker la carte
received a copy of the GNU General Public License along plutôt que celui par défaut.
with the source for less; see the file COPYING. If not,
write to the Free Software Foundation, 59 Temple Place, -C config-file
Suite 330, Boston, MA 02111-1307, USA. You should also lilo lit les instructions à propos des systèmes à
have received a copy of the Less License; see the file gérer dans un fichier de configuration, par défaut
LICENSE. /etc/lilo.conf. Cette option permet d'indiquer un
autre fichier de configuration.
less is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied war- -d délai
ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- Si vous avez indiqué plusieurs noyaux, en pressant
POSE. See the GNU General Public License for more SHIFT durant le démarrage de la machine, Lilo vous
details. proposera un choix des divers systèmes utilisables.
Après l'expiration d'un certain délai, le premier
noyau de la liste est lancé. Cette option permet de
AUTHOR configurer le délai désiré (en dixièmes de secon-
Mark Nudelman <marknu@flash.net> des).
Send bug reports or comments to the above address or to
bug-less@gnu.org. -D étiquette
Utilise le noyau associé à étiquette plutôt que le
premier de la liste, en tant que système par
défaut.

Version 358: 08 Jul 2000 LESS(1) -r root-directory


Avant toute chose, effectue un chroot vers le
répertoire indiqué. Cette option sert à réparer la
configuration après avoir booté depuis une
" & " disquette de secours.

-t Juste un essai. Ne pas modifier vraiment le secteur


de boot ou le fichier carte. A utiliser avec -v clés du fichier de configuration ainsi :
pour s'assurer de ce que lilo va faire.
-b bootdev boot=bootdev
-c Autoriser la compression de la carte. Ceci va per- -c compact
mettre de grouper les requêtes de lecture sur des -d dsec delay=dsec
secteurs adjacents. Cette option accélère le -D label default=label
démarrage (surtout sur disquette). -i bootsector install=bootsector
-f file disktab=file
-f disk-tab -l linear
Indique un fichier décrivant les paramètres -m mapfile map=mapfile
géométriques du disque. Le fichier par défaut est -P fix fix-table
/etc/disktab. -P ignore ignore-table
-s file backup=file
-i boot-sector -S file force-backup=file
Indique un fichier à installer en tant que nouveau -v verbose=level
secteur de boot. Le fichier par défaut est
/boot/boot.b. VOIR AUSSI
lilo.conf(5).
-l Utilise un adressage linéaire des secteurs, plutôt La distribution de Lilo contient une documentation très
qu'un adressage secteur/tête/cylindre. complète.

-P {fix|ignore} AUTEUR
Corrige (fix) ou ignore les tables de partitions Werner Almesberger (almesber@bernina.ethz.ch).
endommagées, c'est à dire les tables dont les
adresses linéaires et secteur/tête/cylindre ne cor-
respondent pas. TRADUCTION
Christophe Blaess, 1997.
-s save-file
Quand lilo écrase le secteur de boot, il sauvegarde
l'ancien contenu dans un fichier, par défaut
/boot/boot.NNNN ou NNNN dépend du périphérique. Lilo 17 Octobre 1996 LILO(8)
Cette option précise un autre fichier de sauvegarde
du secteur de boot. En l'associant avec l'option -u
on indique depuis quel fichier restaurer le
secteur.

-S save-file
Normalement lilo n'écrasera pas un fichier de
sauvegarde existant. Cette option autorise
l'écrasement. NOM
ln - Créer des liens entre fichiers.
-u device-name
Désinstallation de lilo, en recopiant le fichier de SYNOPSIS
sauvegarde sur le secteur de boot. Un horodatage ln [options] source [dest]
du fichier est vérifié. ln [options] source... repertoire

-U device-name Options POSIX : [-f]


Idem, sans vérification de l'horodatage
Options GNU (forme abrégée): [-bdfinsvF] [-S suffixe] [-V
-R command line {numbered,existing,simple}] [--help] [--version] [--]
Cette option indique les commandes par défaut lors
du prochain redémarrage du systeme. Ensuite Lilo DESCRIPTION
effacera ces commandes, elles ne sont utilisées Sous Unix, il existe deux types de `liens' entre fichiers,
qu'une seule fois. Ceci est typiquement utilisé que l'on nomme généralement liens matériels (ou physiques)
dans les scripts de redémarrage, juste avant et liens symboliques (ou logiques).
d'appeler `shutdown -r'.
Un lien matériel est simplement une manière de nommer un
-I label fichier. Un fichier peut avoir plusieurs noms. Un fichier
L'étiquette associée au noyau en cours d'utilisa- n'est effacé réellement que lorsque son dernier nom est
tion est stockée après le démarrage dans la vari- supprimé. Le nombre de noms d'un fichier est indiqué par
able d'environnement BOOT_IMAGE. Cette commande la commande ls(1). Il n'y a pas de notion de nom `origi-
affichera l'étiquette sur stdout. nal' : Tous les noms d'un fichier ont exactement la même
importance. Tous les noms d'un fichier se trouvent
-V Afficher le numéro de version. généralement - mais ce n'est pas obligatoire - dans le
système de fichiers contenant les données du fichier.

Les lignes de commandes ci-dessus correspondent aux mots Un lien symbolique est d'un tout autre genre. Il s'agit

!
d'un petit fichier spécial, qui contient un chemin -n, --no-dereference
d'accés. Ainsi un lien symbolique peut pointer vers un Lorsque l'on fournit une destination explicite qui
système de fichier différent de celui qui l'accueille. Il se trouve être un répertoire, la considèrer comme
peut également pointer, grâce à NFS, vers un système de un fichier normal.
fichiers appartenant à une autre machine. Enfin, un lien Lorsque la destination est un répertoire réel (et
symbolique ne pointe pas nécéssairement vers un fichier non pas un lien symbolique sur un répertoire), il
existant. Lorsque l'on accède à un lien symbolique (avec n'y a pas d'ambiguïté. Le lien est créé dans ce
les appels systèmes open(2) ou stat(2)), le nom du lien répertoire. Mais lorsque la destination est un lien
symbolique est remplacé, par le noyau Unix, par une symbolique vers un répertoire, il y a deux possi-
référence au fichier vers lequel le lien pointe. Toute- bilités pour traiter la demande. ln peut con-
fois, avec les appels rm(1) et unlink(2) le lien lui-même sidérer la destination comme un répertoire normal,
est supprimé, et non pas le fichier visé. Il existe des et créer le lien dans celui-ci. D'un autre côté, la
appels systèmes spéciaux lstat(2) et readlink(2) qui ren- destination peut également être considérée comme le
voient le status du lien symbolique, et le nom du fichier lien symbolique lui-même à créer. Dans ce cas, ln
vers lequel il pointe. Pour de nombreux autres appels- doit détruire, ou archiver, le lien existant avant
systèmes, il existe une frange d'incertitudes et de varia- de créer le nouveau lien. Le comportement par
tions entre les différents systèmes pour savoir si la défaut est de considérer la destination comme un
fonction s'applique au lien symbolique lui-même, ou au répertoire à part entière.
fichier cible.
-s, --symbolic
ln crée des liens entre fichiers. Par défaut il s'agit de Créer des liens symboliques à la place des liens
liens matériels. Si l'on utilise l'option -s, les liens physiques. Cette option produit souvent des mes-
seront symboliques (logiques). sages d'erreurs sur les systèmes qui ne supportent
pas les liens symboliques.
Si l'on n'indique qu'un seul nom de fichier, un lien vers
ce fichier est créé dans le répertoire courant. Le nom de -v, --verbose
ce lien sera le même que celui du fichier visé (il s'agit Afficher le nom de chaque fichier avant de le lier.
là d'une extension GNU). Sinon, si le dernier argument
indique un répertoire existant, ln créera des liens sur OPTIONS DE SAUVEGARDE GNU
chacun des fichiers source indiqués dans ce répertoire. Les versions GNU des programmes comme cp, mv, ln, install
Les noms seront égaux à ceux des fichiers source visés. et patch créeront au besoin une copie de sauvegarde des
(Consultez toutefois l'options --no-dereference plus bas). fichiers à écraser, à modifier ou à détruire. On demande
Si l'on indique seulement deux noms de fichiers, un lien une copie de sauvegarde à l'aide de l'option -b, on
sera créé avec le nom dest pointant vers le fichier indique la nomenclature à adopter avec l'option -V, et si
source. Il est interdit d'indiquer plus de deux arguments la sauvegarde se fait avec un suffixe, celui-ci est
si le dernier nom n'est pas un répertoire. précisé avec l'option -S.

Par défaut, ln ne supprime pas les fichiers ni les liens -b, --backup
symboliques existants. (Ainsi on peut l'utiliser à des Créer une copie de sauvegarde des fichiers à
fins de verrouillage, il échouera si dest existe déja). écraser ou à détruire.
On peut toutefois forcer l'écrasement avec l'option -f.
-S SUFFIXE, --suffix=SUFFIXE
Avec les implémentations existant actuellement, seul le Ajouter le SUFFIXE indiqué à chaque fichier de
Super-User peut créer un lien matériel sur un répertoire, sauvegarde créé. Si cette option n'est pas
et encore, c'est souvent totalement impossible. POSIX indiquée, on utilisera la valeur de la variable
interdit aux appels-systèmes link(2) et à l'utilitaire ln d'environnement SIMPLE_BACKUP_SUFFIX. Si la vari-
de créer des liens physique sur un répertoire (mais able SIMPLE_BACKUP_SUFFIX n'existe pas, la valeur
n'interdit pas les liens matériels entre différents par défaut est `~'.
systèmes de fichiers).
-V METHODE, --version-control=METHODE
OPTIONS POSIX Préciser la nomenclature des fichiers de sauvegarde
-f Forcer l'écrasement du fichier destination s'il La METHODE indiquée peut être `numbered' (`t'),
existe. `existing' (`nil'), ou `never' (`simple'). Si
cette option n'est pas indiquée, la valeur de la
OPTIONS GNU variable d'environnement VERSION_CONTROL est
-d, -F, --directory utilisée, et si la variable VERSION_CONTROL
Autoriser le Super-User à créer un lien physique n'existe pas, la valeur par défaut est `existing'.
sur un répertoire.
Cette option correspond à la variable `version-con-
-f, --force trol' sous Emacs. Les METHODES valides (les
Forcer l'écrasement du fichier destination s'il abbréviations non-ambigües sont acceptées) sont :
existe.
t, numbered
-i, --interactive Toujours faire une sauvegarde numérotée.
Demander confirmation avant de supprimer les
fichiers destination. nil, existing
Faire une sauvegarde numérotée des fichiers
'
en ayant déjà une précédente, et une sauveg-
arde simple pour les autres. slocate [-Vh] [--version] [--help]

never, simple
Faire toujours une sauvegarde simple. DESCRIPTION
Secure Locate provides a secure way to index and
OPTIONS STANDARDS GNU quickly search for files on your system. It uses incremen-
--help Afficher un message d'aide sur la sortie standard, tal encoding just like GNU locate to compress its database
et terminer correctement. to make searching faster, but it will also store file per-
missions and ownership so that users will not see files
--version they do not have access to.
Afficher un numéro de version sur la sortie stan-
dard, et terminer correctement. This manual page documents the GNU version of slocate.
slocate Enables system users to search entire filesystems
-- Fin de la liste d'options. without displaying unauthorized files.

ENVIRONNEMENT OPTIONS
Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont -u Create slocate database starting at path /.
leurs significations habituelles.
-U <dir>
CONFORMITÉ Create slocate database starting at path <dir>.
POSIX 1003.2. Toutefois, POSIX 1003.2 (1996) ne parle pas
des liens symboliques. Ceux-ci ont été introduits par -e <dir1,dir2,...>
BSD, et n'existent pas dans System V release 3 et Exclude directories from the slocate database.
antérieurs.
-f <fstype1,...>
VOIR AUSSI Exclude files on specific file systems from the
ls(1), rm(1), link(2), lstat(2), open(2), readlink(2), slocate database.
stat(2), unlink(2)
-c Parse '/etc/updatedb.conf' when updating the slo-
NOTES cate database.
Cette page décrit la version de ln se trouvant dans le
package fileutils-3.16. D'autres versions peuvent -l <level>
diffèrer légèrement. Envoyez les corrections concernant Security level. 0 turns security checks off. This
cette page de manuel (en anglais) à aeb@cwi.nl, will make searchs faster. 1 turns security checks
aw@mail1.bet1.puv.fi, et ragnar@lightside.ddns.org, et (en on. This is the default.
francais) à ccb@club-internet.fr. Signalez les bugs dans
le programme à fileutils-bugs@gnu.ai.mit.edu. -i Does a case insensitive search.

-q Quiet mode. Error messages are suppressed.


TRADUCTION
Christophe Blaess, 1998. -n <num>
Limit the amount of results shown to <num>.

-r <regexp>
GNU 24 Novembre 1998 LN(1) --regexp=<regexp> Search the database using a basic
POSIX regular expression.

-o <file>
( % ( % --output=<file> Specifies the database to create.

-d <path>
--database=<path> Specifies the path of databases
to search in.
NAME
slocate - Security Enhanced version of the GNU Locate -h --help Display this help.
SYNOPSIS -v --verbose Verbose mode. Display files when creating
slocate [-qi] [-d <path>] [--database=<path>] <search database.
string>
-V --version Display version.
slocate [-i] [-r <regexp>] [--regexp=<regexp>]

slocate [-qv] [-o <file>] [--output=<file>] VERSION


Secure Locate v2.6
slocate [-e <dir1,dir2,...>] [-f <fstype1,...>] <[-l
<level>] [-c] <[-U <path>] [-u]>

- &
AUTHOR
Kevin Lindsay - Copyright (c) 1999, 2000 Avec vdir, les fichiers sont par défaut présentés suivant
un format long.

BUG REPORT
Report any bugs to klindsay@mkintraweb.com OPTIONS POSIX
-1 Présenter un fichier par ligne.

FTP -a Afficher tous les fichiers des répertoires, y com-


ftp://ftp.geekreview.org/slocate/ pris les fichiers commençant par un `.'.
ftp://ftp.mkintraweb.com/pub/linux/slocate/
-c Trier le contenu des répertoires en fonction des
dates de changement des statuts de fichiers, plutôt
WEB qu'en fonction de la date de modification. S'il
http://www.geekreview.org/slocate/ s'agit d'un format long, afficher la date de
changement de statut plutôt que la date de modifi-
cation du fichier.

SLOCATE(1) -d Afficher les répertoires avec la même présentation


que les fichiers, sans lister leur contenu.

-i Afficher le numéro d'index (i-noeud) de chaque


( ( fichier à gauche de son nom.

-l En plus du nom, afficher le type du fichier, les


permissions d'accès, le nombre de liens physiques,
le nom du propriétaire et du groupe, la taille en
NOM octets, et l'horodatage (de la dernière modifica-
ls, dir, vdir - Afficher le contenu d'un répertoire. tion, sauf si une autre date est réclamée par les
options -c ou -u). Pour les fichiers vieux de plus
SYNOPSIS de 6 mois, ou en avance sur la date de plus d'une
ls [options] [fichier...] heure, l'horodatage contient l'année à la place de
l'heure. Les types de fichiers sont indiqués par
Options POSIX : [-1acdilqrtuCFR] les caractères suivants : - pour les fichiers ordi-
naires, d pour un répertoire (directory), b pour un
Options GNU (forme courte) : [-1abcdfgiklmnopqrstuxABCD- fichier spécial en mode bloc, c pour un fichier
FGLNQRSUX] [-w cols] [-T cols] [-I motif] [--full-time] spécial en mode caractère, l pour un lien symbol-
[--format={long,verbose,commas,across,vertical,single-col- ique, p pour une fifo (named pipe), s pour une
umn}] [--sort={none,time,size,extension}] socket. -q Afficher des points d'interrogation à
[--time={atime,access,use,ctime,status}] la place des caractères non-imprimables dans les
[--color[={none,auto,always}]] [--help] [--version] [--] noms de fichiers.
DESCRIPTION -r Inverser le tri du contenu des répertoires.
La commande ls affiche tout d'abord l'ensemble de ses
arguments fichiers autres que des répertoires. Puis ls -t Trier le contenu des répertoires en fonction de la
affiche l'ensemble des fichiers contenus dans chaque date et non pas en ordre alphabétique. Les fichiers
répertoire indiqué. dir et vdir sont des versions de ls les plus récents sont présentés en premier.
affichant par défaut leurs résultats avec d'autres for-
mats. -u Trier le contenu des répertoires en fonction de la
date de dernier accès au fichier plutôt que selon
Si aucun argument (autre qu'une option) n'est fourni, le la date de modification. Si le format d'affichage
contenu du répertoire en cours (`.') est affiché. Le con- est large, c'est la date de dernier accès qui est
tenu des répertoires est trié par ordre alphabétique. affichée.
Avec l'option -d, les répertoires sont considérés comme
des fichiers ordinaires, on affiche leurs noms mais pas -C Présenter les fichiers en colonnes, triés verti-
leurs contenus. calement.
Un fichier dont le nom commence par un point (`.') n'est -F Ajouter un caractère à chaque nom de fichier pour
affiché que si l'option -a est fournie. indiquer son type. les fichiers réguliers exécuta-
bles sont suivis d'un `*'. Les répertoires sont
Avec ls, les fichiers sont présentés par défaut en colonne suivis de `/', les liens symboliques d'un `@', les
et triés verticalement si la sortie standard est un termi- FIFOs d'un `|'. Les fichiers réguliers non-
nal, sinon ils sont affichés avec un seul fichier par exécutables ne sont suivis d'aucun caractère.
ligne.
-R Afficher récursivement le contenu des sous-réper-
Avec dir, les fichiers sont par défaut listés en colonne toires.
et triés verticalement.

0 *
OPTIONS GNU
-1, --format=single-column Les autorisations d'accès listées sont similaires
Présenter un fichier par ligne. aux spécifications de modes, mais ls regroupe
plusieurs bits dans le troisième caractère de
-a, --all chaque jeu de permissions.
Afficher tous les fichiers des répertoires, y com-
pris les fichiers commençant par un `.'. s si le bit setuid ou setgid et le bit
d'exécution correspondant sont tous deux
-b, --escape valides.
Présenter les caractères non-affichables des noms
de fichiers en utilisant des séquences S si le bit setuid ou setgid est actif mais le
alphabétiques ou octales commençant par un back- bit d'exécution correspondant n'est pas con-
slash `\' comme en C. figuré.

-c, --time=ctime, --time=status t Si les bits `Sticky' et `Exécution pas les


Trier le contenu des répertoires en fonction des autres' sont actifs.
dates de changement des statuts de fichiers, plutôt
qu'en fonction de la date de modification. S'il T Si le bit `Sticky' est actif mais pas le bit
s'agit d'un format long, afficher la date de `Exécution par les autres'.
changement de statut plutôt que la date de modifi-
cation du fichier. x Si le bit d'éxécution est actif mais aucun
de ceux cités ci-dessus.
-d, --directory
Afficher les répertoires avec la même présentation - Sinon.
que les fichiers, sans lister leur contenu.
-m, --format=commas
-f Ne pas trier le contenu des répertoires, l'afficher Afficher sur chaque ligne autant de fichiers que
dans l'ordre où il se présente sur le disque. possible, séparés par des virgules.
L'effet est équivalent aux options -a et -U sans
les options -l, -s, ni -t. -n, --numeric-uid-gid
Afficher les UID et GID numériques plutôt que les
--full-time noms.
Afficher les dates et heures complètes, sans les
abréger. -o Produire un listing de répertoire sous forme longue
mais sans les informations de groupe. C'est équiva-
-g Option sans effet, conservée pour assurer la com- lent à --format=long --no-group. Cette option sert
patibilité avec Unix. à assurer la compatibilité avec d'autres versions
de ls.
-i, --inode
Afficher le numéro d'index (i-noeud) de chaque -p Ajouter un caractère à chaque nom de fichier pour
fichier à gauche de son nom. indiquer son type.

-k, --kilobytes -q, --hide-control-chars


Si la taille des fichiers est affichée, la mesurer Afficher des points d'interrogation à la place des
en kilo-octets. Ceci a priorité sur la variable caractères non-imprimables dans les noms de
d'environnement POSIXLY_CORRECT. fichiers.

-l, --format=long, --format=verbose -r, --reverse


En plus du nom, afficher le type du fichier, les Inverser le tri du contenu des répertoires.
permissions d'accès, le nombre de liens physiques,
le nom du propriétaire et du groupe, la taille en -s, --size
octets, et l'horodatage (de la dernière modifica- Afficher la taille de chaque fichier, mesurée en
tion, sauf si une autre date est réclamée). Pour bloc de 1 Ko, à gauche du nom. Si la variable
les fichiers vieux de plus de 6 mois, ou en avance d'environnement POSIXLY_CORRECT est configurée, la
sur la date de plus d'une heure, l'horodatage con- taille est mesurée en blocs de 512 octets.
tient l'année à la place de l'heure.
-t, --sort=time
Pour chaque répertoire indiqué, les fichiers sont Trier le contenu des répertoires en fonction de la
précédés d'une ligne `total nb_blocs', ou nb_blocs date et non pas en ordre alphabétique. Les fichiers
est l'espace disque utilisé par l'ensemble des les plus récents sont présentés en premier.
fichiers du répertoire. Par défaut on utilise des
blocs de 1024 octets. Si la variable d'environ- -u, --time=atime, --time=access, --time=use
nement POSIXLY_CORRECT est configurée, on utilise Trier le contenu des répertoires en fonction de la
des blocs de 512 octets (sauf si l'option -k est date de dernier accès au fichier plutôt que selon
fournie). Le calcul de nb_blocs se fait en comptant la date de modification. Si le format d'affichage
séparement chaque lien physique. On peut trouver est large, c'est la date de dernier accès qui est
cela dommage. affichée.
-N, --literal
-w, --width cols Afficher les noms de fichiers sans modification.
Supposer que l'écran dispose de cols colonnes en
largeur. La valeur par défaut est réclamée si pos- -Q, --quote-name
sible au gestionnaire de terminal. Sinon la vari- Encadrer les noms de fichiers avec des guillemets,
able d'environnement COLUMNS est utilisée si elle et citer les caractères non-imprimables par des
est positionnée. Sinon, la valeur par défaut est séquences semblables à celles utilisées en C.
80.
-R, --recursive
-x, --format=across, --format=horizontal Afficher récursivement le contenu des sous-réper-
Présenter les fichiers en colonnes, triés horizon- toires.
talement.
-S, --sort=size
-A, --almost-all Trier les répertoires en fonction de la taille de
Afficher tous les fichiers du répertoire sauf `.' fichier et non pas en ordre alphabétique. Les
et `..'. fichiers les plus gros sont affichés en premier.

-B, --ignore-backups -T, --tabsize cols


Ne pas afficher les fichiers se terminant par `~', Supposer que les tabulations sont espacées de cols
à moins qu'ils ne soient mentionnés sur la ligne de colonnes. La valeur par défaut est 8, mais elles
commande. peut être modifiée par la variable d'environnement
TABSIZE lorsque la variable POSIXLY_CORRECT n'est
-C, --format=vertical pas validée. ls utilise des tabulations pour
Présenter les fichiers en colonnes, triés verti- accélérer l'affichage, mais si cols vaut zéro,
calement. aucune tabulation ne sera employée.

-D, --dired -U, --sort=none


Avec le format long -l, imprimer une ligne Ne pas trier le contenu des répertoires. Les
supplémentaire après les données principales: présenter dans l'ordre des fichiers sur le disque.
//DIRED// DEBUT_1 FIN_1 DEBUT_2 FIN_2 ... Cette option n'est pas groupée avec -f car le ls
Les valeurs DEBUT_n et FIN_n sont des entiers non- d'Unix possède une option -f incluant également -a
signés qui enregistrent la position en octets de et supprimant -l, -s, et -t. Il semble inutile et
chaque noms de fichier dans la sortie. Ceci permet horrible de regrouper toutes ces fonctionnalités
à Emacs de trouver facilement les noms de fichiers, sans lien entre elles en une seule option.
même ceux qui contiennent des caractères inhab-
ituels comme espace ou retour-chariot. Si les -X, --sort=extension
répertoires sont listés de manière récursive -R, Trier le contenu des répertoires en fonction de
une ligne similaire est affichée après chaque sous- l'extension du nom de fichier (les caractères après
répertoires : le dernier `.'). Les fichiers sans extension sont
//SUBDIRED// DEBUT_1 FIN_1 ... affichés en premier.

-F, --classify --color[=manière]


Ajouter un caractère à chaque nom de fichier pour Spécifie comment utiliser les couleurs pour dis-
indiquer son type. les fichiers réguliers exécuta- tinguer les types de fichiers. Les couleurs sont
bles sont suivis d'un `*'. Les répertoires sont définie en utilisant la variable d'environnement
suivis de `/', les liens symboliques d'un `@', les LS_COLORS. Pour avoir des précisions sur la con-
FIFOs d'un `|'. Les fichiers réguliers non- figuration de cette variable, voir dircolors(1).
exécutables ne sont suivis d'aucun caractère. La manière, si elle est indiquée, peut prendre
l'une des valeurs suivantes :
-G, --no-group
Ne pas afficher les informations de groupe dans le none Ne pas utiliser de couleurs. C'est le com-
format large. portement par défaut.

-I, --ignore motif auto N'utiliser de couleurs que si la sortie


Ne pas afficher les fichiers dont le nom correspond standard est un terminal.
au motif (suivant l'interprétation du shell), à
moins qu'ils ne soient explicitement mentionnés sur always Toujours utiliser des couleurs. Indiquer
la ligne de commande. Comme avec le shell, les seulement --color sans indiquer de manière
noms de fichiers commençant par un point `.' ne est équivalent à --color=always.
sont pas supposés correspondre avec un motif com-
mençant par un caractère générique. --full-time
Afficher les temps de manière complète, sans
-L, --dereference utiliser les heuristiques habituelles d'abrévia-
Afficher les informations concernant les fichiers tion. Le format est celui par défaut de date(1).
pointés par les liens symboliques et non pas celles On ne peut pas le modifier, mais on peut au besoin
concernant les liens eux-mêmes. l'extraire avec cut(1) et de passer le résultat à
`date -d'.
!
Ceci est surtout utile car l'affichage contient les
secondes (les systèmes de fichiers Unix utilisent
un horodatage à la seconde la plus proche, aussi (/ & *& &
vous disposez ici de toutes les informations exis-
tantes). Par exemple cela peut servir à corriger un
NAME
Makefile qui ne régénère pas correctement les mail - send and receive mail
fichiers.
SYNOPSIS
mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr...
OPTIONS STANDARDS GNU
mail [-iInNv] -f [name]
--help Afficher un message d'aide sur la sortie standard, mail [-iInNv] [-u user]
et terminer normalement.
INTRODUCTION
--version Mail is an intelligent mail processing system, which has a command syntax
Afficher un numéro de version sur la sortie stan- reminiscent of ed(1) with lines replaced by messages.
dard, et terminer normalement.
-v Verbose mode. The details of delivery are displayed on the user's
-- Terminer la liste des options. terminal.

-i Ignore tty interrupt signals. This is particularly useful when


ENVIRONNEMENT using mail on noisy phone lines.
La variable d'environnement POSIXLY_CORRECT détermine le
choix des unités. Si elle n'est pas configurée, alors la -I Forces mail to run in interactive mode even when input isn't a ter-
variable TABSIZE détermine le nombre de caractères par minal. In particular, the `~' special character when sending mail
saut de tabulation. La variable COLUMNS (lorsqu'elle con- is only active in interactive mode.
tient un entier décimal) déterminer le nombre de colonnes
pour la largeur de sortie (option -C). Les variables -n Inhibits reading /etc/mail.rc upon startup.
LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES et LC_TIME
ont leurs significations habituelles. La variable TZ -N Inhibits the initial display of message headers when reading mail
indique le fuseau horaire pour les chaînes de caractères or editing a mail folder.
représentant des horodatages. La variable LS_COLORS est
utilisée pour préciser les couleurs utilisées. -s Specify subject on command line (only the first argument after the
-s flag is used as a subject; be careful to quote subjects contain-
ing spaces.)
BOGUES
Sur les systèmes BSD, l'option -s affiche des tailles cor- -c Send carbon copies to list of users.
respondant à la moitié de la taille réelle pour les
fichiers situés sur un système HP-UX monté par NFS. Sur -b Send blind carbon copies to list. List should be a comma-separated
les systèmes HP-UX, les tailles sont doublées pour les list of names.
fichiers monté par NFS depuis un système BSD. Ceci est dû
à un défaut d'HP-UX, qui affecte également la version HP- -f Read in the contents of your mbox (or the specified file) for pro-
UX de la commande ls. cessing; when you quit, mail writes undeleted messages back to this
file.
CONFORMITÉ -u Is equivalent to:
POSIX 1003.2
mail -f /var/spool/mail/user
VOIR AUSSI Sending mail
dircolors(1) To send a message to one or more people, mail can be invoked with argu-
ments which are the names of people to whom the mail will be sent. You
are then expected to type in your message, followed by an `control-D' at
NOTES the beginning of a line. The section below Replying to or originating
Cette page documente la version de ls du paquetage fileu- mail, describes some features of mail available to help you compose your
tils-3.16. D'autres versions peuvent diverger légèrement. letter.

Reading mail
TRADUCTION In normal usage mail is given no arguments and checks your mail out of
Christophe Blaess, 1997. the post office, then prints out a one line header of each message found.
The current message is initially the first message (numbered 1) and can
be printed using the print command (which can be abbreviated `p'). You
can move among the messages much as you move between lines in ed(1), with
FSF 02 Janvier 2000 LS(1L) the commands `+' and `-' moving backwards and forwards, and simple num-
bers.

Disposing of mail.
'
After examining a message you can delete `d') the message or reply `r') search proceeds backwards, and if there are no good messages at all, mail
to it. Deletion causes the mail program to forget about the message. types ``applicable messages'' and aborts the command.
This is not irreversible; the message can be undeleted `u') by giving its
number, or the mail session can be aborted by giving the exit `x') com- - Print out the preceding message. If given a numeric argument n,
mand. Deleted messages will, however, usually disappear never to be seen goes to the n'th previous message and prints it.
again.
? Prints a brief summary of commands.
Specifying messages
Commands such as print and delete can be given a list of message numbers ! Executes the shell (see sh(1) and csh(1)) command which follows.
as arguments to apply to a number of messages at once. Thus ``delete 1
2'' deletes messages 1 and 2, while ``delete 1-5'' deletes messages 1 Print (P) Like print but also prints out ignored header fields. See
through 5. The special name `*' addresses all messages, and `$' also print, ignore and retain.
addresses the last message; thus the command top which prints the first
few lines of a message could be used in ``top *'' to print the first few Reply (R) Reply to originator. Does not reply to other recipients of
lines of all messages. the original message.

Replying to or originating mail. Type (T) Identical to the Print command.


You can use the reply command to set up a response to a message, sending
it back to the person who it was from. Text you then type in, up to an alias (a) With no arguments, prints out all currently-defined aliases.
end-of-file, defines the contents of the message. While you are compos- With one argument, prints out that alias. With more than one
ing a message, mail treats lines beginning with the character `~' spe- argument, creates a new alias or changes an old one.
cially. For instance, typing `~m' (alone on a line) will place a copy of
the current message into the response right shifting it by a tabstop (see alternates
indentprefix variable, below). Other escapes will set up subject fields, (alt) The alternates command is useful if you have accounts on
add and delete recipients to the message and allow you to escape to an several machines. It can be used to inform mail that the listed
editor to revise the message or to a shell to run some commands. (These addresses are really you. When you reply to messages, mail will
options are given in the summary below.) not send a copy of the message to any of the addresses listed on
the alternates list. If the alternates command is given with no
Ending a mail processing session. argument, the current set of alternate names is displayed.
You can end a mail session with the quit `q') command. Messages which
have been examined go to your mbox file unless they have been deleted in chdir (c) Changes the user's working directory to that specified, if
which case they are discarded. Unexamined messages go back to the post given. If no directory is given, then changes to the user's
office. (See the -f option above). login directory.

Personal and systemwide distribution lists. copy (co) The copy command does the same thing that save does, except
It is also possible to create a personal distribution lists so that, for that it does not mark the messages it is used on for deletion
instance, you can send mail to ``cohorts'' and have it go to a group of when you quit.
people. Such lists can be defined by placing a line like
delete (d) Takes a list of messages as argument and marks them all as
alias cohorts bill ozalp jkf mark kridle@ucbcory deleted. Deleted messages will not be saved in mbox, nor will
they be available for most other commands.
in the file .mailrc in your home directory. The current list of such
aliases can be displayed with the alias command in mail. System wide dp (also dt) Deletes the current message and prints the next mes-
distribution lists can be created by editing /etc/aliases, see aliases(5) sage. If there is no next message, mail says ``at EOF''.
and sendmail(8); these are kept in a different syntax. In mail you send,
personal aliases will be expanded in mail sent to others so that they edit (e) Takes a list of messages and points the text editor at each
will be able to reply to the recipients. System wide aliases are not one in turn. On return from the editor, the message is read back
expanded when the mail is sent, but any reply returned to the machine in.
will have the system wide alias expanded as all mail goes through
sendmail. exit (ex or x) Effects an immediate return to the Shell without modi-
fying the user's system mailbox, his mbox file, or his edit file
Network mail (ARPA, UUCP, Berknet) in -f.
See mailaddr(7) for a description of network addresses.
file (fi) The same as folder.
Mail has a number of options which can be set in the .mailrc file to
alter its behavior; thus ``set askcc'' enables the askcc feature. (These folders
options are summarized below.) List the names of the folders in your folder directory.

SUMMARY folder (fo) The folder command switches to a new mail file or folder.
(Adapted from the `Mail Reference Manual') With no arguments, it tells you which file you are currently
reading. If you give it an argument, it will write out changes
Each command is typed on a line by itself, and may take arguments follow- (such as deletions) you have made in the current file and read in
ing the command word. The command need not be typed in its entirety - the new file. Some special conventions are recognized for the
the first command which matches the typed prefix is used. For commands name. # means the previous file, % means your system mailbox,
which take message lists as arguments, if no message list is given, then %user means user's system mailbox, & means your mbox file, and
the next message forward which satisfies the command's requirements is +folder means a file in your folder directory.
used. If there are no messages forward of the current message, the
- &
from (f) Takes a list of messages and prints their message headers.
set (se) With no arguments, prints all variable values. Otherwise,
headers sets option. Arguments are of the form option=value (no space
(h) Lists the current range of headers, which is an 18-message before or after =) or option. Quotation marks may be placed
group. If a `+' argument is given, then the next 18-message around any part of the assignment statement to quote blanks or
group is printed, and if a `-' argument is given, the previous tabs, i.e. ``set indentprefix="->"''
18-message group is printed.
saveignore
help A synonym for ? Saveignore is to save what ignore is to print and type. Header
fields thus marked are filtered out when saving a message by save
hold (ho, also preserve) Takes a message list and marks each message or when automatically saving to mbox.
therein to be saved in the user's system mailbox instead of in
mbox. Does not override the delete command. saveretain
Saveretain is to save what retain is to print and type. Header
ignore Add the list of header fields named to the ignored list. Header fields thus marked are the only ones saved with a message when
fields in the ignore list are not printed on your terminal when saving by save or when automatically saving to mbox. Saveretain
you print a message. This command is very handy for suppression overrides saveignore.
of certain machine-generated header fields. The Type and Print
commands can be used to print a message in its entirety, includ- shell (sh) Invokes an interactive version of the shell.
ing ignored fields. If ignore is executed with no arguments, it
lists the current set of ignored fields. size Takes a message list and prints out the size in characters of
each message.
mail (m) Takes as argument login names and distribution group names
and sends mail to those people. source The source command reads commands from a file.

mbox Indicate that a list of messages be sent to mbox in your home top Takes a message list and prints the top few lines of each. The
directory when you quit. This is the default action for messages number of lines printed is controlled by the variable toplines
if you do not have the hold option set. and defaults to five.

next (n) like + or CR) Goes to the next message in sequence and types type (t) A synonym for print.
it. With an argument list, types the next matching message.
unalias
preserve Takes a list of names defined by alias commands and discards the
(pre) A synonym for hold. remembered groups of users. The group names no longer have any
significance.
print (p) Takes a message list and types out each message on the user's
terminal. undelete
(u) Takes a message list and marks each message as not being
quit (q) Terminates the session, saving all undeleted, unsaved mes- deleted.
sages in the user's mbox file in his login directory, preserving
all messages marked with hold or preserve or never referenced in unread (U) Takes a message list and marks each message as not having
his system mailbox, and removing all other messages from his sys- been read.
tem mailbox. If new mail has arrived during the session, the
message ``You have new mail'' is given. If given while editing a unset Takes a list of option names and discards their remembered val-
mailbox file with the -f flag, then the edit file is rewritten. ues; the inverse of set.
A return to the Shell is effected, unless the rewrite of edit
file fails, in which case the user can escape with the exit com- visual (v) Takes a message list and invokes the display editor on each
mand. message.

reply (r) Takes a message list and sends mail to the sender and all write (w) Similar to save, except that only the message body (without)
recipients of the specified message. The default message must the header) is saved. Extremely useful for such tasks as sending
not be deleted. and receiving source program text over the message system.

respond xit (x) A synonym for exit.


A synonym for reply.
z Mail presents message headers in windowfuls as described under
retain Add the list of header fields named to the retained list Only the the headers command. You can move mail's attention forward to
header fields in the retain list are shown on your terminal when the next window with the z command. Also, you can move to the
you print a message. All other header fields are suppressed. previous window by using z-.
The Type and Print commands can be used to print a message in its
entirety. If retain is executed with no arguments, it lists the Tilde/Escapes
current set of retained fields.
Here is a summary of the tilde escapes, which are used when composing
save (s) Takes a message list and a filename and appends each message messages to perform special functions. Tilde escapes are only recognized
in turn to the end of the file. The filename in quotes, followed at the beginning of lines. The name ``tilde escape'' is somewhat of a
by the line count and character count is echoed on the user's misnomer since the actual escape character can be set by the option
terminal. escape.
0 *
to rejustify the message.
~!command
Execute the indicated shell command, then return to the message. ~:mail-command
Execute the given mail command. Not all commands, however, are
~bname ... allowed.
Add the given names to the list of carbon copy recipients but do
not make the names visible in the Cc: line ("blind" carbon copy). ~~string
Insert the string of text in the message prefaced by a single ~.
~cname ... If you have changed the escape character, then you should double
Add the given names to the list of carbon copy recipients. that character in order to send it.

~d Read the file ``dead.letter'' from your home directory into the Mail Options
message. Options are controlled via set and unset commands. Options may be either
binary, in which case it is only significant to see whether they are set
~e Invoke the text editor on the message collected so far. After or not; or string, in which case the actual value is of interest. The
the editing session is finished, you may continue appending text binary options include the following:
to the message.
append Causes messages saved in mbox to be appended to the end rather
~fmessages than prepended. This should always be set (perhaps in
Read the named messages into the message being sent. If no mes- /etc/mail.rc).
sages are specified, read in the current message. Message head-
ers currently being ignored (by the ignore or retain command) are ask, asksub
not included. Causes mail to prompt you for the subject of each message you
send. If you respond with simply a newline, no subject field
~Fmessages will be sent.
Identical to ~f, except all message headers are included.
askcc Causes you to be prompted for additional carbon copy recipients
~h Edit the message header fields by typing each one in turn and at the end of each message. Responding with a newline indicates
allowing the user to append text to the end or modify the field your satisfaction with the current list.
by using the current terminal erase and kill characters.
askbcc Causes you to be prompted for additional blind carbon copy recip-
~mmessages ients at the end of each message. Responding with a newline
Read the named messages into the message being sent, indented by indicates your satisfaction with the current list.
a tab or by the value of indentprefix. If no messages are speci-
fied, read the current message. Message headers currently being autoprint
ignored (by the ignore or retain command) are not included. Causes the delete command to behave like dp - thus, after delet-
ing a message, the next one will be typed automatically.
~Mmessages
Identical to ~m, except all message headers are included. debug Setting the binary option debug is the same as specifying -d on
the command line and causes mail to output all sorts of informa-
~p Print out the message collected so far, prefaced by the message tion useful for debugging mail.
header fields.
dot The binary option dot causes mail to interpret a period alone on
~q Abort the message being sent, copying the message to a line as the terminator of a message you are sending.
``dead.letter'' in your home directory if save is set.
hold This option is used to hold messages in the system mailbox by
~rfilename default.
Read the named file into the message.
ignore Causes interrupt signals from your terminal to be ignored and
~sstring echoed as @'s.
Cause the named string to become the current subject field.
ignoreeof
~tname ... An option related to dot is ignoreeof which makes mail refuse to
Add the given names to the direct recipient list. accept a control-d as the end of a message. Ignoreeof also
applies to mail command mode.
~v Invoke an alternate editor (defined by the VISUAL option) on the
message collected so far. Usually, the alternate editor will be metoo Usually, when a group is expanded that contains the sender, the
a screen editor. After you quit the editor, you may resume sender is removed from the expansion. Setting this option causes
appending text to the end of your message. the sender to be included in the group.

~wfilename noheader
Write the message onto the named file. Setting the option noheader is the same as giving the -N flag on
the command line.
~|command
Pipe the message through the command as a filter. If the command nosave Normally, when you abort a message with two RUBOUT (erase or
gives no output or terminates abnormally, retain the original delete) mail copies the partial letter to the file
text of the message. The command fmt(1) is often used as command ``dead.letter'' in your home directory. Setting the binary
option nosave prevents this. Mail utilizes the HOME, USER, SHELL, DEAD, PAGER, LISTER, EDITOR, VISUAL
and MBOX environment variables.
Replyall
Reverses the sense of reply and Reply commands. FILES
/var/spool/mail/* Post office.
quiet Suppresses the printing of the version when first invoked. ~/mbox User's old mail.
~/.mailrc File giving initial mail commands. Only used if the
searchheaders owner of the file is the user running this copy of
If this option is set, then a message-list specifier in the form mail.
``/x:y'' will expand to all messages containing the substring /tmp/R* Temporary files.
``y'' in the header field ``x''. The string search is case /usr/lib/mail.*help Help files.
insensitive. /etc/mail.rc System initialization file.

verbose SEE ALSO


Setting the option verbose is the same as using the -v flag on fmt(1), newaliases(1), vacation(1), aliases(5), mailaddr(7), sendmail(8)
the command line. When mail runs in verbose mode, the actual and
delivery of messages is displayed on the user's terminal.
The Mail Reference Manual..
Option String Values
HISTORY
EDITOR Pathname of the text editor to use in the edit command and A mail command appeared in Version 6 AT&T UNIX. This man page is derived
~e escape. If not defined, then a default editor is used. from The Mail Reference Manual originally written by Kurt Shoens.

LISTER Pathname of the directory lister to use in the folders com- BUGS
mand. Default is /bin/ls. There are some flags that are not documented here. Most are not useful
to the general user.
PAGER Pathname of the program to use in the more command or when
crt variable is set. The default paginator more(1) is used 4th Berkeley Distribution December 30, 1993 4th Berkeley Distribution
if this option is not defined.

SHELL Pathname of the shell to use in the ! command and the ~!


escape. A default shell is used if this option is not & &
defined.

VISUAL Pathname of the text editor to use in the visual command


and ~v escape.
NAME
crt The valued option crt is used as a threshold to determine man - format and display the on-line manual pages
how long a message must be before PAGER is used to read it. manpath - determine user's search path for man pages
If crt is set without a value, then the height of the ter-
minal screen stored in the system is used to compute the SYNOPSIS
threshold (see stty(1)). man [-acdfFhkKtwW] [--path] [-m system] [-p string] [-C
config_file] [-M pathlist] [-P pager] [-S section_list]
escape If defined, the first character of this option gives the [section] name ...
character to use in the place of ~ to denote escapes.

folder The name of the directory to use for storing folders of DESCRIPTION
messages. If this name begins with a `/', mail considers man formats and displays the on-line manual pages. If you
it to be an absolute pathname; otherwise, the folder direc- specify section, man only looks in that section of the
tory is found relative to your home directory. manual. name is normally the name of the manual page,
which is typically the name of a command, function, or
MBOX The name of the mbox file. It can be the name of a folder. file. However, if name contains a slash (/) then man
The default is ``mbox'' in the user's home directory. interprets it as a file specification, so that you can do
man ./foo.5 or even man /cd/foo/bar.1.gz.
record If defined, gives the pathname of the file used to record
all outgoing mail. If not defined, then outgoing mail is See below for a description of where man looks for the
not so saved. manual page files.

indentprefix String used by the ``~m'' tilde escape for indenting mes-
sages, in place of the normal tab character (^I). Be sure OPTIONS
to quote the value if it contains spaces or tabs. -C config_file
Specify the configuration file to use; the default
toplines If defined, gives the number of lines of a message to be is /usr//etc/man.config. (See man.conf(5).)
printed out with the top command; normally, the first five
lines are printed. -M path
Specify the list of directories to search for man
ENVIRONMENT pages. Separate the directories with colons. An

!
empty list is the same as not specifying -M at all. ted or displayed. If no argument is given: display
See SEARCH PATH FOR MANUAL PAGES. (on stdout) the list of directories that is
searched by man for man pages. If manpath is a link
-P pager to man, then "manpath" is equivalent to "man
Specify which pager to use. This option overrides --path".
the MANPAGER environment variable, which in turn
overrides the PAGER variable. By default, man uses -W Like -w, but print file names one per line, without
/usr/bin/less -isr. additional information. This is useful in shell
commands like man -aW man | xargs ls -l
-S section_list
List is a colon separated list of manual sections
to search. This option overrides the MANSECT envi- CAT PAGES
ronment variable. Man will try to save the formatted man pages, in order to
save formatting time the next time these pages are needed.
-a By default, man will exit after displaying the Traditionally, formatted versions of pages in DIR/manX are
first manual page it finds. Using this option saved in DIR/catX, but other mappings from man dir to cat
forces man to display all the manual pages that dir can be specified in /usr//etc/man.config. No cat
match name, not just the first. pages are saved when the required cat directory does not
exist. No cat pages are saved when they are formatted for
-c Reformat the source man page, even when an up-to- a line length different from 80. No cat pages are saved
date cat page exists. This can be meaningful if when man.conf contains the line NOCACHE.
the cat page was formatted for a screen with a dif-
ferent number of columns, or if the preformatted It is possible to make man suid to a user man. Then, if a
page is corrupted. cat directory has owner man and mode 0755 (only writable
by man), and the cat files have owner man and mode 0644 or
-d Don't actually display the man pages, but do print 0444 (only writable by man, or not writable at all), no
gobs of debugging information. ordinary user can change the cat pages or put other files
in the cat directory. If man is not made suid, then a cat
-D Both display and print debugging info. directory should have mode 0777 if all users should be
able to leave cat pages there.
-f Equivalent to whatis.
The option -c forces reformatting a page, even if a recent
-F or --preformat cat page exists.
Format only - do not display.

-h Print a one-line help message and exit.


SEARCH PATH FOR MANUAL PAGES
-k Equivalent to apropos. man uses a sophisticated method of finding manual page
files, based on the invocation options and environment
-K Search for the specified string in *all* man pages. variables, the /usr//etc/man.config configuration file,
Warning: this is probably very slow! It helps to and some built in conventions and heuristics.
specify a section. (Just to give a rough idea, on
my machine this takes about a minute per 500 man First of all, when the name argument to man contains a
pages.) slash (/), man assumes it is a file specification itself,
and there is no searching involved.
-m system
Specify an alternate set of man pages to search But in the normal case where name doesn't contain a slash,
based on the system name given. man searches a variety of directories for a file that
could be a manual page for the topic named.
-p string
Specify the sequence of preprocessors to run before If you specify the -M pathlist option, pathlist is a
nroff or troff. Not all installations will have a colon-separated list of the directories that man searches.
full set of preprocessors. Some of the preproces-
sors and the letters used to designate them are: If you don't specify -M but set the MANPATH environment
eqn (e), grap (g), pic (p), tbl (t), vgrind (v), variable, the value of that variable is the list of the
refer (r). This option overrides the MANROFFSEQ directories that man searches.
environment variable.
If you don't specify an explicit path list with -M or MAN-
-t Use /usr/bin/groff -Tps -mandoc to format the man- PATH, man develops its own path list based on the contents
ual page, passing the output to stdout. The output of the configuration file /usr//etc/man.config. The MAN-
from /usr/bin/groff -Tps -mandoc may need to be PATH statements in the configuration file identify partic-
passed through some filter or another before being ular directories to include in the search path.
printed.
Furthermore, the MANPATH_MAP statements add to the search
-w or --path path depending on your command search path (i.e. your PATH
Don't actually display the man pages, but do print environment variable). For each directory that may be in
the location(s) of the files that would be format- the command search path, a MANPATH_MAP statement specifies
'
a directory that should be added to the search path for LANG If LANG is set, its value defines the name of the
manual page files. man looks at the PATH variable and subdirectory where man first looks for man pages.
adds the corresponding directories to the manual page file Thus, the command `LANG=dk man 1 foo' will cause
search path. Thus, with the proper use of MANPATH_MAP, man to look for the foo man page in
when you issue the command man xyz, you get a manual page .../dk/man1/foo.1, and if it cannot find such a
for the program that would run if you issued the command file, then in .../man1/foo.1, where ... is a direc-
xyz. tory on the search path.

In addition, for each directory in the command search path NLSPATH, LC_MESSAGES, LANG
(we'll call it a "command directory") for which you do not The environment variables NLSPATH and LC_MESSAGES
have a MANPATH_MAP statement, man automatically looks for (or LANG when the latter does not exist) play a
a manual page directory "nearby" namely as a subdirectory role in locating the message catalog. (But the
in the command directory itself or in the parent directory English messages are compiled in, and for English
of the command directory. no catalog is required.) Note that programs like
col(1) called by man also use e.g. LC_CTYPE.
You can disable the automatic "nearby" searches by includ-
ing a NOAUTOPATH statement in /usr//etc/man.config. PATH PATH helps determine the search path for manual
page files. See SEARCH PATH FOR MANUAL PAGES.
In each directory in the search path as described above,
man searches for a file named topic.section, with an SYSTEM SYSTEM is used to get the default alternate system
optional suffix on the section number and possibly a com- name (for use with the -m option).
pression suffix. If it doesn't find such a file, it then
looks in any subdirectories named manN or catN where N is SEE ALSO
the manual section number. If the file is in a catN sub- apropos(1), whatis(1), less(1), groff(1), man.config(5).
directory, man assumes it is a formatted manual page file
(cat page). Otherwise, man assumes it is unformatted. In BUGS
either case, if the filename has a known compression suf- The -t option only works if a troff-like program is
fix (like .gz), man assumes it is gzipped. installed.
If you see blinking \255 or <AD> instead of hyphens, put
If you want to see where (or if) man would find the manual `LESSCHARSET=latin1' in your environment.
page for a particular topic, use the --path (-w) option.
TIPS
If you add the line
ENVIRONMENT
MANPATH (global-set-key [(f1)] (lambda () (interactive) (manual-
If MANPATH is set, man uses it as the path to entry (current-word))))
search for manual page files. It overrides the
configuration file and the automatic search path, to your .emacs file, then hitting F1 will give you the man
but is overridden by the -M invocation option. See page for the library call at the current cursor position.
SEARCH PATH FOR MANUAL PAGES.
To get a plain text version of a man page, without
MANPL If MANPL is set, its value is used as the display backspaces and underscores, try
page length. Otherwise, the entire man page will
occupy one (long) page. # man foo | col -b > foo.mantxt

MANROFFSEQ
If MANROFFSEQ is set, its value is used to deter-
mine the set of preprocessors run before running
nroff or troff. By default, pages are passed September 2, 1995 man(1)
through the tbl preprocessor before nroff.

MANSECT
If MANSECT is set, its value is used to determine &- &-
which manual sections to search.

MANWIDTH
If MANWIDTH is set, its value is used as the width
manpages should be displayed. Otherwise the pages NAME
may be displayed over the whole width of your mc - Visual shell for Unix-like systems.
screen.
USAGE
MANPAGER mc [-abcCdfhPstuUVx?] [-l log] [dir1 [dir2]] [-v file]
If MANPAGER is set, its value is used as the name
of the program to use to display the man page. If DESCRIPTION
not, then PAGER is used. If that has no value The Midnight Commander is a directory browser/file manager
either, /usr/bin/less -isr is used. for Unix-like operating systems.

- &
OPTIONS If specified, the first path name is the directory to show
-a Disables the usage of graphic characters for line in the selected panel; the second path name is the direc-
drawing. tory to be shown in the other panel.

-b Forces black and white display.


Overview
-c Force color mode, please check the section Colors The screen of the Midnight Commander is divided into four
for more information. parts. Almost all of the screen space is taken up by two
directory panels. By default, the second bottommost line
-C arg Used to specify a different color set in the com- of the screen is the shell command line, and the bottom
mand line. The format of arg is documented in the line shows the function key labels. The topmost line is
Colors section. the menu bar line. The menu bar line may not be visible,
but appears if you click the topmost line with the mouse
-d Disables mouse support. or press the F9 key.

-f Displays the compiled-in search paths for Midnight The Midnight Commander provides a view of two directories
Commander files. at the same time. One of the panels is the current panel
(a selection bar is in the current panel). Almost all
-k Reset softkeys to their default from the term- operations take place on the current panel. Some file
cap/terminfo database. Only useful on HP terminals operations like Rename and Copy by default use the direc-
when the function keys don't work. tory of the unselected panel as a destination (don't
worry, they always ask you for confirmation first). For
-l file more information, see the sections on the Directory Pan-
Save the ftpfs dialog with the server in file. els, the Left and Right Menus and the File Menu.

-P At program end, the Midnight Commander will print You can execute system commands from the Midnight Comman-
the last working directory. This function should der by simply typing them. Everything you type will appear
not be used directly, instead, it should be used on the shell command line, and when you press Enter the
from a special shell function that will automati- Midnight Commander will execute the command line you
cally change the current directory of the shell to typed; read the Shell Command Line and Input Line Keys
the last directory the Midnight Commander was in sections to learn more about the command line.
(thanks to Torben Fjerdingstad and Sergey for con-
tributing this function and the code implementing
this option). Source the files Mouse Support
/usr/lib/mc/bin/mc.sh (bash and zsh users) respec- The Midnight Commander comes with mouse support. It is
tively /usr/lib/mc/bin/mc.csh (tcsh users) in order activated whenever you are running on an xterm(1) terminal
to have this function defined. (it even works if you take a telnet or rlogin connection
to another machine from the xterm) or if you are running
-s Turns on the slow terminal mode, in this mode the on a Linux console and have the gpm mouse server running.
program will not draw expensive line drawing char-
acters and will toggle verbose mode off. When you left click on a file in the directory panels,
that file is selected; if you click with the right button,
-t Used only if the code was compiled with Slang and the file is marked (or unmarked, depending on the previous
terminfo: it makes the Midnight Commander use the state).
value of the TERMCAP variable for the terminal
information instead of the information on the sys- Double-clicking on a file will try to execute the command
tem wide terminal database if it is an executable program; and if the extension file
has a program specified for the file's extension, the
-u Disables the use of a concurrent shell (only makes specified program is executed.
sense if the Midnight Commander has been built with
concurrent shell support). Also, it is possible to execute the commands assigned to
the function key labels by clicking on them.
-U Enables the use of the concurrent shell support
(only makes sense if the Midnight Commander was If a mouse button is clicked on the top frame line of the
built with the subshell support set as an optional directory panel, it is scrolled one pageful backward. Cor-
feature). respondingly, a click on the bottom frame line will cause
a scroll of one pageful forward. This frame line method
-v file works also in the Help Viewer and the Directory Tree.
Enters the internal viewer to view the file speci-
fied. The default auto repeat rate for the mouse buttons is 400
milliseconds. This may be changed to other values by edit-
-V Displays the version of the program. ing the ~/.mc/ini file and changing the mouse_repeat_rate
parameter.
-x Forces xterm mode. Used when running on xterm-
capable terminals (two screen modes, and able to If you are running the Commander with the mouse support,
send mouse escape sequences). you can bypass the Commander and get the default mouse
behavior (cutting and pasting text) by holding down the
0 !*
Shift key.
C-x l. Run the link command.

Keys C-x s. Run the symbolic link command.


Some commands in the Midnight Commander involve the use of
the Control (sometimes labeled CTRL or CTL) and the Meta C-x i. Set the other panel display mode to information.
(sometimes labeled ALT or even Compose) keys. In this man-
ual we will use the following abbreviations: C-x q. Set the other panel display mode to quick view.

C-<chr> means hold the Control key while typing the char- C-x !. Execute the External panelize command.
acter <chr>. Thus C-f would be: hold the Control key and
type f. C-x h Run the add directory to hotlist command.

M-<chr> means hold the Meta or Alt key down while typing M-!, Executes the Filtered view command, described in the
<chr>. If there is no Meta or Alt key, type ESC, release view command.
it, then type the character <chr>.
M-?, Executes the Find file command.
All input lines in the Midnight Commander use an approxi-
mation to the GNU Emacs editor's key bindings. M-c, Pops up the quick cd dialog.

There are many sections which tell about the keys. The C-o, When the program is being run in the Linux or SCO
following are the most important. console or under an xterm, it will show you the output of
the previous command. When ran on the Linux console, the
The File Menu section documents the keyboard shortcuts for Midnight Commander uses an external program (cons.saver)
the commands appearing in the File menu. This section to handle saving and restoring of information on the
includes the function keys. Most of these commands perform screen.
some action, usually on the selected file or the tagged
files. When the subshell support is compiled in, you can type C-o
at any time and you will be taken back to the Midnight
The Directory Panels section documents the keys which Commander main screen, to return to your application just
select a file or tag files as a target for a later action type C-o. If you have an application suspended by using
(the action is usually one from the file menu). this trick, you won't be able to execute other programs
from the Midnight Commander until you terminate the sus-
The Shell Command Line section list the keys which are pended application.
used for entering and editing command lines. Most of these
copy file names and such from the directory panels to the
command line (to avoid excessive typing) or access the Directory Panels
command line history. This section lists the keys which operate on the directory
panels. If you want to know how to change the appearance
Input Line Keys are used for editing input lines. This of the panels take a look at the section on Left and Right
means both the command line and the input lines in the Menus.
query dialogs.
Tab, C-i. Change the current panel. The old other panel
becomes the new current panel and the old current panel
Miscellaneous Keys becomes the new other panel. The selection bar moves from
Here are some keys which don't fall into any of the other the old current panel to the new current panel.
categories:
Insert, C-t. To tag files you may use the Insert key (the
Enter. If there is some text in the command line (the one kich1 terminfo sequence) or the C-t (Control-t) sequence.
at the bottom of the panels), then that command is To untag files, just retag a tagged file.
executed. If there is no text in the command line then if
the selection bar is over a directory the Midnight Comman- M-g, M-h (or M-r), M-j. Used to select the top file in a
der does a chdir(2) to the selected directory and reloads panel, the middle file and the bottom one, respectively.
the information on the panel; if the selection is an exe-
cutable file then it is executed. Finally, if the exten- C-s, M-s. Start a filename search in the directory list-
sion of the selected file name matches one of the exten- ing. When the search is active the keypresses will be
sions in the extensions file then the corresponding com- added to the search string instead of the command line. If
mand is executed. the Show mini-status option is enabled the search string
is shown on the mini-status line. When typing, the selec-
C-l. Repaint all the information in the Midnight Comman- tion bar will move to the next file starting with the
der. typed letters. The backspace or DEL keys can be used to
correct typing mistakes. If C-s is pressed again, the next
C-x c. Run the Chmod command on a file or on the tagged match is searched for.
files.
M-t Toggle the current display listing to show the next
C-x o. Run the Chown command on the current file or on display listing mode. With this it is possible to quickly
the tagged files. switch from long listing to regular listing and the user
! !
defined listing mode. hostname completion for you.

C-\ (control-backslash). Show the directory hotlist and C-x t, C-x C-t. Copy the tagged files (or if there are no
change to the selected directory. tagged files, the selected file) of the current panel (C-x
t) or of the other panel (C-x C-t) to the command line.
+ (plus). This is used to select (tag) a group of files.
The Midnight Commander will prompt for a regular expres- C-x p, C-x C-p. The first key sequence copies the current
sion describing the group. When Shell Patterns are path name to the command line, and the second one copies
enabled, the regular expression is much like the regular the unselected panel's path name to the command line.
expressions in the shell (* standing for zero or more
characters and ? standing for one character). If Shell C-q. The quote command can be used to insert characters
Patterns is off, then the tagging of files is done with that are otherwise interpreted by the Midnight Commander
normal regular expressions (see ed (1)). (like the '+' symbol)

If the expression starts or ends with a slash (/), then it M-p, M-n. Use these keys to browse through the command
will select directories instead of files. history. M-p takes you to the last entry, M-n takes you to
the next one.
\ (backslash). Use the "\" key to unselect a group of
files. This is the opposite of the Plus key. M-h. Displays the history for the current input line.

up-key, C-p. Move the selection bar to the previous entry


in the panel. General Movement Keys
The help viewer, the file viewer and the directory tree
down-key, C-n. Move the selection bar to the next entry use common code to handle moving. Therefore they accept
in the panel. exactly the same keys. Each of them also accepts some keys
of its own.
home, a1, M-<. Move the selection bar to the first entry
in the panel. Other parts of the Midnight Commander use some of the same
movement keys, so this section may be of use for those
end, c1, M->. Move the selection bar to the last entry in parts too.
the panel.
Up, C-p. Moves one line backward.
next-page, C-v. Move the selection bar one page down.
Down, C-n. Moves one line forward.
prev-page, M-v. Move the selection bar one page up.
Prev Page, Page Up, M-v. Moves one pageful backward.
M-o, If the other panel is a listing panel and you are
standing on a directory in the current panel, then the Next Page, Page Down, C-v. Moves one pageful forward.
other panel contents are set to the contents of the cur-
rently selected directory (like Emacs' dired C-o key) oth- Home, A1. Moves to the beginning.
erwise the other panel contents are set to the parent dir
of the current dir. End, C1. Move to the end.

C-PageUp, C-PageDown Only when ran on the Linux console: The help viewer and the file viewer accept the following
does a chdir to ".." and to the currently selected direc- keys in addition the to ones mentioned above:
tory respectively.
b, C-b, C-h, Backspace, Delete. Moves one pageful
M-y Moves to the previous directory in the history, backward.
equivalent to depressing the '<' with the mouse.
Space bar. Moves one pageful forward.
M-u Moves to the next directory in the history, equivalent
to depressing the '>' with the mouse. Displays the direc- u, d. Moves one half of a page backward or forward.
tory history, equivalent to depressing the 'v' with the
mouse. g, G. Moves to the beginning or to the end.

Shell Command Line Input Line Keys


This section lists keys which are useful to avoid exces- The input lines (they are used for the command line and
sive typing when entering shell commands. for the query dialogs in the program) accept these keys:

M-Enter. Copy the currently selected file name to the C-a puts the cursor at the beginning of line.
command line.
C-e puts the cursor at the end of the line.
C-Enter. Same a M-Enter, this one only works on the Linux
console. C-b, move-left move the cursor one position left.

M-Tab. Does the filename, command, variable, username and C-f, move-right move the cursor one position right.
! !!
command. The long view takes the whole screen width.
M-f moves one word forward.
If you choose the "User" display format, then you have to
M-b moves one word backward. specify the display format.

C-h, backspace delete the previous character. The user display format must start with a panel size spec-
ifier. This may be "half" or "full", and they specify a
C-d, Delete delete the character in the point (over the half screen panel and a full screen panel respectively.
cursor).
After the panel size, you may specify the two columns mode
C-@ sets the mark for cutting. on the panel, this is done by adding the number "2" to the
user format string.
C-w copies the text between the cursor and the mark to a
kill buffer and removes the text from the input line. After this you add the name of the fields with an optional
size specifier. This are the available fields you may
M-w copies the text between the cursor and the mark to a display:
kill buffer.
name, displays the file name.
C-y yanks back the contents of the kill buffer.
size, displays the file size.
C-k kills the text from the cursor to the end of the line.
bsize, is an alternative form of the size format. It dis-
M-p, M-n Use these keys to browse through the command his- plays the size of the files and for directories it just
tory. M-p takes you to the last entry, M-n takes you to shows SUB-DIR or UP--DIR.
the next one.
type, displays a one character field type. This character
M-C-h, M-Backspace delete one word backward. is a superset of what is displayed by ls with the -F flag.
An asterisk for executable files, a slash for directories,
M-Tab does the filename, command, variable, username and an at-sign for links, an equal sign for sockets, a hyphen
hostname completion for you. for character devices, a plus sign for block devices, a
pipe for fifos, a tilde for symbolic links to directories
and an exclamation mark for stalled symlinks (links that
point nowhere).
Menu Bar
The menu bar pops up when you press F9 or click the mouse mtime, file's last modification time.
on the top row of the screen. The menu bar has five menus:
"Left", "File", "Command", "Options" and "Right". atime, file's last access time.

The Left and Right Menus allow you to modify the appear- ctime, file's creation time.
ance of the left and right directory panels.
perm, a string representing the current permission bits of
The File Menu lists the actions you can perform on the the file.
currently selected file or the tagged files.
mode, an octal value with the current permission bits of
The Command Menu lists the actions which are more general the file.
and bear no relation to the currently selected file or the
tagged files. nlink, the number of links to the file.

The Options Menu lists the actions which allow you to cus- ngid, the GID (numeric).
tomize the Midnight Commander.
nuid, the UID (numeric).

Left and Right Menus owner, the owner of the file.


The outlook of the directory panels can be changed from
the Left and Right menus. group, the group of the file.

inode, the inode of the file.


Listing Mode...
The listing mode view is used to display a listing of Also you may use these field names for arranging the dis-
files, there are four different listing modes available: play:
Full, Brief, Long, and User. The full directory view
shows the file name, the size of the file and the modifi- space, a space in the display format.
cation time.
mark, An asterisk if the file is tagged, a space if it's
The brief view shows only the file name and it has two not.
columns (therefore showing twice as many files as other
views). The long view is similar to the output of ls -l |, This character is used to add a vertical line to the
! !'
display format. the panelized information (See the section External panel-
ize for more information).
To force one field to a fixed size (a size specifier), you
just add a ':' and then the number of characters you want
the field to have, if the number is followed by the symbol File Menu
'+', then the size specifies the minimum field size, if The Midnight Commander uses the F1 - F10 keys as keyboard
the program finds out that there is more space on the shortcuts for commands appearing in the file menu. The
screen, it will then expand this field. escape sequences for the Fkeys are terminfo capabilities
kf1 trough kf10. On terminals without function key sup-
For example, the Full display corresponds to this format: port, you can achieve the same functionality by pressing
the ESC key and then a number in the range 1 through 9 and
half type,name,|,size,|,mtime 0 (corresponding to F1 to F9 and F10 respectively).

And the Long display corresponds to this format: The File menu has the following commands (keyboard short-
cuts in parentheses):
full
perm,space,nlink,space,owner,space,group,space,size,space, Help (F1)
mtime,space,name
Invokes the built-in hypertext help viewer. Inside the
This is a nice user display format: help viewer, you can use the Tab key to select the next
link and the Enter key to follow that link. The keys Space
half name,|,size:7,|,type,mode:3 and Backspace are used to move forward and backward in a
help page. Press F1 again to get the full list of accepted
Panels may also be set to the following modes: keys.

Info The info view display information related to the Menu (F2)
currently selected file and if possible information
about the current file system. Invoke the user menu. The user menu provides an easy way
to provide users with a menu and add extra features to the
Tree The tree view is quite similar to the directory Midnight Commander.
tree feature. See the section about it for more
information. View (F3, Shift-F3)

Quick View View the currently selected file. By default this invokes
In this mode, the panel will switch to a reduced the Internal File Viewer but if the option "Use internal
viewer that displays the contents of the currently view" is off, it invokes an external file viewer specified
selected file, if you select the panel (with the by the PAGER environment variable. If PAGER is undefined,
tab key or the mouse), you will have access to the the "view" command is invoked. If you use Shift-F3
usual viewer commands. instead, the viewer will be invoked without doing any for-
matting or preprocessing to the file.

Sort Order... Filtered View (M-!)


The eight sort orders are by name, by extension, by modi-
fication time, by access time, and by inode information this command prompts for a command and it's arguments (the
modification time, by size, by inode and unsorted. In the argument defaults to the currently selected file name),
Sort order dialog box you can choose the sort order and the output from such command is shown in the internal file
you may also specify if you want to sort in reverse order viewer.
by checking the reverse box.
Edit (F4)
By default directories are sorted before files but this
can be changed from the Options menu (option Mix all files Currently it invokes the vi editor, or the editor speci-
). fied in the EDITOR environment variable, or the Internal
File Editor if the use_internal_edit option is on.

Filter... Copy (F5)


The filter command allows you to specify a shell pattern
(for example *.tar.gz ) which the files must match to be Pop up an input dialog with destination that defaults to
shown. Regardless of the filter pattern, the directories the directory in the non-selected panel and copies the
and the links to directories are always shown in the currently selected file (or the tagged files, if there is
directory panel. at least one file tagged) to the directory specified by
the user in the input dialog. During this process, you can
press C-c or ESC to abort the operation. For details about
Reread source mask (which will be usually either * or ^\(.*\)$
The reread command reload the list of files in the direc- depending on setting of Use shell patterns) and possible
tory. It is useful if other processes have created or wildcards in the destination see Mask copy/rename.
removed files. If you have panelized file names in a
panel this will reload the directory contents and remove On some systems, it is possible to do the copy in the
!- !&
background by clicking on the background button (or press- This is used to select (tag) a group of files. The Mid-
ing M-b in the dialog box). The Background Jobs is used night Commander will prompt for a regular expression
to control the background process. describing the group. When Shell Patterns are enabled, the
regular expression is much like the filename globbing in
Link (C-x l) the shell (* standing for zero or more characters and ?
standing for one character). If Shell Patterns is off,
Create a hard link to the current file. then the tagging of files is done with normal regular
expressions (see ed (1)).
SymLink (C-x s)
To mark directories instead of files, the expression must
Create a symbolic link to the current file. To those of start or end with a '/'.
you who don't know what links are: creating a link to a
file is a bit like copying the file, but both the source Unselect group (\)
filename and the destination filename represent the same
file image. For example, if you edit one of these files, Used for unselecting a group of files. This is the oppo-
all changes you make will appear in both files. Some peo- site of the Select group command.
ple call links aliases or shortcuts.
Quit (F10, Shift-F10)
A hard link appears as a real file. After making it, there
is no way of telling which one is the original and which Terminate the Midnight Commander. Shift-F10 is used when
is the link. If you delete either one of them the other you want to quit and you are using the shell wrapper.
one is still intact. It is very difficult to notice that Shift-F10 will not take you to the last directory you vis-
the files represent the same image. Use hard links when ited with the Midnight Commander, instead it will stay at
you don't even want to know. the directory where you started the Midnight Commander.

A symbolic link is a reference to the name of the original


file. If the original file is deleted the symbolic link is Quick cd
useless. It is quite easy to notice that the files repre- This command is useful if you have a full command line and
sent the same image. The Midnight Commander shows an want to cd somewhere without having to yank and paste the
"@"-sign in front of the file name if it is a symbolic command line. This command pops up a small dialog, where
link to somewhere (except to directory, where it shows a you enter everything you would enter after cd on the com-
tilde (~)). The original file which the link points to is mand line and then you press enter. This features all the
shown on mini-status line if the Show mini-status option things that are already in the internal cd command.
is enabled. Use symbolic links when you want to avoid the
confusion that can be caused by hard links.
Command Menu
Rename/Move (F6) The Directory tree command shows a tree figure of the
directories.
Pop up an input dialog that defaults to the directory in
the non-selected panel and moves the currently selected The Find file command allows you to search for a specific
file (or the tagged files if there is at least one tagged file. The "Swap panels" command swaps the contents of the
file) to the directory specified by the user in the input two directory panels.
dialog. During the process, you can press C-c or ESC to
abort the operation. For more details look at Copy opera- The "Panels on/off" command shows the output of the last
tion above, most of the things are quite similar. shell command. This works only on xterm and on Linux and
SCO console.
On some systems, it is possible to do the copy in the
background by clicking on the background button (or press- The Compare directories (C-x d) command compares the
ing M-b in the dialog box). The Background Jobs is used to directory panels with each other. You can then use the
control the background process. Copy (F5) command to make the panels identical. There are
three compare methods. The quick method compares only file
Mkdir (F7) size and file date. The thorough method makes a full byte-
by-byte compare. The thorough method is not available if
Pop up an input dialog and creates the directory speci- the machine does not support the mmap(2) system call. The
fied. size-only compare method just compares the file sizes and
does not check the contents or the date times, it just
Delete (F8) checks the file size.

Delete the currently selected file or the tagged files in The Command history command shows a list of typed com-
the currently selected panel. During the process, you can mands. The selected command is copied to the command line.
press C-c or ESC to abort the operation. The command history can also be accessed by typing M-p or
M-n.
Quick cd (M-c) Use the quick cd command if you have full
command line and want to cd somewhere. The Directory hotlist (C-\) command makes changing of the
current directory to often used directories faster.
Select group (+)
The External panelize allows you to execute an external
!0 *
program, and make the output of that program the contents string. If there is no such directory these keys will move
of the current panel. one line down.

Extension file edit command allows you to specify programs C-h, Backspace. Delete the last character of the search
to executed when you try to execute, view, edit and do a string.
bunch of other thing on files with certain extensions
(filename endings). The Menu file edit command may be used Any other character. Add the character to the search
for editing the user menu (which appears by pressing F2). string and move to the next directory which starts with
these characters. In the tree view you must first activate
the search mode by pressing C-s. The search string is
Directory Tree shown in the mini status line.
The Directory Tree command shows a tree figure of the
directories. You can select a directory from the figure The following actions are available only in the directory
and the Midnight Commander will change to that directory. tree. They aren't supported in the tree view.

There are two ways to invoke the tree. The real directory F1 (Help). Invoke the help viewer and show this section.
tree command is available from Commands menu. The other
way is to select tree view from the Left or Right menu. Esc, F10. Exit the directory tree. Do not change the
directory.
To get rid of long delays the Midnight Commander creates
the tree figure by scanning only a small subset of all the The mouse is supported. A double-click behaves like Enter.
directories. If the directory which you want to see is See also the section on mouse support.
missing, move to its parent directory and press C-r (or
F2).
Find File
You can use the following keys: The Find File feature first asks for the start directory
for the search and the filename to be searched for. By
General movement keys are accepted. pressing the Tree button you can select the start direc-
tory from the directory tree figure.
Enter. In the directory tree, exits the directory tree
and changes to this directory in the current panel. In the The contents field accepts regular expressions similar to
tree view, changes to this directory in the other panel egrep(1). That means you have to escape characters with a
and stays in tree view mode in the current panel. special meaning to egrep with "\", e.g. if you search for
"strcmp (" you will have to input "strcmp \(" (without the
C-r, F2 (Rescan). Rescan this directory. Use this when double quotes).
the tree figure is out of date: it is missing subdirecto-
ries or shows some subdirectories which don't exist any You can start the search by pressing the Ok button. Dur-
more. ing the search you can stop from the Stop button and con-
tinue from the Start button.
F3 (Forget). Delete this directory from the tree figure.
Use this to remove clutter from the figure. If you want You can browse the filelist with the up and down arrow
the directory back to the tree figure press F2 in its par- keys. The Chdir button will change to the directory of the
ent directory. currently selected file. The Again button will ask for the
parameters for a new search. The Quit button quits the
F4 (Static/Dynamic). Toggle between the dynamic naviga- search operation. The Panelize button will place the found
tion mode (default) and the static navigation mode. files to the current directory panel so that you can do
additional operations on them (view, copy, move, delete
In the static navigation mode you can use the Up and Down and so on). After panelizing you can press C-r to return
keys to select a directory. All known directories are to the normal file listing.
shown.
It is possible to have a list of directories that the Find
In the dynamic navigation mode you can use the Up and Down File command should skip during the search (for example,
keys to select a sibling directory, the Left key to move you may want to avoid searches on a CDROM or on a NFS
to the parent directory, and the Right key to move to a directory that is mounted across a slow link).
child directory. Only the parent, sibling and children
directories are shown, others are left out. The tree fig- Directories to be skipped should be set on the variable
ure changes dynamically as you traverse. find_ignore_dirs in the Misc section of your ~/.mc/ini
file.
F5 (Copy). Copy the directory.
Directory components should be separated with a colon,
F6 (RenMov). Move the directory. here is an example:

F7 (Mkdir). Make a new directory below this directory. [Misc]


find_ignore_dirs=/cdrom:/nfs/wuarchive:/afs
F8 (Delete). Delete this directory from the file system.
You may consider using the External panelize command for
C-s, M-s. Search the next directory matching the search some operations. Find file command is for simple queries
only, while using External panelize you can do as mysteri- (desc is then any extension (no wildcards), i.e.
ous searches as you would like. matches all the files *desc . Example: .tar matches
*.tar)

External panelize regex


The External panelize allows you to execute an external
program, and make the output of that program the contents (desc is a regular expression)
of the current panel.
type
For example, if you want to manipulate in one of the pan-
els all the symbolic links in the current directory, you (file matches this if `file %f` matches regular
can use external panelization to run the following com- expression desc (the filename: part from `file %f`
mand: is removed))

find . -type l -print default


Upon command completion, the directory contents of the
panel will no longer be the directory listing of the cur- (matches any file no matter what desc is)
rent directory, but all the files that are symbolic links.
Other lines should start with a space or tab and should be
If you want to panelize all of the files that have been of the format:
downloaded from your ftp server, you can use this awk com-
mand to extract the file name from the transfer log files: keyword=commandNL (with no spaces around =), where keyword
should be:
awk '$9 ~! /incoming/ { print $9 }' < /usr/adm/xferlog
Open (if the user presses Enter or doubleclicks it), View
You may want to save often used panelize commands under a (F3), Edit (F4), Drop (user drops some files on it) or any
descriptive name, so that you can recall them quickly. You other user defined name (those will be listed in the
do this by typing the command on the input line and press- extension dependent pop-up menu). Icon name is reserved
ing Add new button. Then you enter a name under which you for future use by mc.
want the command to be saved. Next time, you just choose
that command from the list and do not have to type it command is any one-line shell command, with the simple
again. macro substitution.

Target are evaluated from top to bottom (order is thus


Hotlist important). If some actions are missing, search continues
The Directory hotlist command shows the labels of the as if this target didn't match (i.e. if a file matches the
directories in the directory hotlist. The Midnight Comman- first and second entry and View action is missing in the
der will change to the directory corresponding to the first one, then on pressing F3 the View action from the
selected label. From the hotlist dialog, you can remove second entry will be used. default should catch all the
already created label/directory pairs and add new one. For actions.
adding you may want to use a standalone Add to hotlist
command (C-x h), which adds the current directory into the
directory hotlist, as well. The user is prompted for a Background Jobs
label for the directory. This lets you control the state of any background Midnight
Commander process (only copy and move files operations can
This makes cd to often used directories faster. You may be done in the background). You can stop, restart and
consider using the CDPATH variable as described in inter- kill a background job from here.
nal cd command description.

Menu File Edit


Extension File Edit The user menu is a menu of useful actions that can be cus-
This will invoke your editor on the file ~/.mc/ext. The tomized by the user. When you access the user menu, the
format of this file is as follows (the format has changed file .mc.menu from the current directory is used if it
with version 3.0): exists, but only if it is owned by user or root and is not
world-writable. If no such file found, ~/.mc/menu is
All lines starting with # or empty lines are thrown away. tried in the same way, and otherwise mc uses the default
system-wide menu /usr/lib/mc/mc.menu.
Lines starting in the first column should have following
format: The format of the menu file is very simple. Lines that
start with anything but space or tab are considered
keyword/descNL, i.e. everything after keyword/ until new entries for the menu (in order to be able to use it like a
line is desc hot key, the first character should be a letter). All the
lines that start with a space or a tab are the commands
keyword can be: that will be executed when the entry is selected.

shell When an option is selected all the command lines of the


option are copied to a temporary file in the temporary
!
directory (usually /usr/tmp) and then that file is exe-
cuted. This allows the user to put normal shell constructs Type is one or more of the following characters:
in the menus. Also simple macro substitution takes place
before executing the menu code. For more information, see n not directory
macro substitution. r regular file
d directory
Here is a sample mc.menu file: l link
c char special
A Dump the currently selected file b block special
od -c %f f fifo
s socket
B Edit a bug report and send it to root x executable
vi /tmp/mail.$$ t tagged
mail -s "Midnight Commander bug" root < /tmp/mail.$$
For example 'rlf' means either regular file, link or fifo.
M Read mail The 't' type is a little special because it acts on the
emacs -f rmail panel instead of the file. The condition '=t t' is true if
there are tagged files in the current panel and false if
N Read Usenet news not.
emacs -f gnus
If the condition starts with '=?' instead of '=' a debug
H Call the info hypertext browser trace will be shown whenever the value of the condition is
info calculated.

J Copy current directory to other panel recursively The conditions are calculated from left to right. This
tar cf - . | (cd %D && tar xvpf -) means
= f *.tar.gz | f *.tgz & t n
K Make a release of the current subdirectory is calculated as
echo -n "Name of distribution file: " ( (f *.tar.gz) | (f *.tgz) ) & (t n)
read tar
ln -s %d `dirname %d`/$tar Here is a sample of the use of conditions:
cd ..
tar cvhf ${tar}.tar $tar = f *.tar.gz | f *.tgz & t n
L List the contents of a compressed tar-archive
= f *.tar.gz | f *.tgz & t n gzip -cd %f | tar xvf -
X Extract the contents of a compressed tar file
tar xzvf %f Addition Conditions

Default Conditions If the condition begins with '+' (or '+?') instead of '='
(or '=?') it is an addition condition. If the condition is
Each menu entry may be preceded by a condition. The condi- true the menu entry will be included in the menu. If the
tion must start from the first column with a '=' charac- condition is false the menu entry will not be included in
ter. If the condition is true, the menu entry will be the the menu.
default entry.
You can combine default and addition conditions by start-
Condition syntax: = <sub-cond> ing condition with '+=' or '=+' (or '+=?' or '=+?' if you
or: = <sub-cond> | <sub-cond> ... want debug trace). If you want to use two different condi-
or: = <sub-cond> & <sub-cond> ... tions, one for adding and another for defaulting, you can
precede a menu entry with two condition lines, one start-
Sub-condition is one of following: ing with '+' and another starting with '='.

y <pattern> syntax of current file matching pattern? Comments are started with '#'. The additional comment
for edit menu only. lines must start with '#', space or tab.
f <pattern> current file matching pattern?
F <pattern> other file matching pattern?
d <pattern> current directory matching pattern? Options Menu
D <pattern> other directory matching pattern? The Midnight Commander has some options that may be tog-
t <type> current file of type? gled on and off in several dialogs which are accessible
T <type> other file of type? from this menu. Options are enabled if they have an aster-
x <filename> is it executable filename? isk or "x" in front of them.
! <sub-cond> negate the result of sub-condition
The Configuration command pops up a dialog from which you
Pattern is a normal shell pattern or a regular expression, can change most of settings of the Midnight Commander.
according to the shell patterns option. You can override
the global value of the shell patterns option by writing The Display bits command pops up a dialog from which you
"shell_patterns=x" on the first line of the menu file may select which characters is your terminal able to dis-
(where "x" is either 0 or 1). play.
'
of your command. If you are using the Linux or SCO
The Confirmation command pops up a dialog from which you console or an xterm, you will be able to see the
specify which actions you want to confirm. output of the command by typing C-o.

The Learn keys command pops up a dialog from which you On dumb terminals You will get the pause message on
test some keys which are not working on some terminals and terminals that are not capable of showing the out-
you may fix them. put of the last command executed (any terminal that
is not an xterm or the Linux console).
The Virtual FS command pops up a dialog from which you
specify some VFS related options. Always The program will pause after executing all
of your commands.
The Layout command pops up a dialog from which you specify
a bunch of options how mc looks like on the screen. Other Options

The Save setup command saves the current settings of the Verbose operation. This toggles whether the file Copy,
Left, Right and Options menus. A small number of other Rename and Delete operations are verbose (i.e., display a
settings is saved, too. dialog box for each operation). If you have a slow termi-
nal, you may wish to disable the verbose operation. It is
automatically turned off if the speed of your terminal is
Configuration less than 9600 bps.
The options in this dialog are divided into three groups:
Panel Options, Pause after run and Other Options. Compute totals. If this option is enabled, the Midnight
Commander computes total byte sizes and total number of
Panel Options files prior to any Copy, Rename and Delete operations.
This will provide you with a more accurate progress bar at
Show Backup Files. By default the Midnight Commander the expense of some speed. This option has no effect, if
doesn't show files ending in '~' (like GNU's ls option Verbose operation is disabled.
-B).
Shell Patterns. By default the Select, Unselect and Fil-
Show Hidden Files. By default the Midnight Commander will ter commands will use shell-like regular expressions. The
show all files that start with a dot (like ls -a). following conversions are performed to achieve this: the
'*' is replaced by '.*' (zero or more characters); the '?'
Mark moves down. By default when you mark a file (with is replaced by '.' (exactly one character) and '.' by the
either C-t or the Insert key) the selection bar will move literal dot. If the option is disabled, then the regular
down. expressions are the ones described in ed(1).

Drop down menus. When this option is enabled, when you Auto Save Setup. If this option is enabled, when you exit
press the F9 key, the pull down menus will be activated, the Midnight Commander the configurable options of the
else, you will only be presented with the menu title, and Midnight Commander are saved in the ~/.mc/ini file.
you will have to select the entry with the arrow keys or
the first letter and from there select your option in the Auto menus. If this option is enabled, the user menu will
menu. be invoked at startup. Useful for building menus for non-
unixers.
Mix all files. When this option is enabled, all files and
directories are shown mixed together. If the option is Use internal editor. If this option is enabled, the
off, directories (and links to directories) are shown at built-in file editor is used to edit files. If the option
the beginning of the listing, and other files afterwards. is disabled, the editor specified in the EDITOR environ-
ment variable is used. If no editor is specified, vi is
Fast directory reload. This option is off by default. If used. See the section on the internal file editor.
you activate the fast reload, the Midnight Commander will
use a trick to determine if the directory contents have Use internal viewer. If this option is enabled, the
changed. The trick is to reload the directory only if the built-in file viewer is used to view files. If the option
i-node of the directory has changed; this means that is disabled, the pager specified in the PAGER environment
reloads only happen when files are created or deleted. If variable is used. If no pager is specified, the view com-
what changes is the i-node for a file in the directory mand is used. See the section on the internal file
(file size changes, mode or owner changes, etc) the dis- viewer.
play is not updated. In these cases, if you have the
option on, you have to rescan the directory manually (with Complete: show all. By default the Midnight Commander
C-r). pops up all possible completions if the completion is
ambiguous if you press M-Tab for the second time, for the
Pause after run first time it just completes as much as possible and in
the case of ambiguity beeps. If you want to see all the
After executing your commands, the Midnight Commander can possible completions already after the first M-Tab press-
pause, so that you can examine the output of the command. ing, enable this option.
There are three possible settings for this variable:
Rotating dash. If this option is enabled, the Midnight
Never Means that you do not want to see the output Commander shows a rotating dash in the upper right corner
- &
as a work in progress indicator. type that key. If you want to abort this, press just Esc
and wait until the message disappears. Otherwise type the
Lynx-like motion. If this option is enabled, you may use key you're asked to type and also wait until the dialog
the arrows keys to automatically chdir if the current disappears.
selection is a subdirectory and the shell command line is
empty. By default, this setting is off. When you finish with all the keys, you may want either to
Save your key fixes into your ~/.mc/ini file into the
Advanced chown. If this option is enabled, the Advanced [terminal:TERM] section (where TERM is the name of your
Chown command will be invoked if you run the Chmod current terminal) or to discard them. If all your keys
or Chown command. were working properly and you had not to fix any key, then
(of course) no saving will occur.
Cd follows links. This option, if set, causes the Mid-
night Commander to follow the logical chain of directories
when changing current directory either in the panels, or Virtual FS
using the cd command. This is the default behavior of This option gives you control over the settings of the
bash. When unset, the Midnight Commander follows the real Virtual File System information cache.
directory structure, so cd .. if you've entered that
directory through a link will move you to the current The Midnight Commander keeps in memory the information
directory's real parent and not to the directory where the related to some of the virtual file systems to speed up
link was present. the access to the files in the file system (for example,
directory listings fetched from ftp servers).
Safe delete. If this option is enabled, deleting files
unintentionally will get more difficult. The default Moreover in order to access the contents of compressed
selection in the confirmation dialog changes from the files (for example, compressed tar files) the Midnight
"Yes" to the "No" button and deletion of non empty direc- Commander has to create a temporary uncompressed file on
tories has to be confirmed by entering the word yes . By your disk.
default this option is disabled.
Since both the information in memory and the temporary
files on disk take up resources, you may want to tune the
Display bits parameters of the cached information to decrease your
This is used to configure the range of visible characters resource usage or to maximize the speed of access to
on the screen. This setting may be 7-bits if your frequently used file systems.
terminal/curses supports only seven output bits,
ISO-8859-1 displays all the characters in the ISO-8859-1 The Tar file system is quite clever about how it handles
map and full 8 bits is for those terminals that can dis- tar files: it just loads the directory entries and when it
play full 8 bit characters. needs to use the information contained in the tar file, it
goes and grab it.

Confirmation In the wild, tar files are usually kept compressed (plain
In this menu you configure the confirmation options for tar files are species in extinction), and because of the
file deletion, overwriting, execution by pressing enter nature of those files (the directory entries for the tar
and quitting the program. files is not there waiting for us to be loaded), the tar
file system has to uncompress the file on the disk in a
temporary location and then access the uncompressed file
Learn keys as a regular tar file.
This dialog lets you test if your keys F1-F20, Home, End,
etc. work properly on your terminal. They often don't, Now, since we all love to browse files and tar files all
since many terminal databases are broken. over the disk, it's common that you will leave a tar file
and the re-enter it later. Since uncompression is slow,
You can move around with the Tab key, with the vi moving the Midnight Commander will cache the information in mem-
keys ('h' left, 'j' down, 'k' up and 'l' right) and after ory for a limited amount of time, after you hit the time-
you press any arrow key once (this will mark it OK), then out, all of the resources associated with the file system
you can use that key as well. will be freed. The default timeout is set to one minute.

You test them just by pressing each of them. As soon as The FTP File System keeps the directory listing it fetches
you press a key and the key works properly, OK should from a ftp server in a cache. The cache expire time is
appear next to the name of that key. Once a key is marked configurable with the ftpfs directory cache timeout
OK it starts to work as usually, e.g. F1 for the first option. A low value for this option may slow down every
time will just check that F1 works OK, but from that time operation on the ftp file System because every operation
on it will show help. The same applies to the arrow keys. is accompanied by a query of the ftp server.
Tab key should be working always.
Moreover you can define a proxy host for doing ftp trans-
If some keys do not work properly, then you won't see OK fers and configure the Midnight Commander to always use
after the key name after you have pressed that key. You the proxy host. See the section on FTP File System for
may then want to fix it. You do it by pressing the button more information.
of that key (either by mouse or using Tab and Enter).
Then a red message will appear and you will be asked to
0 '*
Layout it may not handle all of the nice macro expansion and sub-
The layout dialog gives you a possibility to change the stitution that your shell does, although it does some of
general layout of screen. You can specify whether the them:
menubar, the command prompt, the hintbar and the function
keybar are visible. On the Linux or SCO console you can Tilde substitution The (~) will be substituted with your
specify how many lines are shown in the output window. home directory, if you append a username after the tilde,
then it will be substituted with the login directory of
The rest of the screen area is used for the two directory the the specified user.
panels. You can specify whether the area is split to the
panels in vertical or horizontal direction. The split can For example, ~guest is the home directory for the user
be equal or you can specify an unequal split. guest, while ~/guest is the directory guest in your home
directory.
By default all contents of the directory panels are dis-
played with the same color, but you can specify whether Previous directory You can jump to the directory you were
permissions and file types are highlighted with special previously by using the special directory name '-' like
Colors. If permission highlighting is enabled, the parts this: cd -
of the perm and mode display fields which are valid for
the user running Midnight Commander are highlighted with CDPATH directories If the directory specified to the cd
the color defined with the selected keyword. If file type command is not in the current directory, then The Midnight
highlighting is enabled, files are colored according to Commander uses the value in the environment variable
their file type (e.g. directory, core file, executable, CDPATH to search for the directory in any of the named
...). directories.

If the Show Mini-Status option is enabled, one line of For example you could set your CDPATH variable to
status information about the currently selected item is ~/src:/usr/src, allowing you to change your directory to
showed at the bottom of the panels. any of the directories inside the ~/src and /usr/src
directories, from any place in the file system by using
it's relative name (for example cd linux could take you to
Save Setup /usr/src/linux).
At startup the Midnight Commander will try to load
initialization information from the ~/.mc/ini file. If
this file doesn't exist, it will load the information from Macro Substitution
the system-wide configuration file, located in When accessing a user menu, or executing an extension
/usr/lib/mc/mc.ini. If the system-wide configuration file dependent command, or running a command from the command
doesn't exist, MC uses the default settings. line input, a simple macro substitution takes place.

The Save Setup command creates the ~/.mc/ini file by sav- The macros are:
ing the current settings of the Left, Right and Options
menus. %i

If you activate the auto save setup option, MC will always The indent of blank space, equal the cursor column
save the current settings when exiting. position. For edit menu only.

There also exist settings which can't be changed from the %y


menus. To change these settings you have to edit the setup
file with your favorite editor. See the section on Special The syntax type of current file. For edit menu
Settings for more information. only.

%k

Executing operating system commands The block file name.


You may execute commands by typing them directly in the
Midnight Commander's input line, or by selecting the pro- %e
gram you want to execute with the selection bar in one of
the panels and hitting Enter. The error file name.

If you press Enter over a file that is not executable, the %m


Midnight Commander checks the extension of the selected
file against the extensions in the Extensions File. If a The current menu name.
match is found then the code associated with that exten-
sion is executed. A very simple macro expansion takes %f
place before executing the command.
The current file name.

The cd internal command %x


The cd command is interpreted by the Midnight Commander,
it is not passed to the command shell for execution. Thus The extension of current file name.
' '
%b The % character

The current file name without extension. %{some text}

%d Prompt for the substitution. An input box is shown


and the text inside the braces is used as a prompt.
The current directory name. The macro is substituted by the text typed by the
user. The user can press ESC or F10 to cancel. This
%F macro doesn't work on the command line yet.

The current file in the unselected panel.


The subshell support
%D The subshell support is a compile time option, that works
with the shells: bash, tcsh and zsh.
The directory name of the unselected panel.
When the subshell code is activated the Midnight Commander
%t will spawn a concurrent copy of your shell (the one
defined in the SHELL variable and if it is not defined,
The currently tagged files. then the one in the /etc/passwd file) and run it in a
pseudo terminal, instead of invoking a new shell each time
%T you execute a command, the command will be passed to the
subshell as if you had typed it. This also allows you to
The tagged files in the unselected panel. change the environment variables, use shell functions and
define aliases that are valid until you quit the Midnight
%u and %U Commander.

Similar to the %t and %T macros, but in addition If you are using bash you can specify startup commands for
the files are untagged. You can use this macro only the subshell in your ~/.mc/bashrc file and special key-
once per menu file entry or extension file entry, board maps in the ~/.mc/inputrc file. tcsh users may
because next time there will be no tagged files. specify startup commands in the ~/.mc/tcshrc file.

%s and %S When the subshell code is used, you can suspend applica-
tions at any time with the sequence C-o and jump back to
The selected files: The tagged files if there are the Midnight Commander, if you interrupt an application,
any. Otherwise the current file. you will not be able to run other external commands until
you quit the application you interrupted.
%q
An extra added feature of using the subshell is that the
Dropped files. In all places except in the Drop prompt displayed by the Midnight Commander is the same
action of the mc.ext file, this will become a null prompt that you are currently using in your shell.
string, in the Drop action it will be replaced with
a space separated list of files that were dropped The OPTIONS section has more information on how you can
on the file. control the subshell code.

%cd
Controlling Midnight Commander
This is a special macro that is used to change the The Midnight Commander defines an environment variable
current directory to the directory specified in MC_CONTROL_FILE. The commands executed by MC may give
front of it. This is used primarily as an inter- instructions to MC by writing to the file specified by
face to the Virtual File System. this variable. This is only available if you compiled
your copy of the Midnight Commander with the WANT_PARSE
%view option.

This macro is used to invoke the internal viewer. The following instructions are supported.
This macro can be used alone, or with arguments.
If you pass any arguments to this macro, they clear_tags Clear all tags.
should be enclosed in brackets. tag <filename> Tag specified file.
untag <filename> Untag specified file.
The arguments are: ascii to force the viewer into select <filename> Move pointer to file.
ascii mode; hex to force the viewer into hex mode; change_panel Switch between panels.
nroff to tell the viewer that it should interpret cd <path> Change directory.
the bold and underline sequences of nroff; unfor-
matted to tell the viewer to not interpret nroff If the first letter of the instruction is in lower case it
commands for making the text bold or underlined. operates on the current panel. If the letter is in upper
case the instruction operates on the other panel. The
%% additional letters must be in lower case. Instructions
' '!
must be separated by exactly one space, tab or newline. rently being operated on and there are at most three
The instructions don't work in the Info, Tree and Quick progress bars. The file bar tells how big part of the cur-
views. The first error causes the rest to be ignored. rent file has been copied so far. The count bar tells how
many of tagged files have been handled so far. The bytes
bar tells how big part of total size of the tagged files
Chmod has been handled so far. If the verbose option is off the
The Chmod window is used to change the attribute bits in a file and bytes bars are not shown.
group of files and directories. It can be invoked with
the C-x c key combination. There are two buttons at the bottom of the dialog. Press-
ing the Skip button will skip the rest of the current
The Chmod window has two parts - Permissions and File file. Pressing the Abort button will abort the whole oper-
ation, the rest of the files are skipped.
In the File section are displayed the name of the file or
directory and its permissions in octal form, as well as There are three other dialogs which you can run into dur-
its owner and group. ing the file operations.

In the Permissions section there is a set of check buttons The error dialog informs about error conditions and has
which correspond to the file attribute bits. As you three choices. Normally you select either the Skip button
change the attribute bits, you can see the octal value to skip the file or the Abort button to abort the opera-
change in the File section. tion altogether. You can also select the Retry button if
you fixed the problem from another terminal.
To move between the widgets (buttons and check buttons)
use the arrow keys or the Tab key. To change the state of The replace dialog is shown when you attempt to copy or
the check buttons or to select a button use Space. You move a file on the top of an existing file. The dialog
can also use the hotkeys on the buttons to quickly acti- shows the dates and sizes of the both files. Press the Yes
vate that selection (they are the highlit letters on the button to overwrite the file, the No button to skip the
buttons). file, the alL button to overwrite all the files, the nonE
button to never overwrite and the Update button to over-
To set the attribute bits, use the Enter key. write if the source file is newer than the target file.
You can abort the whole operation by pressing the Abort
When working with a group of files or directories, you button.
just click on the bits you want to set or clear. Once you
have selected the bits you want to change, you select one The recursive delete dialog is shown when you try to
of the action buttons (Set marked or Clear marked). delete a directory which is not empty. Press the Yes but-
ton to delete the directory recursively, the No button to
Finally, to set the attributes exactly to those specified, skip the directory, the alL button to delete all the
you can use the [Set all] button, which will act on all directories and the nonE button to skip all the non-empty
the tagged files. directories. You can abort the whole operation by pressing
the Abort button. If you selected the Yes or alL button
[Marked all] set only marked attributes to all selected you will be asked for a confirmation. Type "yes" only if
files you are really sure you want to do the recursive delete.

[Set marked] set marked bits in attributes of all selected If you have tagged files and perform an operation on them
files only the files on which the operation succeeded are
untagged. Failed and skipped files are left tagged.
[Clean marked] clear marked bits in attributes of all
selected files
Mask Copy/Rename
[Set] set the attributes of one file The copy/move operations lets you translate the names of
files in an easy way. To do it, you have to specify the
[Cancel] cancel the Chmod command correct source mask and usually in the trailing part of
the destination specify some wildcards. All the files
matching the source mask are copied/renamed according to
Chown the target mask. If there are tagged files, only the
The Chown command is used to change the owner/group of a tagged files matching the source mask are renamed.
file. The hot key for this command is C-x o.
There are other option which you can set:

Advanced Chown Follow links tells whether make the symlinks and hardlinks
The Advanced Chown command is the Chmod and Chown command in the source directory (recursively in subdirectories)
combined into one window. You can change the permissions new links in the target directory or whether would you
and owner/group of files at once. like to copy their content.

Dive into subdirs tells what to do if in the target direc-


File Operations tory exists a directory with the same name as the
When you copy, move or delete files the Midnight Commander file/directory being copied. The default action is to copy
shows the file operations dialog. It shows the files cur- it's content into that directory, by enabling this you can
' ''
copy the source directory into that directory. Perhaps an
example will help: The '\u' and '\l' are stronger than '\U' and '\L'.

You want to copy content of a directory foo to /bla/foo, For example, if the source mask is '*' (shell patterns on)
which is an already existing directory. Normally (when or '^\(.*\)$' (shell patterns off) and the target mask is
Dive is not set), mc would copy it exactly into /bla/foo. '\L\u*' the file names will be converted to have initial
By enabling this option you will copy the content into upper case and otherwise lower case.
/bla/foo/foo, because the directory already exists.
You can also use '\' as a quote character. For example,
Preserve attributes tells whether to preserve the original '\\' is a backslash and '\*' is an asterisk.
files' permissions, timestamps and if you are root whether
to preserve the original files' UID and GID. If this
option is not set the current value of the umask will be Internal File Viewer
respected. The internal file viewer provides two display modes: ASCII
and hex. To toggle between modes, use the F4 key. If you
Use shell patterns on have the GNU gzip program installed, it will be used to
automatically decompress the files on demand.
When the shell patterns option is on you can use the '*'
and '?' wildcards in the source mask. They work like they The viewer will try to use the best method provided by
do in the shell. In the target mask only the '*' and your system or the file type to display the information.
'\<digit>' wildcards are allowed. The first '*' wildcard The internal file viewer will interpret some string
in the target mask corresponds to the first wildcard group sequences to set the bold and underline attributes, thus
in the source mask, the second '*' corresponds to the sec- making a pretty display of your files.
ond group and so on. The '\1' wildcard corresponds to the
first wildcard group in the source mask, the '\2' wildcard When in hex mode, the search function accepts text in
corresponds to the second group and so on all the way up quotes and constant numbers. Text in quotes is matched
to '\9'. The '\0' wildcard is the whole filename of the exactly after removing the quotes. Each number matches
source file. one byte. You can mix quoted text with constants like
this:
Two examples:
"String" -1 0xBB 012 "more text"
If the source mask is "*.tar.gz", the destination is
"/bla/*.tgz" and the file to be copied is "foo.tar.gz", Note that 012 is an octal number. -1 is converted to
the copy will be "foo.tgz" in "/bla". 0xFF.

Let's suppose you want to swap basename and extension so Some internal details about the viewer: On systems that
that "file.c" will become "c.file" and so on. The source provide the mmap(2) system call, the program maps the file
mask for this is "*.*" and the destination is "\2.\1". instead of loading it; if the system does not provide the
mmap(2) system call or the file matches an action that
Use shell patterns off requires a filter, then the viewer will use it's growing
buffers, thus loading only those parts of the file that
When the shell patterns option is off the MC doesn't do you actually access (this includes compressed files).
automatic grouping anymore. You must use '\(...\)' expres-
sions in the source mask to specify meaning for the wild- Here is a listing of the actions associated with each key
cards in the target mask. This is more flexible but also that the Midnight Commander handles in the internal file
requires more typing. Otherwise target masks are similar viewer.
to the situation when the shell patterns option is on.
F1 Invoke the builtin hypertext help viewer.
Two examples:
F2 Toggle the wrap mode.
If the source mask is "^\(.*\)\.tar\.gz$", the destination
is "/bla/*.tgz" and the file to be copied is "foo.tar.gz", F4 Toggle the hex mode.
the copy will be "/bla/foo.tgz".
F5 Goto line. This will prompt you for a line number and
Let's suppose you want to swap basename and extension so will display that line.
that "file.c" will become "c.file" and so on. The source
mask for this is "^\(.*\)\.\(.*\)$" and the destination is F6, /. Regular expression search.
"\2.\1".
?, Reverse regular expression search.
Case Conversions
F7 Normal search / hex mode search.
You can also change the case of the filenames. If you use
'\u' or uppercase or lowercase correspondingly. C-s, F17, n. Start normal search if there was no previous
search expression else find next match.
If you use '\U' or '\L' in the target mask the next char-
acters will be converted to uppercase or lowercase corre- C-r. Start reverse search if there was no previous search
spondingly up to the next expression else find next match.
'- '&
and you can override the mouse as usual by holding down
F8 Toggle Raw/Parsed mode: This will show the file as the shift key while dragging the mouse to let normal ter-
found on disk or if a processing filter has been specified minal mouse highlighting work.
in the mc.ext file, then the output from the filter. Cur-
rent mode is always the other than written on the button To define a macro, press Ctrl-R
label, since on the button is the mode which you enter by and then type out the key strokes you want to be exe-
that key. cuted. Press Ctrl-R
again when finished. You can then assign the macro to any
F9 Toggle the format/unformat mode: when format mode is on key you like by pressing that key. The macro is executed
the viewer will interpret some string sequences to show when you press Ctrl-A and then the assigned key. The macro
bold and underline with different colors. Also, on button is also executed if you press Meta, Ctrl, or Esc and the
label is the other mode than current. assigned key, provided that the key is not used for any
other function. Once defined, the macro commands go into
F10, Esc. Exit the internal file viewer. the file .cedit/cooledit.macros
in your home directory. You can delete a macro by delet-
next-page, space, C-v. Scroll one page forward. ing the appropriate line in this file.

prev-page, M-v, C-b, backspace. Scroll one page backward. F19 will format the currently highlighted block (plain
text or C or C++ code or another). This is controlled by
down-key Scroll one line forward. the file /usr/lib/mc/edit.indent.rc which is copied to
.cedit/edit.indent.rc in your home directory the first
up-key Scroll one line backward. time you use it.

C-l Refresh the screen. You can use scanf search and replace to search and replace
a C format string. First take a look at the sscanf and
C-o Switch to the subshell and show the command screen. sprintf man pages to see what a format string is and how
it works. An example is as follows: Suppose you want to
! Like C-o, but run a new shell if the subshell is not replace all occurrences of say, an open bracket, three
running. comma separated numbers, and a close bracket, with the
word apples, the third number, the word oranges and then
[n] m Set the mark n. the second number, I would fill in the Replace dialog box
as follows:
[n] r Jump to the mark n.
Enter search string
C-f Jump to the next file. (%d,%d,%d)
Enter replace string
C-b Jump to the previous file. apples %d oranges %d
Enter replacement argument order
M-r Toggle the ruler. 3,2

It's possible to instruct the file viewer how to display a The last line specifies that the third and then the second
file, look at the Extension File Edit section number are to be used in place of the first and second.

Internal File Editor It is advisable to use this feature with Prompt on replace
The internal file editor provides most of the features of on, because a match is thought to be found whenever the
common full screen editors. It is invoked using F4 pro- number of arguments found matches the number given, which
vided the use_internal_edit option is set in the initial- is not always a real match. Scanf also treats whitespace
ization file. It has an extensible file size limit of six- as being elastic. Note that the scanf format % is very
teen megabytes and edits binary files flawlessly. useful for scanning strings, and whitespace.

The features it presently supports are: Block copy, move, The editor also displays non-us characters (160+). When
delete, cut, paste; key for key undo ; pull-down menus; editing binary files, you should set display bits to 7
file insertion; macro definition; regular expression bits in the options menu to keep the spacing clean.
search and replace (and our own scanf-printf search and
replace); shift-arrow MSW-MAC text highlighting (for the See also the file README.edit in the source tree for some
linux console only); insert-overwrite toggle; and an more info.
option to pipe text blocks through shell commands like
indent.
Completion
The editor is very easy to use and requires no tutoring. Let the Midnight Commander type for you.
To see what keys do what, just consult the appropriate
pull-down menu. Other keys are: Shift movement keys do Attempt to perform completion on the text before current
text highlighting. Ctrl-Ins copies to the file position. MC attempts completion treating the text as
cooledit.clip and Shift-Ins pastes from cooledit.clip. variable (if the text begins with $ ), username (if the
Shift-Del cuts to cooledit.clip, and Ctrl-Del deletes text begins with ~ ), hostname (if the text begins with @
highlighted text. The completion key also does a Return ) or command (if you are on the command line in the posi-
with an automatic indent. Mouse highlighting also works, tion where you might type a command, possible completions
'0 -*
then include shell reserved words and shell builtin com- Examples:
mands as well) in turn. If none of these produces a match,
filename completion is attempted. /#ftp:ftp.nuclecu.unam.mx/linux/local
/#ftp:tsx-11.mit.edu/pub/linux/packages
Filename, username, variable and hostname completion works /#ftp:!behind.firewall.edu/pub
on all input lines, command completion is command line /#ftp:guest@remote-host.com:40/pub
specific. If the completion is ambiguous (there are more /#ftp:miguel:xxx@server/pub
different possibilities), MC beeps and the following
action depends on the setting of the Complete: show all To connect to sites behind a firewall, you will need to
option in the Configuration dialog. If it is enabled, a use the prefix ftp://! (ie, with a bang character after
list of all possibilities pops up next to the current the double slash) to make the Midnight Commander use a
position and you can select with the arrow keys and Enter proxy host for doing the ftp transfer. You can define the
the correct entry. You can also type the first letters in proxy host in the Virtual File System dialog box.
which the possibilities differ to move to a subset of all
possibilities and complete as much as possible. If you Another option to set is the Always use ftp proxy option
press M-Tab again, only the subset will be shown in the in the Virtual File System dialog box. This will config-
listbox, otherwise the first item which matches all the ure the program to always use the proxy host. If this
previous characters will be highlighted. As soon as there variable is set, the program will do two things: consult
is no ambiguity, dialog disappears, but you can hide it by the /usr/lib/mc/mc.no_proxy file for lines containing host
canceling keys Esc, F10 and left and right arrow keys. If names that are local (if the host name starts with a dot,
Complete: show all is disabled, the dialog pops up only if it is assumed to be a domain) and to assume that any host-
you press M-Tab for the second time, for the first time MC names without dots in their names are directly accessible.
just beeps.
If you are using the ftpfs code with a filtering packet
router that does not allow you to use the regular mode of
Virtual File System opening files, you may want to force the program to use
The Midnight Commander is provided with a code layer to the passive-open mode. To use this, set the
access the file system; this code layer is known as the ftpfs_use_passive_connections option in the initialization
virtual file system switch. The virtual file system file.
switch allows the Midnight Commander to manipulate files
not located on the Unix file system. The Midnight Commander keeps the directory listing in a
cache. The cache expire time is configurable in the Vir-
Currently the Midnight Commander is packaged with some tual File System dialog box. This has the funny behavior
Virtual File Systems (VFS): the local file system, used that even if you make changes to a directory, they will
for accessing the regular Unix file system; the ftpfs, not be reflected in the directory listing until you force
used to manipulate files on remote systems with the FTP a cache reload with the C-r key. This is a feature (when
protocol; the tarfs, used to manipulate tar and compressed you think it's a bug, think about manipulating files on
tar files; the undelfs, used to recover deleted files on the other side of the Atlantic with ftpfs).
ext2 file systems (the default file system for Linux sys-
tems), fish (for manipulating files over shell connections
such as rsh and ssh) and finally the mcfs (Midnight Com- Tar File System
mander file system), a network based file system. The tar file system provides you with read-only access to
your tar files and compressed tar files by using the chdir
The VFS switch code will interpret all of the path names command. To change your directory to a tar file, you
used and will forward them to the correct file system, the change your current directory to the tar file by using the
formats used for each one of the file systems is described following syntax:
later in their own section.
/filename.tar:utar/[dir-inside-tar]

FTP File System The mc.ext file already provides a shortcut for tar files,
The ftpfs allows you to manipulate files on remote this means that usually you just point to a tar file and
machines, to actually use it, you may try to use the panel press return to enter into the tar file, see the Extension
command FTP link (accessible from the menubar) or you may File Edit section for details on how this is done.
directly change your current directory to it using the cd
command to a path name that looks like this: Examples:

/#ftp:[!][user[:pass]@]machine[:port][remote-dir] mc-3.0.tar.gz#utar/mc-3.0/vfs
/ftp/GCC/gcc-2.7.0.tar#utar
The, user, port and remote-dir elements are optional. If
you specify the user element, then the Midnight Commander The latter specifies the full path of the tar archive.
will try to logon on the remote machine as that user, oth-
erwise it will use your login name. The optional pass FIle transfer over SHell filesystem
element, if present is the password used for the connec- The fish file system is a network based file system that
tion. This use is not recommended (nor keeping this in allows you to manipulate the files in a remote machine as
your hotlist, unless you set the appropriate permissions if they were local. To use this, the other side has to
there, and then, it may not be entirely safe anyways). either run fish server, or has to have bash-compatible
shell.
- -
tion of the first scsi disk on Linux, you would use the
To connect to a remote machine, you just need to chdir following path name:
into a special directory which name is in the following
format: /#undel:sda2

/#sh:[user@]machine[:options]/[remote-dir] It may take a while for the undelfs to load the required
The, user, options and remote-dir information before you start browsing files there.
elements are optional. If you specify the user element
then the Midnight Commander will try to logon on the
remote machine as that user, otherwise it will use your Colors
login name. The Midnight Commander will try to detect if your terminal
supports color using the terminal database and your termi-
The options are 'C' - use compression and 'rsh' use rsh nal name. Sometimes it gets confused, so you may force
instead of ssh. If the remote-dir element is present, your color mode or disable color mode using the -c and -b flag
current directory on the remote machine will be set to respectively.
this one.
If the program is compiled with the Slang screen manager
Examples: instead of ncurses, it will also check the variable COL-
ORTERM, if it is set, it has the same effect as the -c
/#sh:onlyrsh.mx:r/linux/local flag.
/#sh:joe@want.compression.edu:C/private
/#sh:joe@noncompressed.ssh.edu/private You may specify terminals that always force color mode by
adding the color_terminals variable to the Colors section
of the initialization file. This will prevent the Midnight
Network File System Commander from trying to detect if your terminal supports
The Midnight Commander file system is a network base file color. Example:
system that allows you to manipulate the files in a remote [Colors]
machine as if they were local. To use this, the remote color_terminals=linux,xterm
machine must be running the mcserv(8) server program. color_terminals=terminal-name1,terminal-name2...

To connect to a remote machine, you just need to chdir The program can be compiled with both ncurses and slang,
into a special directory which name is in the following ncurses does not provide a way to force color mode:
format: ncurses uses just the information in the terminal
database.
/#mc:[user@]machine[:port][remote-dir]
The Midnight Commander provides a way to change the
The, user, port and remote-dir elements are optional. If default colors. Currently the colors are configured using
you specify the user element then the Midnight Commander the environment variable MC_COLOR_TABLE or the Colors sec-
will try to logon on the remote machine as that user, oth- tion in the initialization file.
erwise it will use your login name.
In the Colors section, the default color map is loaded
The port element is used when the remote machine running from the base_color variable. You can specify an alter-
on a special port (see the mcserv(8) manual page for more nate color map for a terminal by using the terminal name
information about ports); finally, if the remote-dir ele- as the key in this section. Example:
ment is present, your current directory on the remote
machine will be set to this one. [Colors]
base_color=
Examples: xterm=menu=magenta:marked=,magenta:markselect=,red

/#mc:ftp.nuclecu.unam.mx/linux/local The format for the color definition is:


/#mc:joe@foo.edu:11321/private
<keyword>=<foregroundcolor>,<backgroundcolor>:<keyword>= ...

Undelete File System The colors are optional, and the keywords are: normal,
On Linux systems, if you asked configure to use the ext2fs selected, marked, markselect, errors, input, reverse,
undelete facilities, you will have the undelete file sys- gauge; Menu colors are: menu, menusel, menuhot, menuhot-
tem available. Recovery of deleted files is only avail- sel; Dialog colors are: dnormal, dfocus, dhotnormal,
able on ext2 file systems. The undelete file system is dhotfocus; Help colors are: helpnormal, helpitalic, help-
just an interface to the ext2fs library to: retrieve all bold, helplink, helpslink; Viewer color is: viewunderline;
of the deleted files names on an ext2fs and provides and Special highlighting colors are: executable, directory,
to extract the selected files into a regular partition. link, device, special, core; Editor colors are: editnor-
mal, editbold, editmarked.
To use this file system, you have to chdir into the spe-
cial file name formed by the "/#undel" prefix and the file input determines the color of input lines used in query
name where the actual file system resides. dialogs.

For example, to recover deleted files on the second parti- gauge determines the color of the filled part of the
- -!
progress bar (gauge), which shows how many percent of tion to an ftp server that has denied the login.
files were copied etc. in a graphical way. If the value is zero, the the program will not
retry the login.
The dialog boxes use the following colors: dnormal is used
for the normal text, dfocus is the color used for the cur- ftpfs_use_passive_connections.
rently selected component, dhotnormal is the color used to
differentiate the hotkey color in normal components, This option is by off default. This makes the
whereas the dhotfocus color is used for the highlighted ftpfs code use the passive open mode for transfer-
color in the currently selected component. ring files. This is used by people that are behind
a filtering packet router. This option just works
Menus use the same scheme but uses the menu, menusel, if you are not using an ftp proxy.
menuhot and menuhotsel tags instead.
max_dirt_limit.
Help uses the following colors: helpnormal is used for
normal text, helpitalic is used for text which is empha- Specifies how many screen updates can be skipped at
sized in italic in the manual page, helpbold is used for most in the internal file viewer. Normally this
text which is emphasized in bold in the manual page, value is not significant, because the code automat-
helplink is used for not selected hyperlinks and helpslink ically adjusts the number of updates to skip
is used for selected hyperlink. according to the rate of incoming keypresses. How-
ever, on very slow machines or terminals with a
Special highlight colors determine how files are displayed fast keyboard auto repeat, a big value can make
when file highlighting is enabled (see the section on Lay- screen updates too jumpy.
out). directory is used for directories or symbolic links
to directories; executable for executable files; link is It seems that setting max_dirt_limit to 10 causes
used for symbolic links which are neither stalled nor the best behavior, and that is the default value.
linked to a directory; stalledlink is used for stalled
symbolic links; device - character and block devices; spe- mouse_move_pages.
cial is used for special files, such as FIFOs and IPC
sockets; core is for core files. Controls whenever scrolling with the mouse is done
by pages or line by line on the panels.
The possible colors are: black, gray, red, brightred,
green, brightgreen, brown, yellow, blue, brightblue, mouse_move_pages_viewer.
magenta, brightmagenta, cyan, brightcyan, lightgray and
white. And there is a special keyword for transparent Controls if scrolling with the mouse is done by
background. It is 'default'. The 'default' can only be pages or line by line on the internal file viewer.
used for background color. Example:
[Colors] old_esc_mode
base_color=normal=white,default:marked=magenta,default
By default the Midnight Commander treats the ESC
key as a key prefix (old_esc_mode=0), if you set
Special Settings this option (old_esc_mode=1), then the ESC key will
Most of the settings of the Midnight Commander can be act as a prefix key for one second, and if no extra
changed from the menus. However, there are a small number keys have arrived, then the ESC key is interpreted
of settings which can only be changed by editing the setup as a cancel key (ESC ESC).
file.

These variables may be set in your ~/.mc/ini file: only_leading_plus_minus

clear_before_exec. set special treatment for '+', '-', '*' in command


line (select, unselect, reverse selection) only if
By default the Midnight Commander clears the screen command line is empty. No need to quote this char-
before executing a command. If you would prefer to acters in the middle of the command line. But we
see the output of the command at the bottom of the can not change selection when command line is not
screen, edit your ~/mc.ini file and change the empty. panel_scroll_pages
value of the field clear_before_exec to 0.
If set (the default), panel will scroll by half the
confirm_view_dir. display when the cursor reaches the end or the
beginning of the panel, otherwise it will just
If you press F3 on a directory, normally MC enters scroll a file at a time.
that directory. If this flag is set to 1, then MC
will ask for confirmation before changing the preserve_uidgid
directory if you have files tagged.
If this option is set (the default), when logged in
ftpfs_retry_seconds. as root the default will be to preserve the UID and
the GID of files. Some users prefer to disable
This value is the number of seconds the Midnight this option, so that's why it's configurable.
Commander will wait before attempting a reconnec-
- -'
show_output_starts_shell delete the delete character
complete to do completion
This variable only works if you are not using the
subshell support. When you use the C-o keystroke For example, to define the key insert to be the Escape + [
to go back to the user screen, if this one is set, + O + p, you set this in the ini file:
you will get a fresh shell. Otherwise, pressing
any key will bring you back to the Midnight Comman- insert=\e[Op
der.
The complete key symbol represents the escape sequences
torben_fj_mode used to invoke the completion process, this is invoked
with M-tab, but you can define other keys to do the same
If this flag is set, then the home and end keys work (on those keyboard with tons of nice and unused keys
will work slightly different on the panels, instead everywhere).
of moving the selection to the first and last files
in the panels, they will act as follows:

The home key will: Go up to the middle line, if FILES


below it; else go to the top line unless it is The program will retrieve all of its information relative
already on the top line, in this case it will go to to the MCHOME environment variable, if this variable is
the first file in the panel. not set, then it will fall back to the /usr directory.

The end key has a similar behavior: Go down to the /usr/lib/mc/mc.hlp


middle line, if over it; else go to the bottom line
unless you already are at the bottom line, in such The help file for the program.
case it will move the selection to the last file
name in the panel. /usr/lib/mc/mc.ext

use_file_to_guess_type The default system-wide extensions file.

If this variable is on (the default) it will spawn ~/.mc/ext


the file command to match the file types listed on
the mc.ext file. User's own extension, view configuration and edit
configuration file. They override the contents of
xterm_mode the system wide files if present.

If this variable is on (default is off) when you /usr/lib/mc/mc.ini


browse the file system on a Tree panel, it will
automatically reload the other panel with the con- The default system-wide setup for the Midnight Com-
tents of the selected directory. mander, used only if the user doesn't have his own
~/.mc/ini file.

Terminal databases /usr/lib/mc/mc.lib


The Midnight Commander provides a way to fix your system
terminal database without requiring root privileges. The Global settings for the Midnight Commander. Set-
Midnight Commander searches in the system initialization tings in this file affect all users, whether they
file (the mc.lib file located in the Midnight Commander have ~/.mc/ini or not, as long as ~/.mc/ini doesn't
library directory) and in the ~/.mc/ini file for the sec- override them. Currently, only terminal settings
tion "terminal:your-terminal-name" and then for the sec- are loaded from mc.lib.
tion "terminal:general", each line of the section contains
a key symbol that you want to define, followed by an equal ~/.mc/ini
sign and the definition for the key. You can use the spe-
cial \e form to represent the escape character and the ^x User's own setup. If this file is present then the
to represent the control-x character. setup is loaded from here instead of the system-
wide startup file.
The possible key symbols are:
/usr/lib/mc/mc.hint
f0 to f20 Function keys f0-f20
bs backspace This file contains the hints (cookies) displayed by
home home key the program.
end end key
up up arrow key /usr/lib/mc/mc.menu
down down arrow key
left left arrow key This file contains the default system-wide applica-
right right arrow key tions menu.
pgdn page down key
pgup page up key ~/.mc/menu
insert the insert character
-- -&
User's own application menu. If this file is pre- Tomasz Cholewo (tjchol01@mecca.spd.louisville.edu), Torben
sent it is used instead of the system-wide applica- Fjerdingstad (torben.fjerdingstad@uni-c.dk), Vadim Sinoli-
tions menu. tis (vvs@nsrd.npi.msu.su) and Wim Osterholt
(wim@djo.wtm.tudelft.nl).
~/.mc/Tree

The directory list for the directory tree and tree BUGS
view features. See the file TODO in the distribution for information on
what remains to be done.
./.mc.menu
If you want to report a problem with the program, please
Local user-defined menu. If this file is present it send mail to this address: mc-devel@gnome.org.
is used instead of the home or system-wide applica-
tions menu. Provide a detailed description of the bug, the version of
the program you are running (mc -V display this informa-
tion), the operating system you are running the program on
LICENSE and if the program crashes, we would appreciate a stack
This program is distributed under the terms of the GNU trace.
General Public License as published by the Free Software
Foundation. See the built-in help for details on the
License and the lack of warranty.

AVAILABILITY 30 October 1998 mc(1)


The latest version of this program can be found at
ftp://ftp.gnome.org/mirror/gnome.org/stable/sources/mc/
and on the mirrors listed on the GNOME site
http://www.gnome.org/. &- &-
SEE ALSO
ed(1), gpm(1), mcserv(8), terminfo(1), view(1), sh(1),
bash(1), tcsh(1), zsh(1).
NAME
The Midnight Commander page on the World Wide Web: mcedit - Full featured terminal text editor for Unix-like
http://www.gnome.org/mc/ systems.

USAGE
AUTHORS mcedit [[+number] file [-bcCdfhstVx?]]
Miguel de Icaza (miguel@ximian.com), Janne Kukonlehto
(jtklehto@paju.oulu.fi), Radek Doulik (rodo@ucw.cz), Fred DESCRIPTION
Leeflang (fredl@nebula.ow.org), Dugan Porter Mcedit is a link to mc, the Midnight Commander, forcing it
(dugan@b011.eunet.es), Jakub Jelinek (jj@sun- to immediately start its internal editor. The editor is a
site.mff.cuni.cz), Ching Hui (mr854307@cs.nthu.edu.tw), terminal version of the cooledit standalone X Window edi-
Andrej Borsenkow (borsenkow.msk@sni.de), Norbert Warmuth tor.
(nwarmuth@privat.circular.de), Mauricio Plaza (mok@rox-
anne.nuclecu.unam.mx), Paul Sheer (psheer@icon.co.za), OPTIONS
Pavel Machek (pavel@ucw.cz) and Pavel Roskin +number
(proski@gnu.org) are the developers of this package. Go to the line specified by number (do not insert
Alessandro Rubini (rubini@ipvvis.unipv.it) has been espe- a space between the "+" sign and the number).
cially helpful debugging and enhancing the program's mouse
support, John Davis (davis@space.mit.edu) also made his S- -b Forces black and white display.
Lang library available to us under the GPL and answered my
questions about it, and the following people have con- -c Force color mode on terminals where mcedit defaults
tributed code and many bug fixes (in alphabetical order): to black and white.

Adam Tla/lka (atlka@sunrise.pg.gda.pl), alex@bcs.zp.ua -C <keyword>=<FGcolor>,<BGcolor>:<keyword>= ...


(Alex I. Tkachenko), Antonio Palama, DOS port Used to specify a different color set, where key-
(palama@posso.dm.unipi.it), Erwin van Eijk (wabbit@cor- word is one of normal, selected, marked, markse-
ner.iaf.nl), Gerd Knorr (kraxel@cs.tu-berlin.de), Jean- lect, errors, reverse menu, menusel, menuhot,
Daniel Luiset (luiset@cih.hcuge.ch), Jon Stevens menuhotsel and gauge. The colors are optional and
(root@dolphin.csudh.edu), Juan Francisco Grigera, Win32 are one of black, gray, red, brightred, green,
port (j-grigera@usa.net), Juan Jose Ciarlante (jjcia- brightgreen, brown, yellow, blue, brightblue,
rla@raiz.uncu.edu.ar), Ilya Rybkin magenta, brightmagenta, cyan, brightcyan, lightgray
(rybkin@rouge.phys.lsu.edu), Marcelo Roccasalva (mfroc- and white. See the Colors section in mc.1 for more
cas@raiz.uncu.edu.ar), Massimo Fontanelli information.
(MC8737@mclink.it), Sergey Ya. Korshunoff
(root@seyko.msk.su), Thomas Pundt (pundtt@math.uni-muen- -d Disables mouse support.
ster.de), Timur Bakeyev (timur@goff.comtat.kazan.su),
-0 &*
-f Displays the compiled-in search paths for Midnight #!/bin/sh
Commander files. # Use $HOME instead of ~ if this doesn't work.
# You may also have to use a different redirection
-t Used only if the code was compiled with Slang and # syntax for some machines.
terminfo: it makes the Midnight Commander use the /usr/bin/indent -kr -pcs ~/.cedit/cooledit.block >& /dev/null
value of the TERMCAP variable for the terminal cat /dev/null > ~/.cedit/cooledit.error
information instead of the information on the sys-
tem wide terminal database C-p will run ispell on a block of text in a similar way.
The file is .cedit/edit.spell.rc
-V Displays the version of the program.
#!/bin/sh
-x Forces xterm mode. Used when running on xterm- # Use $HOME instead of ~ if this doesn't work.
capable terminals (two screen modes, and able to # You may also have to use a different redirection
send mouse escape sequences). # syntax for some machines.
/usr/local/bin/ispell ~/.cedit/cooledit.block >& /dev/null
cat /dev/null > ~/.cedit/cooledit.error
Features
The internal file editor provides most of the features of
common full screen editors. It has an extensible file size Redefining Keys
limit of sixteen megabytes and edits binary files flaw- Keys may be redefined from the Midnight Commander options
lessly. The features it presently supports are: Block menu.
copy, move, delete, cut, paste; key for key undo ; pull-
down menus; file insertion; macro definition; regular
expression search and replace (and our own scanf-printf SYNTAX HIGHLIGHTING
search and replace); shift-arrow MSW-MAC text highlighting As of version 3.6.0, cooledit has syntax highlighting.
(for the linux console only); insert-overwrite toggle; This means that keywords and contexts (like C comments,
word-wrap; a variety of tabbing options; syntax highlight- string constants, etc) are highlighted in different
ing for various file types; and an option to pipe text colours. The following section explains the format of the
blocks through shell commands like indent and ispell. file ~/.cedit/syntax.

The file ~/.cedit/syntax is rescanned on opening of a any


Keys new editor file. The file contains rules for highlighting,
The editor is very easy to use and requires no tutoring. each of which is given on a separate line, and define
To see what keys do what, just consult the appropriate which keywords will be highlighted to what colour. The
pull-down menu. Other keys are: Shift movement keys do file is also divided into sections, each beginning with a
text highlighting (Linux console only). Ctrl-Ins copies line with the file command, followed by a regular expres-
to the file ~/.cedit/cooledit.clip, and Shift-Ins pastes sion. The regular expression dictates the file name that
from ~/.cedit/cooledit.clip. Shift-Del cuts to that set of rules applies to. Following this is a descrip-
~/.cedit/cooledit.clip, and Ctrl-Del deletes highlighted tion to be printed on the left of the editor window
text - all linux console only. The completion key (see explaining the file type to the user. A third optional
mc.1) also does a hard return without an automatic indent. argument is a regular expression to match the first line
Mouse highlighting also works, and you can override the of text of the file. If either the file name matches, or
mouse as usual by holding down the shift key while drag- the first line of text, then those rules will be loaded.
ging the mouse to let normal terminal mouse highlighting
work. A section ends with the start of a new section. Each sec-
tion is divided into contexts, and each context contains
To define a macro, press Ctrl-R and then type out the key rules. A context is a scope within the text that a partic-
strokes you want to be executed. Press Ctrl-R again when ular set of rules belongs to. For instance, the region
finished. You can then assign the macro to any key you within a C style comment (i.e. between /* and */) has its
like by pressing that key. The macro is executed when you own colour. This is a context, although it will have no
press Ctrl-A and then the assigned key. The macro is also further rules inside it because there is probably nothing
executed if you press Meta, Ctrl, or Esc and the assigned that we want highlighted within a C comment.
key, provided that the key is not used for any other func-
tion. Once defined, the macro commands go into the file A trivial C programming section might look like this:
~/.cedit/cooledit.macros. Do NOT edit this file unless
you are not going to use macros again in the same editing file .\*\\.c C\sProgram\sFile (#include|/\\\*)
session, because Mcedit caches macro key defines in mem-
ory. Mcedit now overwrites a macro if a macro with the wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_
same key already exists, so you won't have to edit this
file. You will also have to restart other running editors # default colors
for macros to take effect. context default
keyword whole if 24
F19 will format C code when it is highlighted. For this to keyword whole else 24
work, make an executable file called .cedit/edit.indent.rc keyword whole for 24
in your home directory containing the following: keyword whole while 24
keyword whole do 24
keyword whole switch 24
& &
keyword whole case 24
keyword whole static 24 Important to note is the line
keyword whole extern 24 keyword \\\n 24
keyword { 14 This line defines a keyword containing the \ and newline
keyword } 14 characters. Because keywords have a higher precedence
keyword '*' 6 than context delimiters, this keyword prevents the context
from ending at the end of a line if the line ends in a \
# C comments thus allowing C preprocessor directive to continue across
context /\* \*/ 22 multiple lines.

# C preprocessor directives The colours themselves are numbered 0 to 26 and are


context linestart # \n 18 explained below in FURTHER BEHAVIORAL OPTIONS. You can
keyword \\\n 24 also use any of the named colors specified in
/usr/lib/X11/rgb.txt, though only one word versions of
# C string constants them. It is better to stick to the numerical colors to
context " " 6 limit use of the color palette.
keyword %d 24
keyword %s 24 Comments may be included on a line of there own and begin
keyword %c 24 with a #.
keyword \\" 24
Because of the simplicity of the implementation, there are
Each context starts with a line of the form: a few intricacies that will not be coped with correctly
context [exclusive] [whole|wholeright|wholeleft] [lines- but these are a minor irritation. On the whole, a broad
tart] delim [linestart] delim [foreground] [background] spectrum of quite complicated situations are handled with
these simple rules. It is a good idea to take a look at
One exception is the first context. It must start with the the syntax file to see some of the nifty tricks you can do
command with a little imagination. If you can't get by with the
context default [foreground] [background] rules I have coded, and you think you have a rule that
or else cooledit will return an error. would be useful, please email me with your request. How-
ever, do not ask for regular expression support, because
The linestart option dictates that delim must start at the this is flatly impossible.
beginning of a line.
A useful hint is to work with as much as possible with the
The whole option tells that delim must be a whole word. things you can do rather than try to do things that this
What constitutes a whole word are a set of characters that implementation can't cope with. Also remember that the aim
can be changed at any point in the file with the of syntax highlighting is to make programming less prone
wholechars command. The wholechars command at the top just to error, not to make code look pretty.
sets the set exactly to its default and could therefore
have been omitted. To specify that a word must be whole on
the left only, you can use the wholeleft option, and simi- COLORS
larly on the right. The left and right set of characters The default colors may be changed by appending to the
can be set separately with, MC_COLOR_TABLE environment variable. Foreground and back-
wholechars [left|right] characters ground colors pairs may be specified for example with:

The exclusive option causes the text between the delim-


iters to be highlighted, but not the delimiters them- MC_COLOR_TABLE="$MC_COLOR_TABLE:editnormal=lightgray,black:editbold=yellow,black:editmark
selves. ed=black,cyan"

Each rule is a line of the form:


keyword [whole|wholeright|wholeleft] [linestart] string OPTIONS
foreground [background] Most options can now be set from the editors options dia-
log box. See the Options menu. The following options are
Context or keyword strings are interpreted so that you can defined in You can modify them to change the editor behav-
include tabs and spaces with the sequences \t and \s. New- ior, by editing the file. Unless specified, a 1 sets the
lines and the \ are specified with \n and \\ respectively. option to on, and a 0 sets it to off, as is usual.
Since whitespace is used as a separator, it may not be
used explicitedly. Also, \* must be used to specify a *. use_internal_edit
The * itself is a wildcard that matches any length of This option is ignored when invoking mcedit.
characters. For example,
keyword '*' 6 editor_key_emulation
colours all C single character constants green. You could 1 for Emacs keys, and 0 for normal Cooledit keys.
also have used
keyword "*" 6 editor_tab_spacing
to colour string constants, except that the matched string Interpret the tab character as being of this
may not cross newlines. The wildcard may be used within length. Default is 8. You should avoid using other
context delimiters as well, but you cannot have a wildcard than 8 since most other editors and text viewers
as the last or first character. assume a tab spacing of 8. Use edi-
& &!
tor_fake_half_tabs to simulate a smaller tab spac- Enter replace string
ing. apples %d oranges %d
Enter replacement argument order
editor_fill_tabs_with_spaces 3,2
Never insert a tab space. Rather insert spaces
(ascii 20h) to fill to the desired tab size. The last line specifies that the third and then the second
number are to be used in place of the first and second.
editor_return_does_auto_indent
Pressing return will tab across to match the inden- It is advisable to use this feature with Prompt On Replace
tation of the first line above that has text on it. on, because a match is thought to be found whenever the
number of arguments found matches the number given, which
editor_backspace_through_tabs is not always a real match. Scanf also treats whitespace
Make a single backspace delete all the space to the as being elastic. Note that the scanf format %[ is very
left margin if there is no text between the cursor useful for scanning strings, and whitespace.
and the left margin.
The editor also displays non-us characters (160+). When
editor_fake_half_tabs editing binary files, you should set display bits to 7
This will emulate a half tab for those who want to bits in the Midnight Commander options menu to keep the
program with a tab spacing of 4, but do not want spacing clean.
the tab size changed from 8 (so that the code will
be formatted the same when displayed by other pro-
grams). When editing between text and the left mar-
gin, moving and tabbing will be as though a tab FILES
space were 4, while actually using spaces and /usr/mc.hlp
normal tabs for an optimal fill. When editing any-
where else, a normal tab is inserted. The help file for the program.

editor_option_save_mode /usr/lib/mc/mc.ini
(0, 1 or 2.) The save mode (see the options menu
also) allows you to change the method of saving a The default system-wide setup for the Midnight Com-
file. Quick save (0) saves the file by immediately, mander, used only if the user lacks his own
truncating the disk file to zero length (i.e. eras- ~/.mc.ini file.
ing it) and the writing the editor contents to the
file. This method is fast, but dangerous, since a /usr/lib/mc/mc.lib
system error during a file save will leave the file
only partially written, possibly rendering the data Global settings for the Midnight Commander. Set-
irretrievable. When saving, the safe save (1) tings in this file are global to any Midnight Com-
option enables creation of a temporary file into mander, it is useful to define site-global terminal
which the file contents are first written. In the settings.
event of an problem, the original file is
untouched. When the temporary file is successfully $HOME/.mc.ini
written, it is renamed to the name of the original
file, thus replacing it. The safest method is cre- User's own setup. If this file is present then the
ate backups (2). Where a backup file is created setup is loaded from here instead of the system-
before any changes are made. You can specify your wide startup file.
own backup file extension in the dialog. Note that
saving twice will replace your backup as well as $HOME/.cedit/
your original file.
User's own temporary directory where block commands
are processed and saved.
Miscellaneous
(Scanf search and replace have previously not worked prop-
erly. With this release, problems with search and replace LICENSE
have been fixed.) This program is distributed under the terms of the GNU
General Public License as published by the Free Software
You can use scanf search and replace to search and replace Foundation. See the built-in help of the Midnight Comman-
a C format string. First take a look at the sscanf and der for details on the License and the lack of warranty.
sprintf man pages to see what a format string is and how
it works. An example is as follows: Suppose you want to AVAILABILITY
replace all occurrences of say, an open bracket, three The latest version of this program can be found at
comma separated numbers, and a close bracket, with the ftp://ftp.gnome.org/mirror/gnome.org/stable/sources/mc/
word apples, the third number, the word oranges and then and on the mirrors listed on the GNOME site
the second number, you would fill in the Replace dialog http://www.gnome.org/.
box as follows:
SEE ALSO
Enter search string cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3).
(%d,%d,%d)
& &'
DESCRIPTION
AUTHORS mingetty est un getty minimal pour l'utilisation des con-
Paul Sheer (psheer@obsidian.co.za) is the developer of the soles virtuelles. Contrairement à agetty(8), mingetty
Midnight Commander's internal editor. n'est pas utilisable pour les lignes série. Pour cette
utilisation précise, je recommande mgetty(8).

BUGS
See the file README.edit in the distribution for more
information. OPTIONS
--noclear
N'efface pas l'écran avant d'afficher l'invite de
login (l'écran est effacé par défaut).
30 January 1997 mcedit(1)

--long-hostname
Par défaut, le nom de la machine hôte est tronqué
%( %( au premier point. Cette option permet d'afficher
le nom complet obtenu par gethostname().

NOM SEQUENCES D'ECHAPPEMENT


mesg - Commander l'accès en écriture sur votre terminal. mingetty reconnaît les séquences d'échappement qui peuvent
être employées dans le fichier /etc/issue :
SYNOPSIS
mesg [y|n] \d insère le jour courant (localtime),
DESCRIPTION \l insère la ligne série sur laquelle mingetty tourne,
Mesg contrôle l'accès à votre terminal par d'autres per-
sonnes. Son utilisation typique est de permettre ou \m insère le type d'architecture machine (uname -m),
d'interdire aux autres utilisateurs d'écrire sur votre
terminal (voir write(1)). \n insère le nom d'hôte de la machine sur le réseau
(uname -n),
OPTIONS
y Permet l'accès en écriture à votre terminal. \o insère le nom de domaine,
n Interdit l'accès en écriture à votre terminal. \r insère le numéro de version du système d'exploita-
tion (uname -r),
si aucune option n'est donnée, mesg affiche l'état d'accès
courant de votre terminal. \t insère l'heure courante (localtime),
AUTEUR \s insère le nom du système d'exploitation,
Miquel van Smoorenburg (miquels@cistron.nl)
\u resp. le nombre d'utilisateurs déjà connectés. \U
VOIR AUSSI insère "n users", alors que \u insère seulement
talk(1), write(1), wall(1) "n".
TRADUCTION \v insère la version (date) du système d'exploitation
Frédéric Delanoy, 2000. (uname -v).

EXEMPLE
Linux 7 Août 2000 MESG(1) "Linux eos i386 #1 Mar 19 21:54:09 MET 1996" a été produit
par le contenu suivant de /etc/issue: "\s \n \m \v"

% 0" & % 0" FICHIERS


/etc/issue, /var/run/utmp.

VOIR AUSSI
NOM
mgetty(8), agetty(8).
mingetty - Getty minimal pour la console.

SYNOPSIS
mingetty [--noclear] [--long-hostname] tty
AUTEUR
Copyright (C) 1996 Florian La Roche <florian@suse.de> ou
&- &&
<florian@jurix.jura.uni-sb.de>. Page man écrite par David !( " & !( "
Frey <David.Frey@eos.lugs.ch> et Florian La Roche.

TRADUCTION
Guillaume Allègre <guillaume.allegre@mail.dotcom.fr>, Jan- NOM
vier 1999 mkfs - Créér un système de fichiers Linux.

SYNOPSIS
mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [
nb_blocs ]
Debian 5 Mai 1999 MINGETTY(8)
DESCRIPTION
mkfs est utilisé pour formater un système de fichiers
Linux sur un périphérique, généralement une partition de
disque dur. filesys est soit le nom du périphérique (ex:
# # /dev/hda1, /dev/sdb2) ou le point de montage (e.g. /,
/usr, /home) du système de fichiers. nb_blocs est le nom-
bre de blocs à utiliser pour le système de fichiers.

NOM Le code de retour retourné par mkfs est 0 en cas de succès


mkdir - Créer des répertoires. et 1 en cas d'échec.

SYNOPSIS En fait, mkfs est simplement une interface pour les divers
mkdir [-p] [-m mode] [--parents] [--mode=mode] [--help] formatteurs de système de fichiers. (mkfs.type_de_fs)
[--version] rep... disponibles sous Linux. Le formateur du système de
fichier voulu est recherché dans un certain nombre de
DESCRIPTION répertoires (/sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc)
Cette page de manuel documente la version GNU mkdir. (la liste exacte est définie au moment de la compilation
mais contient au moins /sbin et /sbin/fs), puis en cas
mkdir crée un répertoire correspondant à chacun des noms d'échec dans les répertoires listés par la variable
mentionnés. d'environnement PATH. Veuillez consulter la page de
manuel spécifique au système de fichier désiré pour plus
Par défaut, les répertoires sont créés avec les permis- de détails.
sions d'accès 0777 moins les bits positionnés dans le
umask. OPTIONS
-V Génère plus de messages, notamment toutes les com-
OPTIONS mandes exécutées. Indiquer cette option plusieurs
-m, --mode mode fois inhibibe l'éxécution de toute commande
Créer les répertoires avec le mode d'accès indiqué. spécifique au système de fichiers. Ceci n'est
Celui-ci est donné sous forme symbolique, comme utile que pour faire des tests.
dans chmod(1), en utilisant le mode par défaut
comme valeur de départ. -t fstype
Indique le type de système de fichiers à formater.
-p, --parents S'il n'est pas indiqué, le type est déduit de la
S'assurer que chaque répertoire indiqué existe. ligne correspondante du fichier /etc/fstab. Sinon
Créer les répertoires parents manquants. Ces le format par défaut (ext2) est utilisé.
derniers sont créés avec l'autorisation d'accès
umask modifiée par `u+wx'. Ne pas considérer les fs-options
répertoires déjà existants comme des erreurs. Options spécifiques au système de fichiers employé
à passer au "vrai" formateur. La plupart des
--help Afficher un message d'aide sur la sortie standard, options suivantes sont supportés par la majorité
et terminer normalement. des formatteurs de système de fichiers. Attention,
il peut y avoir des exceptions.
--version
Afficher un numéro de version sur la sortie stan- -c Vérifie le périphérique pour éliminer les secteurs
dard, et terminer normalement. défectueux avant de formater le système de
fichiers.

TRADUCTION -l nom_de_fichier
Christophe Blaess, 1997. Lit la liste des secteurs défectueux depuis le
nom_de_fichier

-v Génère plus d'affichage. (volubile)


FSF 20 Decembre 1996 MKDIR(1L)
BOGUES
Toutes les options génériques doivent précéder et ne pas

&0 0*
être mélangées avec les options spécifiques au système de Les fichiers en mode bloc sont des périphériques comme des
fichiers. Certains formateurs ne reconnaissent pas disques (où les données sont accessibles à travers un
l'option -v (mode volubile), ou retournent un code numéro de bloc, et où il est intéressant d'avoir une
d'erreur incompréhensible. De plus, certains programmes mémoire cache par bloc). Tous les autres périphériques
spécifiques à un système de fichiers ne peuvent détecter sont en mode caractère. Autrefois la distinction se fai-
la taille du périphérique et nécessitent le passage du sait autrement, les entrées/sorties en mode bloc étaient
paramètre blocks . bufferisées, pas les autres.

AUTEURS
David Engel (david@ods.com) Les arguments fournis à la suite du nom indiquent le type
Fred N. van Kempen (waltje@uwalt.nl.mugnet.org) de fichier à créer :
Ron Sommeling (sommel@sci.kun.nl)
Cette page de manuel est une simple adaptation de celle de p pour une FIFO
Remy Card (le concepteur du système de fichier étendu 2,
le standard de facto sous Linux). b pour un fichier spécial en mode bloc (avec buffer)

VOIR AUSSI c ou u pour un fichier spécial en mode caractère (sans


fsck(8), mkfs.minix(8), mkfs.ext(8), mkfs.ext2(8), buffer)
mkfs.xiafs(8).
Lorsque l'on crée un fichier spécial bloc ou caractère,
Note du traducteur les numéros majeur et mineur correspondant au périphérique
Il est possible de formater un fichier comme s'il s'agis- doivent être précisés après le type de fichier, en
sait d'un périphérique. Il faudra alors passer outre aux décimal, en octal commençant par 0, ou (version GNU seule-
protestations de mkfs. Le principal usage de cette option ment) en héxa-décimal précédé de 0x.
est de pouvoir formater un périphérique loopback.
OPTIONS
TRADUCTION -m, --mode mode
Thierry Vignaud <tvignaud@mandrakesoft.com>, 1999. Indique les autorisations d'accès au fichier, Par
défaut, les autorisations d'accès sont fixées à
0666 (`a+rw') moins les bits à 1 dans le umask.
mode étant fourni sous forme symbolique, comme pour
Linux 19 Mars 1999 MKFS(8) chmod(1), les permissions par défaut étant
utilisées comme valeur de départ.

--help Afficher un message d'aide sur la sortie standard,


# # et terminer normalement.

--version
Afficher un numéro de version sur la sortie stan-
dard, et terminer normalement.
NOM
mknod - Créer des fichiers spéciaux. CONFORMITÉ
POSIX ne décrit pas cette commande, considérée comme non
SYNOPSIS portable, et recommende d'utiliser plutôt mkfifo(1) pour
mknod [options] nom {bcu} numéro_majeur numéro_mineur créer des FIFOs. SVID dispose d'une commande /etc/mknod
mknod [options] nom p ayant la même syntaxe mais sans l'option mode.
Options:
[-m mode] [--mode=mode] [--help] [--version] NOTES
Sur un système Linux (1.3.22 ou plus récent) le fichier
DESCRIPTION /usr/src/linux/Documentation/devices.tex contient une
mknod crée une FIFO, un fichier spécial en mode caractère, liste des noms de périphériques, avec le type, et les
ou un fichier spécial en mode bloc, avec le nom indiqué. numéros majeurs et mineurs.
Un fichier spécial est un ensemble de trois valeurs (une VOIR AUSSI
booléenne, et deux entiers) enregistré dans un système de chmod(1), mkfifo(1), mknod(2).
fichiers. La valeur booléenne indique s'il s'agit d'un
fichier caractères ou blocs, et les deux entiers corre- TRADUCTION
spondent aux numéros majeur et mineur. Christophe Blaess, 1997.
Ainsi un fichier spécial ne prend quasiment pas de place
sur le disque, et est utilisé pour dialoguer avec le
système d'exploitation, pas pour enregistrer des données. FSF 15 Décembre 1998 MKNOD(1)
Généralement les fichiers spéciaux concernent des
périphériques matériels (disques, bandes, ttys, impri-
mantes) ou des services fournis par le système d'exploita-
tion (/dev/null, /dev/random).

0 0
% % avez toutes oubliées, tâchez de vous souvenir de
celle-la.

ESPACE Affiche les k lignes suivantes. Par défaut k est


la taille de l'écran.
NOM
more - Filtre lecteur de fichier. z Affiche les k lignes suivantes. Par défaut k est
la taille de l'écran mais l'argument fourni devient
SYNOPSIS la nouvelle valeur par défaut.
more [-dlfpcsu] [-num] [+/ motif] [+ numligne]
[fichier ...] RETURN Affiche les k lignes suivantes. Par défaut k vaut
1 mais l'argument fourni devient la nouvelle valeur
DESCRIPTION par défaut.
More est un filtre permettant de se déplacer dans un texte
écran par écran. Cette version est particulierement prim- d ou ^D
itive. Les utilisateurs doivent se convaincre que less(1) Déroule k lignes. la valeur par défaut vaut ini-
constitue une excellente émulation avec de nombreuses tialement 11 mais l'argument fourni devient la nou-
améliorations. velle valeur par défaut.
OPTIONS q ou Q ou INTERRUPT
Les options sur la ligne de commande sont décrites ci- Arrêt.
dessous. La variable d'environnement MORE peut contenir
des options supplémentaires (précédées par un tiret s Saute k lignes. Par défaut, saute une ligne.
(``-'')) mais les options sur la ligne de commande ont
priorité. f Saute k écrans. Par defaut, saute un écran.
-num num est un nombre entier indiquant la taille en b ou ^B
lignes de l'ecran. Recule de k ecrans. Par défaut, recule d'un écran.
-d more affiche le message "[Press space to continue, ' Retourne au point de départ de la dernière
'q' to quit.]" pour défiler et le messaqe "[Press recherche.
'h' for instructions.]" au lieu d'émettre un beep
quand on appuie sur une touche interdite. = Affiche le numéro de ligne courant.
-l Normalement more considère que ^L (form feed) est /motif Recherche la k-ième occurrence d'une expression
un caractère spécial et attend après chaque ligne régulière. Par défaut k vaut 1.
contenant un form feed. L'option -l supprime ce
comportement. n Recherche la k-ième occurrence de la dernière
expression régulière. Par défaut k vaut 1.
-f provoque un comptage logique des lignes, c'est à
dire que les lignes longues ne sont pas découpées. !<cmd> ou :!<cmd>
Exécute <cmd> dans un sous-shell.
-p Ne pas dérouler: efface l'ecran avant d'afficher le
texte. v Lance /usr/bin/vi sur la ligne courante.
-c Ne pas dérouler: affiche les lignes en partant du ^L Réaffiche l'ecran
haut et en effacant les fins de ligne au fur et à
mesure. :n Passe au k-ième fichier suivant. Par défaut k=1.
-s Regroupe les lignes blanches consécutives en une :p Passe au k-ième fichier précédent. Par défaut k=1.
seule.
:f Affiche le nom et le numéro de ligne du fichier
-u Supprime le soulignement. courant.
+/ L'option +/ indique un texte à rechercher dans . Répète la commande précédente.
chaque fichier avant de l'afficher.
ENVIRONMENT
+num Commence à la ligne indiquée. More utilise les variables d'environnement suivantes quand
elles existent:
COMMANDES
more reconnait un jeu de commandes interactives basé sur MORE Cette variable contient les options préférées pour
celui de vi(1). Certaines commandes peuvent être more.
précédées d'un nombre décimal noté k ci-dessous. ^X signi-
fie control-X. SHELL Shell courant (normalement positionné par le shell
au login).
h ou ? Aide: affiche un résumé des commandes. Si vous les TERM Spécifie le type de terminal; utilisé par more pour
0 0!
connaître les codes de contrôle de l'écran. quoique ce soit :
mount -h
VOIR AUSSI affiche un message d'aide
vi(1) less(1) mount -V
affiche un numéro de version
AUTEURS mount [-t type]
Eric Shienbrood, UC Berkeley fournit la liste des systèmes de fichiers actuellement
Modifié par Geoff Peck, UCB pour ajouter le soulignement montés (éventuellement ceux du type indiqué uniquement) -
et l'espacement simple. voir plus bas.
Modifié par John Foderaro, UCB pour ajouter -c et la ges-
tion de la variable d'environnement MORE. Le système de fichiers proc n'est associé à aucun
périphérique, et lorsqu'on le monte, un mot quelconque,
HISTORIQUE par exemple proc peut être utilise à la place de l'indica-
La commande more est apparue dans BSD 3.0. Cette page tion de périphérique. Le choix parfois rencontre none
documente la version 5.19 (Berkeley 6/29/88), qui est (aucun) n'est pas très heureux, car un message d'erreur
celle actuellement utilisée par la communauté Linux. `none busy' (aucun occupé) lors d'un umount peut être mal
Cette documentation a été constituée en utilisant les interprété.
pages de manuel de plusieurs autres versions et après un
examen exhaustif du code source. La plupart des périphériques peuvent être indiqués sous
forme de noms de fichiers (spécial bloc), comme /dev/sda1,
mais il y a également d'autres possibilités. Par exemple,
TRADUCTION dans le cas d'un montage par NFS, périphérique peut
Michel Quercia, 1997. ressembler à knuth.cwi.nl:/dir.

Le fichier /etc/fstab (voir fstab(5)), contient des lignes


décrivant les périphériques habituellement montés, leurs
Linux 0.98 10 Juin 1997 MORE(1) répertoires, et leurs options. Ce fichier est utilisé
dans trois buts :

(i) La commande
' " & ' " mount -a [-t type]
(généralement exécutée dans un script de démarrage) monte
tous les systèmes de fichiers indiqués dans fstab (ou
uniquement ceux du type indiqué), à l'exception de ceux
dont la ligne contient le mot-clé noauto.
NOM
mount - Monter un système de fichiers. (ii) Lorsque l'on monte un système de fichiers mentionné
dans la fstab, il suffit d'indiquer le point de montage,
SYNOPSIS ou le périphérique.
mount [-hV]
(iii) Normalement, seul le Super-Utilisateur peut monter
mount -a [-fnrvw] [-t type] des systèmes de fichiers. Néanmoins, si la ligne de la
mount [-fnrvw] [-o options [,...]] périph | rép fstab contient l'option user, n'importe quel utilisateur
mount [-fnrvw] [-t type] [-o options] périph rép peut monter le système de fichiers correspondant.
DESCRIPTION Ainsi, avec une ligne
Tout fichier accessible par un système Unix est inséré /dev/cdrom /cd iso9660 ro,user,noauto,unhide
dans une grande arborescence, la hiérarchie des fichiers, dans la fstab, n'importe quel utilisateur peut monter le
commençant à la racine /. Ces fichiers peuvent résider système iso9660 se trouvant sur son CDROM en utilisant la
sur différents périphériques. La commande mount permet commande
d'attacher un système de fichiers trouvé sur un mount /dev/cdrom
périphérique quelconque à la grande arborescence du ou
système. A l'inverse umount(8) le détachera à nouveau. mount /cd
Pour plus de details, voir fstab(5).
La forme standard de la commande mount est
mount -t type périphérique répertoire Les programmes mount et umount maintiennent une liste des
Ceci indique au noyau d'attacher le système de fichiers se périphériques actuellement montés dans le fichier
trouvant sur le périphérique mentionné (dont on précise le /etc/mtab. Si mount est invoqué sans arguments, cette
type) dans le répertoire indiqué. Le contenu précédent du liste est affichée. Quand le système proc est monté (dis-
répertoire (s'il n'était pas vide), ainsi que son pro- ons sur /proc), les fichiers /etc/mtab et /proc/mounts
priétaire et ses modes d'accès initiaux deviennent invisi- sont très semblables. Le premier contient un peu plus
bles tant que le nouveau système de fichiers reste monté. d'informations, par exemple les options de montage, mais
n'est pas obligatoirement à jour. (cf l'option -n plus
Le chemin d'accès du répertoire représente alors la racine bas).
du système de fichiers se trouvant sur le périphérique.

Il y a trois manières d'invoquer mount sans qu'il ne monté OPTIONS


0 0'
L'ensemble exact des options utilisées lors d'une invoca- des virgules. Certaines d'entre-elles ne sont
tion de mount est déterminé d'abord en lisant les options utiles que lorqu'elles apparaissent dans le fichier
de la table fstab pour ce système de fichiers, puis en /etc/fstab Les options suivantes sont communes au
appliquant les options précisées par l'argument -o, et montage de tous les systèmes de fichiers :
finalement en appliquant les options -r ou -w si elles
sont mentionnées. async Toutes les entrées/sorties sur le système de
fichiers seront asynchrones.
Les options valides pour la commande mount sont :
auto Peut être monté par l'argument -a.
-v Mode volubile.
defaults
-f Fonctionnement normal sauf pour l'appel système Utilisation des options par défaut : rw,
final qui n'est pas exécuté. Ceci simule le montage suid, dev, exec, auto, nouser, et async.
du système de fichiers. Cette option, en conjonc-
tion avec -v permet de déterminer ce que la com- dev Interpréter les fichiers spéciaux de
mande mount essaye de faire. périphériques présents sur le système de
fichiers.
-n Montage sans écriture dans /etc/mtab. Ceci est
nécessaire dans le cas où /etc réside sur un exec Permettre l'exécution de fichiers binaires.
système de fichiers en lecture seule.
noauto Ne peut être monté qu'explicitement (l'invo-
-r Montage du système de fichiers en lecture seule. cation de mount avec l'argument -a ne mon-
Un synonyme est -o ro. tera pas le système de fichiers).

-w Montage du système de fichiers en lecture/écriture. nodev Ne pas interpréter les fichiers spéciaux de
Il s'agit de l'option par défaut. Un synonyme en périphériques présents sur le système de
est -o rw. fichiers.

-t type noexec Ne pas permettre l'exécution de fichiers


L'argument à la suite de -t est utilise pour binaires sur le système de fichiers monté.
préciser le type de système de fichier. Les types Ceci peut être utile sur un serveur qui con-
actuellement suppportés sont mentionnés dans tient des fichiers binaires pour des archi-
linux/fs/filesystems.c: minix, ext, ext2, xiafs, tectures autres que la sienne.
hpfs, fat, msdos, umsdos, vfat, proc, nfs, iso9660,
smb, ncp, affs, ufs, sysv, xenix, coherent. Notez nosuid Ne pas tenir compte des bits Set-UID ou Set-
que les 3 derniers sont équivalents, et que xenix GID.
et coherent disparaîtront dans l'avenir -- utilisez
sysv à leur place. nouser Ne pas autoriser d'utilisateur ordinaire
(non root) à monter le système de fichiers.
Le type par défaut est iso9660. Si aucune option C'est le comportement par défaut.
-t n'est mentionnée, ou si le type auto est
précisé, la recherche de type est effectuée sur le remount
superblock (minix, ext, ext2, xia, iso9660 sont Remonter un système de fichiers déjà monté.
supportés). Si cette recherche échoue, et si Ceci est utilisé pour changer les attributs
/proc/filesystems existe, alors tous les types de de montage, principalement pour autoriser
systèmes de fichiers listés seront essayés, sauf l'écriture sur un système en lecture seule.
ceux marqués "nodev" (par exemple proc et nfs).
ro Montage du système en lecture seule.
Le type auto peut être utile pour des disquettes
montées par l'utilisateur. Attention la détection rw Montage du système en lecture/écriture.
s'appuie sur une heuristique (la présence de nom-
bres "magiques" précis) qui peut conduire à une suid Prendre en compte les bits Set-UID ou Set-
mauvaise reconnaissance. GID des fichiers se trouvant sur le système
monté.
On peut indiquer plusieurs types, séparés par des
virgules. Une liste de systèmes peut également être sync Toutes les entrées/sorties sur le système de
préfixée par no pour indiquer les types qu'il ne fichiers seront synchrones.
faut pas tester. (Ceci prend son sens avec
l'option -a). user Autoriser les utilisateurs ordinaires (non
root) à monter le système de fichiers. Ceci
Par exemple, la commande : entraîne l'utilisation des options noexec,
mount -a -t nomsdos,ext nosuid, et nodev (à moins qu'elles ne soient
monte tous les systèmes de fichiers, à l'exception explicitement surchargées, comme dans une
de ceux de type msdos et ext. ligne d'option user,exec,dev,suid).

-o Les options de montage sont indiquées par l'argu-


ment -o suivi d'une liste d'options séparées par OPTIONS DE MONTAGE SPÉCIFIQUES
0- 0&
Les options suivantes ne s'appliquent qu'à certains est obsolète. Ne l'utilisez pas.
systèmes de fichiers. Elles sont triées par type de
système. Elles s'utilisent toutes à la suite d'un argument
-o. Options de montage pour ext2
`ext2' est le type standard pour les systèmes de fichiers
Linux.
Options de montage pour affs
uid=value et gid=value bsddf / minixdf
Positionner le propriétaire et le groupe de la Indiquer le comportement à adopter lors de l'appel
racine du système de fichiers (par défaut : système statfs. Le comportement minixdf consiste à
uid=gid=0, mais avec l'option uid ou gid sans renvoyer dans le champ f_blocks le nombre total de
valeur, l'uid et le gid du processus appelant blocs dans le système de fichiers, alors que le
seront utilisés). comportement bsddf (par défaut) consiste à sous-
traire les blocs utilisés par le système ext2 non
setuid=value et setgid=value disponibles pour le stockage. Ainsi on obtient :
Positionner le propriétaire et le groupe de tous
les fichiers du système. % mount /k -o minixdf; df /k; umount /k
Filesystem 1024-blocks Used Available Capacity Mounted on
mode=valeur /dev/sda6 2630655 86954 2412169 3% /k
Fixer le mode d'accès à tous les fichiers au mode % mount /k -o bsddf; df /k; umount /k
valeur & 0777 sans s'occuper de leurs permissions Filesystem 1024-blocks Used Available Capacity Mounted on
originales. Ceci ajoute également l'autorisation /dev/sda6 2543714 13 2412169 0% /k
de parcours dans les répertoires qui permettent la
lecture. La valeur doit être mentionnée en octal. (Remarquez que cet exemple montre que l'on peut, en ligne
de commande, ajouter des options à celles mentionnées dans
protect /etc/fstab.)
N'autoriser aucune modification des bits d'accès
aux fichiers du système.
check / check=normal / check=strict
usemp Utiliser l'uid et le gid du point de montage comme Positionner le niveau de vérification. Lorsque
uid et gid de la racine du système de fichiers l'une au moins de ces options est mentionnée (et
jusqu'au premier sync ou umount, puis ignorer cette check=normal est configuré par défaut) les images
option. Bizarre... des i-noeuds et des blocs sont vérifiées lors du
montage (ce qui peut prendre une minute ou plus sur
verbose de gros disques). Avec une vérification stricte, la
Afficher des informations supplémentaires pour libération des blocs vérifie que le bloc à libérer
chaque montage réussi. se trouve bien dans une zone de données.

prefix=chaîne check=none / nocheck


Préfixe à utiliser avant le nom de volume lorsque Pas de vérification.
l'on suit un lien.
debug Afficher des informations de débugging lors de
volume=chaîne chaque (re)mount.
Préfixe (30 caractères au plus) à utiliser '/'
lorsque l'on suit un lien symbolique. errors=continue / errors=remount-ro / errors=panic
Définir le comportement à adopter lorsque des
reserved=valeur erreurs se produisent. On peut ignorer l'erreur en
(Par défaut : 2.) Nombre de blocs inutilisés au indiquant simplement que le système de fichier est
début du périphérique. corrompu, et continuer. On peut également remonter
le système en lecture-seule. Ou l'on peut
root=valeur déclencher une panique du noyau et arrêter le
Fournir explicitement l'emplacement du bloc racine. système. Le comportement par défaut est inscrit
dans le superbloc du fichier et peut être configuré
bs=valeur avec tune2fs(8).
Fournir la taille de bloc. Les valeurs autorisées
sont 512, 1024, 2048, et 4096. grpid ou bsdgroups / nogrpid ou sysvgroups
Ces options définissent le GID que reçoit un nou-
grpquota / noquota / quota / usrquota veau fichier créé. Quand grpid est positionné, le
Ces options sont acceptées mais sans effet. fichier reçoit le GID du répertoire dans lequel il
est créé. Sinon (par défaut), il prend le fsgid du
processus appelant, à moins que le répertoire ait
Options de montage pour coherent son bit Set-GID positionné, auquel cas il reçoit le
Aucune. GID du répertoire parent, et s'il s'agit d'un nou-
veau répertoire, voit son bit Set-GID positionné.

Options de montage pour ext resgid=n et resuid=n


Aucune. Notez que le type `ext' de système de fichiers Le système de fichiers ext2 réserve un certain
00 **
pourcentage de l'espace disponible (par défaut 5%, défaut.
voir mke2fs(8) et tune2fs(8)). Ces options déter-
minent qui peut utiliser ces blocs réservés (celui text Conversion CRLF<-->NL sur tous les fichiers.
qui a l'UID indiqué, ou qui appartient au groupe
mentionné). auto Conversion CRLF<-->NL sur tous les fichiers
qui n'ont pas une extension de "binaire
sb=n Utiliser le bloc n comme superbloc plutôt que le bien-connu". Cette liste, non exhaustive, se
bloc 1. Ceci peut servir lorsque le système de trouve au début de fs/fat/misc.c (dans Linux
fichiers a été endommagé. Généralement, des copies 2.0, la liste est : exe, com, bin, app, sys,
du superbloc sont placées tous les 8192 blocs : 1, drv, ovl, ovr, obj, lib, dll, pif, arc, zip,
8193, 16385, ... (Ce qui signifie qu'il y a des lha, lzh, zoo, tar, z, arj, tz, taz, tzp,
centaines, voire des milliers de copies du tpz, gz, tgz, deb, gif, bmp, tif, gl, jpg,
superbloc sur des gros systèmes de fichiers. Je ne pcx, tfm, vf, gf, pk, pxl, dvi).
connais pas d'options de mke2fs qui créerait moins
de copies). Les programmes qui calculent des positionnements
avec lseek n'aimeront pas du tout la conversion
grpquota / noquota / quota / usrquota text. Plusieurs personnes ont détruit des données
Ces options sont acceptées mais ignorées. avec cette conversion. Faites attention !

Pour les systèmes montés en mode binaire, un outil


Options de montage pour fat de conversion (fromdos/todos) est disponible.
blocksize=512 / blocksize=1024
Indiquer la taille de bloc (par défaut 512). debug Activer l'attribut de débugging. Un numéro de ver-
sion, et une liste des paramètres du système de
uid=valeur et gid=valeur fichiers seront affichés (ces données seront égale-
Indiquer le propriétaire et le groupe de tous les ment affichées si le système est incohérent).
fichiers (par défaut : l'uid et le gid du processus
appelant). fat=12 / fat=16
Préciser s'il s'agit d'une FAT 12 bits ou 16 bits.
umask=valeur Ceci a priorité sur la détection automatique du
Fixer l'umask (c'est à dire le masque de bit des type de FAT. A n'utiliser qu'avec beaucoup de
permissions qui ne sont pas fournies). Par défaut précautions !
il s'agit de l'umask du processus en cours. La
valeur est donnée en octal. quiet Activer l'attribut de silence. Les tentatives de
modification du propriétaire ou du mode d'accès aux
check=valeur fichiers ne renverront pas d'erreurs, bien qu'elles
Il y a trois niveaux de vérification des noms de échouent. A utiliser avec précaution !
fichiers :
sys_immutable, showexec, dots, nodots, dotsOK=[yes|no]
r[elaxed] Diverses tentatives risquées de forcer un comporte-
Les majuscules et minuscules sont acceptées ment Unix ou Dos dans un système de fichiers FAT.
et équivalentes. La partie excédentaire des
noms longs est supprimée (par exemple
nombeaucouptroplong.foobar devient Options de montage pour hpfs
nombeauc.foo). Les espaces en tête, et au uid=valeur et gid=valeur
sein des noms sont acceptés, tant dans le Fixer le propriétaire, et le groupe, de tous les
nom que dans l'extension. fichiers (par défaut : l'uid et le gid du processus
appelant).
n[ormal]
Comme "relaxed", mais de nombreux caractères umask=valeur
spéciaux (*, ?, <, espaces, etc...) sont Fixer l'umask (c'est à dire le masque de bit des
refusés. C'est l'attitude par défaut. permissions qui ne sont pas fournies). Par défaut
il s'agit de l'umask du processus en cours. La
s[trict] valeur est donnée en octal.
Comme "normal", mais les noms ne peuvent pas
contenir de partie longue, et les caractères case=lower / case=asis
spéciaux qui sont acceptés par Linux mais Convertir les noms de fichiers en minuscules
pas par MS-DOS sont rejetés (+, =, espaces, (lower) ou les laisser tels quels (asis). Par
etc...) défaut : case=lower.

conv=b[inary] / conv=t[ext] / conv=a[uto] conv=binary / conv=text / conv=auto


Le système de fichiers fat peut effectuer automa- Avec conv=text, supprimer une partie des retour-
tiquement les conversions CRLF<-->NL (format de chariots (en particulier tout ceux suivis par un
texte MS-DOS vers format de texte UNIX). Les modes saut-de-ligne) durant la lecture des fichiers.
de conversion suivants sont autorisés : Avec conv=auto, choisir, plus ou moins au hasard,
entre conv=binary et conv=text. Avec conv=binary,
binary aucune conversion. C'est le comportement par lire le contenu des fichiers sans les modifier
* *
(option par défaut). entraîne que la longueur maximale d'un fichier sera
16 Mo. L'option `cruft' est positionnée automa-
nocheck tiquement quand la taille totale du CD-Rom est
Ne pas interrompre le montage si le test de erronée (négative, supérieure à 800 Mo, ...), ou
cohérence échoue. quand on rencontre des numeros de séquence de vol-
ume autres que 0 ou 1.

Options de montage pour iso9660


Les noms de fichiers iso9660 normaux se présentent dans le Options de montage pour minix
format 8.3 (limite de longueur des noms comme sous Dos). Aucune.
Tous les caractères sont en majuscule. De plus, rien n'est
prévu pour stocker le propriétaire du fichier, le mode
d'accès, le nombre de liens, les fichiers spéciaux Options de montage pour msdos
blocs/caractères, etc... Voir les options de montage pour fat. Si le système de
fichiers msdos présente des incohérences, une erreur sera
Rock Ridge est une extension du format iso9660 qui permet indiquée, et le montage sera effectue en lecture seule. On
d'offrir ces fonctionnalités Unix. En gros, des données peut réactiver l'ecriture en remontant le système de
sont ajoutées pour chaque entrée de chaque répertoire afin fichiers.
de fournir les informations désirées. Lorsque l'extension
Rock Ridge est utilisée, le système de fichiers est
totalement semblable à un système de fichier Unix normal Options de montage pour ncp
(sauf qu'il est en lecture seule évidemment). Tout comme nfs, l'implémentation ncp nécessite un argument
binaire (une structure ncp_mount_data) lors de l'appel
norock Ne pas utiliser les extensions Rock Ridge, même si système.
elles sont disponibles. Voir map.
Cet argument est construit par ncpmount(8) et la version
check=r[elaxed] / check=s[trict] actuelle de mount (2.5k) ne connait rien en ce qui con-
Avec check=relaxed, les noms de fichier sont con- cerne ncp.
vertis en minuscules. Ceci n'a probablement
d'interêt qu'avec les options norock et map=normal.
(Par défaut : check=strict.) Options de montage pour nfs
Le noyau a besoin, pour monter un système nfs , d'un argu-
uid=value et gid=value ment binaire lors de l'appel système (une structure
Fixer le propriétaire, et le groupe, de tous les nfs_mount_data.
fichiers en écrasant éventuellement les informa-
tions trouvées dans les extensions Rock Ridge (par Néanmoins le programme mount peut analyser les arguments
défaut : uid=0,gid=0.) suivants, et préparer la structure nécessaire au noyau.

map=n[ormal] / map=o[ff] Les options suivantes sont de type `option=valeur' :


Pour les volumes sans extension Rock Ridge, la tra- rsize=n, wsize=n, timeo=n, retrans=n, acregmin=n, acreg-
duction des noms de fichiers convertit les majus- max=n, acdirmin=n, acdirmax=n, actimeo=n, retry=n, port=n,
cules en minuscules, supprime l'éventuel `;1' mountport=n, mounthost=nom, mountprog=n, mountvers=n,
final, and transforme `;' en `.'. Avec map=off il nfsprog=n, nfsvers=n, namlen=n. L'option addr=n est
n'y a pas de traduction. Voir norock. (Par défaut acceptée, mais ignorée.
: map=normal.)
On peut également employer les options booléennes suiv-
mode=value antes, éventuellement précédées par no : bg, fg, soft,
Pour les volumes non-Rock Ridge, donner le mode hard, intr, posix, cto, ac, tcp, udp.
indiqué à tous les fichiers (Par défaut : lecture
autorisée pour tous) Pour plus de détails, voir nfs(5).

unhide Montrer également les fichiers cachés, et les Les options particulièrement utiles sont les suivantes :
fichiers d'extension.
rsize=8192,wsize=8192
block=[512|1024|2048] qui améliorera la vitesse de votre connexion nfs
Fixer la taille de bloc (par défaut : block=1024.) (les tailles des buffers par défaut sont 1024
octets)
conv=a[uto] / conv=b[inary] / conv=m[text] / conv=t[ext]
(par défaut : conv=binary.) Depuis Linux 1.3.54 soft qui permet au noyau de renoncer au bout d'un moment
cette option n'a plus d'effet. (les conversions si le serveur nfs ne répond pas (par défaut le
autres que binaires étaient dangereuses, avec un noyau répète indéfiniment sa requête). On peut
risque important de corruption de données). indiquer un délai avec timeo=time. Ceci est
surtout utile s'il y a des chances pour que le
cruft Si l'octet de poids fort de la longueur d'un serveur nfs soit arrêté, ou redémarre alors que des
fichier contient n'importe quoi, utilisez cette processus essayent d'accéder à ses fichiers.
option pour indiquer à mount d'ignorer ces octets
dans toutes les longueurs de fichiers. Ceci
* *!
Options de montage pour proc
uid=value et gid=value mount /tmp/fdimage /mnt -t msdos -o loop=/dev/loop3,blocksize=1024
Ces options sont reconnues, mais n'ont pas d'effet
semble-t-il. va faire correspondre le périphérique boucle /dev/loop3 au
fichier /tmp/fdimage, puis monter ce périphérique sur
/mnt.
Options de montage pour smb
Tout comme nfs, l'implementation smb nécéssite un argument Ce type de montage dispose de trois options, nommées loop,
binaire (une structure smb_mount_data) lors de l'appel offset et encryption, qui sont en réalité des options pour
système. losetup(8).

Cet argument est construit par smbmount(8) et la version Si aucun périphérique loop n'est mentionné explicitement
actuelle de mount (2.5k) ne connait rien en ce qui con- (uniquement l'option `-o loop'), alors mount essayera de
cerne smb. trouver une boucle inutilisée et se l'attribuera.

Options de montage pour sysv FICHIERS


Aucune. /etc/fstab table des systèmes de fichiers
/etc/mtab table des systèmes de fichiers montés
/etc/mtab~ fichier de verrouillage
Options de montage pour ufs /etc/mtab.tmp fichier temporaire
Aucune.
VOIR AUSSI
mount(2), umount(2), fstab(5), umount(8), swapon(8),
Options de montage pour umsdos nfs(5), mountd(8), nfsd(8), mke2fs(8), tune2fs(8), los-
Voir les options de montage pour msdos. etup(8)

BOGUES
Options de montage pour vfat Le montage d'un système de fichiers corrompu peut
Tout d'abord les options de montage pour Fat sont recon- déclencher un crash système.
nues. De plus, il existe :
Sous Linux, certains systèmes de fichiers ne supportent
uni_xlate pas l'option -o sync (le système ext2fs supporte les mises
Traduction des caractères Unicode non gérés en à jour synchrones (à la maniere BSD) lorsqu'il est monté
séquence d'échappement spéciales. Ceci permet de avec l'option sync).
sauver et de restaurer des fichiers dont le nom
contient n'importe quel caractère Unicode. Sans L'option -o remount peut parfois s'avérer incapable de
cette option, un '?' est utilisé à la place des modifier les paramètres de montage (tous les paramètres
caractères dont la traduction est impossible. Le ext2fs, sauf sb, sont modifiables lors d'un remontage par
caractère d'échappement est ':' puisqu'il est de exemple, mais vous ne pouvez pas modifier le gid ou
toute manière illégal dans les noms de fichiers l'umask pour un système fatfs).
vfat. La séquence d'échappement utilisée pour rem-
placer le caractère unicode u est : ':', (u & HISTORIQUE
0x3f), ((u>>6) & 0x3f), (u>>12). Une commande mount est apparue dans UNIX AT&T Version 6.

posix Autoriser l'existence de deux fichiers dont les


noms ne diffèrent que par une distinction majus- TRADUCTION
cule/minuscule. Christophe Blaess, 1997.

nonumtail
Essayer d'abord de créer un nom court sans numéro
de séquence avant d'essayer nom~num.ext. Lilo 15 Juillet 1997 MOUNT(8)

Options de montage pour xenix


Aucune. ) )

Options de montage pour xiafs


Aucune. xiafs n'est pas mauvais en soi, mais il n'est plus
très répandu et n'est pas maintenu. Il vaut mieux éviter NOM
de l'utiliser. mv - Déplacer ou renommer des fichiers.

SYNOPSIS
LE PÉRIPHÉRIQUE LOOP mv [options] source dest
Il est possible de faire un montage au travers du mv [options] source... répertoire
périphérique loop (boucle). Par exemple la commande : Options:

* *'
[-bfiuv] [-S suffixe_desire] [-V {numbered,existing,sim- arde à effectuer. La variable d'environnement VER-
ple}] [--backup] [--force] [--interactive] [--update] SION_CONTROL peut également être employée, mais
[--verbose] [--suffix=suffixe_desire] [--version-con- cette option est prioritaire. Si VERSION_CONTROL
trol={numbered,existing,simple}] [--help] [--version] n'est pas renseignée, et si cette option n'est pas
fournie, le type de sauvegarde par défaut est
DESCRIPTION `existing'. La valeur de la variable d'environ-
Cette page de manuel documente la version GNU de mv. nement VERSION_CONTROL ou de cet argument corre-
spond à la variable `version-control' d'Emacs. Les
Si le dernier argument est le nom d'un répertoire exis- valeurs acceptées sont (ainsi que les abréviations
tant, mv placera tous les autres fichiers à l'intérieur de uniques) :
ce répertoire, en conservant leurs noms.
`t' ou `numbered'
Sinon, s'il n'y a que deux fichiers indiqués, il déplacera Toujours numéroter les sauvegardes.
le premier pour remplacer le second.
`nil' ou `existing'
Une erreur se produit s'il y a plus de deux fichiers Numéroter la sauvegarde s'il en existe déjà
indiqués et si le dernier argument n'est pas un réper- une, sinon faire une sauvegarde simple.
toire. On ne peut déplacer que des fichiers réguliers au
sein du système de fichiers. `never' ou `simple'
Toujours faire une sauvegarde simple.
Si le fichier destination existant n'est pas accessible en
écriture, si l'entrée standard est un terminal tty, et si
les options -f ou --force ne sont pas indiquées, mv TRADUCTION
demande à l'utilisateur de confirmer l'écrasement du Christophe Blaess, 1997.
fichier. Si la réponse n'est pas affirmative, le fichier
est ignoré.

OPTIONS FSF 5 Mai 1999 MV(1)


-b, --backup
Effectuer une copie de secours des fichiers qui
doivent être effacés.

-f, --force % %
Ecraser les fichiers de destination existants sans
demander confirmation à l'utilisateur.

-i, --interactive
Demander la confirmation pour écraser tout fichier NOM
existant. Si la réponse ne commence pas par `y' ou nice - Exécuter un programme avec une priorité d'ordon-
`Y', le déplacement n'est pas effectué. nancement modifiée.

-u, --update SYNOPSIS


Ne pas déplacer un fichier régulier, qui écraserait nice [-n ajustement] [-ajustement] [--adjustment=ajuste-
un fichier destination existant ayant une date de ment] [--help] [--version] [commande [arg...]]
modification plus récente.
DESCRIPTION
-v, --verbose Cette page de manuel documente la version GNU de nice.
Afficher le nom des fichiers avant de les déplacer.
Remarquez que la plupart des shells ont une commande
--help Afficher un message d'aide sur la sortie standard, intégrée ayant le même nom et des fonctionnalités simi-
et terminer normalement. laires.

--version Si aucun argument n'est fourni, nice affiche la priorité


Afficher le numéro de version sur la sortie stan- d'ordonnancement en cours, dont cette commande a hérité au
dard, et terminer normalement. lancement.

-S, --suffix suffixe_désiré Sinon, nice exécute la commande désirée en ajustant la


Utiliser le suffixe_désiré lors des copie de sauve- priorité d'ordonnancement.
garde des fichiers. Ce suffixe peut également être
indiqué par la variable d'environnement SIM- Si aucun ajustement n'est précisé, la valeur de priorité
PLE_BACKUP_SUFFIX. Cette option est prioritaire de la commande est augmentée de 10.
sur la variable d'environnement. Si aucun de ces
deux éléments n'est indiqué, le suffixe `~', est [NDT] : `nice' signifie `gentil', la valeur de priorité
utilisé par défaut, comme avec Emacs. considérée est une valeur de gentillesse. Plus celle-ci
est élévée, plus le processus est gentil vis à vis des
-V, --version-control {numbered,existing,simple} autres, leur laissant un accès plus fréquent à l'ordon-
Cette option permet d'indiquer le type de sauveg- nanceur.

*- *&
ajoutant un `&' à la fin de la ligne de commande.
Le Super-User peut indiquer un ajustement négatif.
OPTIONS
La priorité peut être ajustée avec nice dans l'intervalle Quand la version GNU de nohup est invoquée avec un seul
-20 (le plus prioritaire) à 19 (le moins prioritaire). argument, elle reconnait les options suivantes :

OPTIONS --help Afficher un message d'aide sur la sortie standard


-n ajustement, -ajustement, --adjustment=ajustement et terminer normalement.
Ajouter ajustement à la priorité de la commande,
plutôt que la valeur 10 par défaut. --version
Afficher un numéro de version sur la sortie stan-
--help Afficher un message d'aide sur la sortie standard dard et terminer normalement.
et terminer normalement.

--version TRADUCTION
Afficher un numéro de version sur la sortie stan- Christophe Blaess, 1997.
dard et terminer normalement.

TRADUCTION FSF 2 Janvier 1997 NOHUP(1L)


Christophe Blaess, 1997.

FSF 2 Janvier 1997 NICE(1L)


(($ # ' (($ #

NAME
' ' passwd - update a user's authentication tokens(s)

SYNOPSIS
NOM passwd [-k] [-l] [-u [-f]] [-d] [-S] [username]
nohup - Exécuter un programme en le rendant insensible aux
déconnexions.

SYNOPSIS DESCRIPTION
nohup commande [arg...] Passwd is used to update a user's authentication token(s).
nohup {--help,--version}
Passwd is configured to work through the Linux-PAM API.
DESCRIPTION Essentially, it initializes itself as a "passwd" service
Cette page de manuel documente la version GNU de nohup. with Linux-PAM and utilizes configured password modules to
authenticate and then update a user's password.
nohup exécute la commande désirée en ignorant les signaux
HANGUP (déconnexion), avec une priorité d'ordonnancement
incrémentée de 5, afin que cette commande continue à A simple entry in the Linux-PAM configuration file for
s'exécuter en arrière-plan après la déconnexion de l'util- this service would be:
isateur.
#
Si le flux de sortie standard est un tty, celui-ci, ainsi # passwd service entry that does strength checking of
que le flux standard d'erreur sont redirigés afin d'être # a proposed password before updating it.
ajoutés au fichier `nohup.out'. #
passwd password requisite \
Si ce fichier n'est pas accessible en écriture, ils sont /usr/lib/security/pam_cracklib.so retry=3
redirigés vers `$HOME/nohup.out'. Si ce dernier fichier passwd password required \
n'est pas non plus accessible en écriture, la commande /usr/lib/security/pam_unix.so use_authtok
n'est pas exécutée. #

Lorsque nohup crée le fichier `nohup.out' ou


`$HOME/nohup.out', il ne lui donne aucune permission Note, other module-types are not required for this appli-
d'accès pour les membres du groupe ou pour les autres cation to function correctly.
utilisateurs. Par contre, il ne modifie pas les autorisa-
tions d'accès si le fichier existe déjà.
OPTIONS
nohup ne bascule pas automatiquement la commande exécutée -k The option, -k, is used to indicate that the update
en arrière-plan. Il faut le réclamer explicitement en should only be for expired authentication tokens

*0 *
(passwords); the user wishes to keep their non- from computer support or a vendor. Don't let any-
expired tokens as before. one watch you enter your password. Don't enter
your password to a computer you don't trust or if
things Use the password for a limited time and
-l This option is used to lock the specified account change it periodically.
and it is available to root only. The locking is
performed by rendering the encrypted password into
an invalid string (by prefixing the encrypted Choose a hard-to-guess password.
string with an !). passwd will try to prevent you from choosing a
really bad password, but it isn't foolproof; create
your password wisely. Don't use something you'd
--stdin find in a dictionary (in any language or jargon).
This option is used to indicate that passwd should Don't use a name (including that of a spouse, par-
read the new password from standard input, which ent, child, pet, fantasy character, famous person,
can be a pipe. and location) or any variation of your personal or
account name. Don't use accessible information
about you (such as your phone number, license
-u This is the reverse of the -l option - it will plate, or social security number) or your environ-
unlock the account password by removing the ! pre- ment. Don't use a birthday or a simple pattern
fix. This option is available to root only. By (such as backwards, followed by a digit, or pre-
default passwd will refuse to create a passwordless ceded by a digit. Instead, use a mixture of upper
account (it will not unlock an account that has and lower case letters, as well as digits or
only "!" as a password). The force option -f will punctuation. When choosing a new password, make
override this protection. sure it's unrelated to any previous password. Use
long passwords (say 8 characters long). You might
use a word pair with punctuation inserted, a
-d This is a quick way to disable a password for an passphrase (an understandable sequence of words),
account. It will set the named account password- or the first letter of each word in a passphrase.
less. Available to root only.

-n This will set the minimum password lifetime, in These principles are partially enforced by the system, but
days, if the user's account supports password life- only partly so. Vigilence on your part will make the sys-
times. Available to root only. tem much more secure.

-x This will set the maximum password lifetime, in EXIT CODE


days, if the user's account supports password life- On successful completion of its task, passwd will complete
times. Available to root only. with exit code 0. An exit code of 1 indicates an error
occurred. Textual errors are written to the standard
error stream.
-w This will set the number of days in advance the
user will begin receiving warnings that her pass-
word will expire, if the user's account supports CONFORMING TO
password lifetimes. Available to root only. Linux-PAM (Pluggable Authentication modules for Linux).
Note, if your distribution of Linux-PAM conforms to the
Linux Filesystem Standard, you may find the modules in
-i This will set the number of days which will pass /lib/security/ instead of /usr/lib/security/, as indicated
before an expired password for this account will be in the example.
taken to mean that the account is inactive and
should be disabled, if the user's account supports
password lifetimes. Available to root only. FILES
/etc/pam.d/passwd - the Linux-PAM configuration file

-S This will output a short information about the sta-


tus of the password for a given account. Available BUGS
to root user only. None known.

Remember the following two principles SEE ALSO


Protect your password. pam(8), and pam_chauthok(2).
Don't write down your password - memorize it. In
particular, don't write it down and leave it any-
where, and don't place it in an unencrypted file! For more complete information on how to configure this
Use unrelated passwords for systems controlled by application with Linux-PAM, see the Linux-PAM System
different organizations. Don't give or share your Administrators' Guide at
password, in particular to someone claiming to be <http://parc.power.net/morgan/Linux-PAM/index.html>
e (environnement) présente l'environnement à la suite
de la ligne de commande exécutée.
AUTHOR w (wide) affichage large. Ne coupe pas les informations
Cristian Gafton <gafton@redhat.com> pour les limiter à une seule ligne. Pour être exact,
chaque `w' autorise une ligne supplémentaire pour
chaque processus. Si la ligne supplémentaire n'est
pas nécéssaire, elle n'est pas utilisée. Il peut y
Red Hat Linux Jan 03 1998 PASSWD(1) avoir jusqu'à 100 w.
h ne pas afficher d'en-tête.
r ne présenter que les processus en exécution (run-
ning).
( ( n Affichage numérique des champs USER et WCHAN.

txx ne présenter que les processus contrôlés par le ter-


minal xx, ou xx représente soit le nom du términal
tel qu'il est mentionné dans le répertoire "/dev",
NOM soit son nom sans les suffixes tty ou cu. Il s'agit
ps - Afficher l'état des processus en cours. de l'heuristique inverse de celle utilisée par ps
pour afficher les noms abrégés dans le champs TTY. Ex
SYNOPSIS : ps -t1.
ps [-] [lujsvmaxScewhrnu] [txx] [O[+|-]k1[[+|-]k2...]]
[pids] O[+|-]k1[,[+|-]k2[,...]]
Ordonner la liste des processus en fonction d'un tri
il y a également trois options étendues : multi-niveaux spécifié par la séquence de clés
abrégées k1, k2... Ces abréviations sont présentées
--sortX[+|-]cle[,[+|-]cle[,...]] plus bas, dans le paragraphe CLES DE TRI.
--help Il y a un ordre de tri par défaut pour chaque format
de ps, mais ces ordres peuvent être remplacés par les
--version directives de l'utilisateur.
D'autres options étendues sont à venir... Le `+' est optionnel, puisqu'il ne fait que demander
l'ordre par défaut pour la cle indiquée. `-' inverse
DESCRIPTION l'ordre de tri sur la clé qu'il précède. Comme pour
ps présente un cliche instantané des processus en cours. les options t et pids, l'option O doit être la
Pour obtenir un affichage remis à jour régulièrement, dernière option au sein d'un unique argument, mais
utilisez top. les spécifications dans des arguments successifs sont
concaténées.
Cette page de manuel documente la version de ps basée sur
/proc. pids affiche uniquement les processus indiqués. Les PIDs
sont séparés par des virgules.
OPTIONS Au sein d'un même argument, la liste de PIDs doit
Les arguments de la ligne de commande peuvent être être le dernier élément. après la dernière option.
précédés par un '-', mais ce n'est pas indispensable. Il Exemple : ps -j1,4,5. Par contre, les listes se
existe également des options étendues, dans le style GNU, trouvant dans des arguments successifs sont con-
présentées plus bas. caténées, par exemple : ps -l 1,2 3,4 5 6 listera
l affichage long tous les processus 1-6 avec le format long.
u (utilisateur) présente le nom de l'utilisateur et
l'heure de lancement. Si des PIDs sont mentionnés, ou si un terminal de
j (job) présente les Pgid et Sid. contrôle est spécifié, les processus correspondants
s (signal) présente les signaux bloqués, ignorés et sont affichés quelques soient les autres options.
interceptés. Ces listes ont priorité sur les options 'a' et 'x'.
v (vm) affiche des informations sur la mémoire
virtuelle. OPTIONS ÉTENDUES
m (mémoire) affiche des informations sur l'occupation Ces options sont précédées par un double tiret.
mémoire. A combiner avec l'option p pour obtenir les
nombres de pages. --sortX[+|-]key[,[+|-]key[,...]]
f (forêt) affiche les arbres généalogiques des proces- Trier en utilisant les clés complètes (avec plusieurs
sus. lettres) présentées dans le paragraphe CLÉS DE TRI.
a (autres) présente également les processus des autres X peut représenter n'importe quel caractère utilisé
utilisateurs. comme séparateur. Un vrai GNUiste utilisera `='. Le
x affiche les processus qui n'ont pas de terminal de `+' est superflu, puisque la direction de tri par
contrôle. défaut est l'ordre numérique ou lexicographique
S additionner les temps CPU et les fautes de pagination croissant. Ex.: ps -jax --sort=uid,-ppid,+pid
des processus fils.
c (commande) afficher le nom de la commande exécutée. --help
!
Afficher un message d'aide résumant les options tillesse positive (nice, champ NI).
d'utilisation et fournissant une liste des clés sup-
portées. Cette liste peut être plus a jour que la TT terminal de contrôle
présente page de manuel.
PAGEIN
--version Nombre de fautes de pages majeures (où l'on doit lire
Afficher le numéro de version, et l'origine du pro- des pages sur le disque, y compris dans le buffer
gramme. cache).

CLES DE TRI TRS Taille de code résident en mémoire.


Notez que le tri est fait en utilisant les valeurs
internes et non pas les valeurs présentées à l'écran. SWAP Nombre de kilo-octets (où de pages si l'option -p est
utilisée) sur le périphérique de swap.
ABREV. COMPLETE DESCRIPTION
c cmd nom de l'exécutable SHARE
C cmdline ligne de commande complète Mémoire partagée.
f flags attributs FLAGS du format long
g pgrp ID du groupe de processus MISE À JOUR
G tpgid terminal contrôlant le groupe Cette version de ps basée sur proc fonctionne en lisant le
j cutime temps utilisateur cumulé pseudo-système de fichiers monté sur le répertoire /proc.
J cstime temps système cumulé Cette version n'a pas besoin de privilèges spéciaux, ni de
k utime temps utilisateur bit S-UID positionné. Ne donnez pas de privilège à cette
K stime temps système version de ps
m min_flt nombre de fautes de page mineures
M maj_flt nombre de fautes de page majeures Pour obtenir des informations correctes dans le champs
n cmin_flt fautes de page mineures cumulées WCHAN, il vous faudra créer le fichier /etc/psdatabase en
N cmaj_flt fautes de page majeures cumulées lancant le programme /etc/psupdate. Ceci doit être repro-
o session ID de session duit à chaque nouvelle compilation du noyau. Vous devriez
p pid ID de processus également lancer 'ps' en étant connecté sous 'root'
P ppid ID du processus père lorsque les périphériques tty du répertoire "/dev"
r rss taille résidente changent.
R resident pages résidentes
s size taille mémoire en kilo-octets Avec procps-1.00, ps/top lisent directement System.map si
S share nombre de pages partagées ce fichier est disponible. La recherche de la table de
t tty numéro mineur de péripherique tty correspondance entre les adresses et les symboles du noyau
T start_time heure de lancement se fait dans l'ordre suivant :
U uid ID utilisateur $PS_SYSTEM_MAP
u user nom d'utilisateur /boot/System.map-`uname -r`
v vsize taille totale VM en octets /boot/System.map
y priority priorité d'ordonnancement /lib/modules/`uname -r`/System.map
/etc/psdatabase
DESCRIPTIONS DES CHAMPS /boot/psdatabase-`uname -r`
PRI Il s'agit d'un compteur dans la structure représen- /boot/psdatabase,
tant la tâche. C'est la fréquence, en HZ des activa- /lib/modules/`uname -r`/psdatabase
tions possibles du processus.

NI Valeur standard Unix de gentillesse (nice). Une NOTES


valeur positive signifie un accàs moindre au CPU. Le membre used_math de la structure task_struct n'est pas
affiché, car crt0.s vérifie si math est présent.
SIZE Taille virtuelle de l'image du processus (code + L'attribut math est ainsi positionné pour tous les proces-
données + pile). sus. [NDT : je pense que 'math' indique une utilisation du
coprocesseur arithmétique, mais je n'en suis pas sûr.]
RSS Taille résidente de l'image du processus. Nombre de
kilo-octets se trouvant en mémoire. Les programmes swappés sur le disque sont présentés sans
les arguments de la ligne de commande, et sont affichés
WCHAN entre parenthèses sauf si l'option c est utilisée.
Nom de la fonction du noyau dans laquelle le proces-
sus est endormi. Le préfixe `sys_' est supprimé. Ce %CPU correspond à un rapport Temps CPU / Temps utilisa-
nom peut être remplacé par un nombre héxadecimal si teur. La somme des valeurs ne donne pas 100% (à moins que
le fichier /etc/psdatabase n'existe pas. vous ayez de la chance). Il s'agit d'un rapport entre le
temps d'exécution effectif et le temps depuis lequel le
STAT Etat du processus. Le premier champ correspond à R processus a été lancé.
(runnable) prêt à être exécuté, S (sleeping) endormi,
D sommeil ininterruptible, T (traced) arrêté ou Les champs SIZE et RSS ne prennent pas en compte les
suivi, Z (zombie). Le second champ contient W si le tables des pages et la structure task_struct du processus;
processus n'a pas de pages résidentes. Le troisième Il y a toujours au moins 12 Ko de données résidentes en
champ contient N si le processus a une valeur de gen- mémoire. SIZE est la taille virtuelle du processus (code
'
+ données + pile). version intégrée, et non pas celle documentée ici.

Pour effectuer la correspondance entre numéro de OPTIONS


périphérique et nom de terminal, ps utilise une table --help Afficher un message d'aide sur la sortie standard
"/etc/psdevtab". Cette table est mise à jour à chaque et terminer normalement.
fois que "/dev" est plus récent qu'elle. Bien sur la mise
à jour ne peut être faite que si les autorisations d'accès --version
le permettent durant l'exécution. Si la mise à jour n'est Afficher un numéro de version sur la sortie stan-
pas faite, chaque appel de ps nécéssite un appel stat(2) dard et terminer normalement.
sur chacun des fichiers de "/dev". Si "/dev" change sou-
vent, il faut lancer souvent ps en étant root ;-)
J'ajouterais peut-être un fichier de rechange dans le TRADUCTION
répertoire $HOME si la demande devient pressante. Christophe Blaess, 1997.

AUTEURS
ps a été écrit initialement par Branko Lankester
(lankeste@fwi.uva.nl). FSF 2 Janvier 1997 PWD(1L)

Michael K. Johnson (johnsonm@sunsite.unc.edu) l'a ré-écrit


pour utiliser le pseudo-système de fichiers "/proc", en
modifiant peu de choses pour le reste. " & "
Michael Shields (mjshield@nyx.cs.du.edu) ajouta la gestion
des listes de PIDs.

Charles Blake(cblake@bbn.com) a implementé le tri multi- NOM


niveaux, la bibliothèque dans le style dirent, la corre- halt, reboot - Arrêter le système.
spondance entre numéro de péripherique et nom de terminal,
la recherche binaire directe dans System.map, et beaucoup SYNOPSIS
d'autres chose. C'est lui qui maintient actuellement /sbin/halt [-n] [-w] [-d] [-f] [-i]
l'ensemble proc-ps. /sbin/reboot [-n] [-w] [-d] [-f] [-i]

DESCRIPTION
TRADUCTION Halt enregistre le fait que le système va s'arrêter dans
Christophe Blaess, 1997. le fichier /var/log/wtmp, et ensuite demande au noyau
d'arrêter ou de redémarrer le système. Si halt ou reboot
est appellé quand le système n'est pas dans au niveau
d'exécution 0 ou 6, shutdown(8) sera appelé à la place
Linux 9 Juin 1997 PS(1) (avec l'option -h ou -r).

OPTIONS
-n Ne pas synchroniser le cache avec les disques avant
d'arrêter ou réinitialiser le système
$# $#
-w Ne pas réinitialiser ou arrêter le système mais
enregistre le fait que le système va s'arrêter
(dans le fichier /var/log/wtmp ).
NOM
pwd - Afficher le nom du répertoire de travail en cours. -d Ne pas enregistre le wtmp. L'option -n implique -d.

SYNOPSIS -f Force la réinitialion ou l'arrêt sans appeller


pwd shutdown.
pwd {--help,--version}
-i Interrompt l'activité de toutes les interfaces
DESCRIPTION réseaux avant la réinitialisation ou l'arrêt.
Cette page de manuel documente la version GNU de pwd
([NDT] pwd = Print Working Directory). DIAGNOSTIQUE
Si vous n'êtes pas le super-utilisateur, vous n'obtiendrez
pwd affiche le nom complet du répertoire en cours. que le message `must be superuser'.

Ceci signifie que tous les composants du chemin affiché NOTES


seront de vrais répertoires, aucun lien symbolique ne sera Dans les versions précédentes de sysvinit , reboot et halt
présent. ne devaient jamais être appelés directement. A partir de
cette version, halt et reboot appellent shutdown si le
Remarquez que la plupart des shells Unix disposent d'une système est dans un niveau d'exécution entre 1 et 5.
commande pwd intégrée ayant les mêmes fonctionnalités.
Ainsi la simple évocation de pwd exécutera généralement la

- &
AUTEUR TRADUCTION
Miquel van Smoorenburg, miquels@cistron.nl Thierry Vignaud <tvignaud@mandrakesoft.com>, 1999.

VOIR AUSSI
shutdown(8), init(1).
Linux 19 Mars 1999 HALT(8)
TRADUCTION
Thierry Vignaud <tvignaud@mandrakesoft.com>, 1999.

Linux 19 Mars 1999 HALT(8) % %" (/ & + % %"


NAME
% " & % " renice - alter priority of running processes

SYNOPSIS
renice priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]
NOM
halt, reboot - Arrêter le système. DESCRIPTION
Renice alters the scheduling priority of one or more running processes.
SYNOPSIS The following who parameters are interpreted as process ID's, process
/sbin/halt [-n] [-w] [-d] [-f] [-i] group ID's, or user names. Renice'ing a process group causes all pro-
/sbin/reboot [-n] [-w] [-d] [-f] [-i] cesses in the process group to have their scheduling priority altered.
Renice'ing a user causes all processes owned by the user to have their
DESCRIPTION scheduling priority altered. By default, the processes to be affected
Halt enregistre le fait que le système va s'arrêter dans are specified by their process ID's.
le fichier /var/log/wtmp, et ensuite demande au noyau
d'arrêter ou de redémarrer le système. Si halt ou reboot Options supported by renice:
est appellé quand le système n'est pas dans au niveau
d'exécution 0 ou 6, shutdown(8) sera appelé à la place -g Force who parameters to be interpreted as process group ID's.
(avec l'option -h ou -r).
-u Force the who parameters to be interpreted as user names.
OPTIONS
-n Ne pas synchroniser le cache avec les disques avant -p Resets the who interpretation to be (the default) process ID's.
d'arrêter ou réinitialiser le système
For example,
-w Ne pas réinitialiser ou arrêter le système mais
enregistre le fait que le système va s'arrêter renice +1 987 -u daemon root -p 32
(dans le fichier /var/log/wtmp ).
would change the priority of process ID's 987 and 32, and all processes
-d Ne pas enregistre le wtmp. L'option -n implique -d. owned by users daemon and root.

-f Force la réinitialion ou l'arrêt sans appeller Users other than the super-user may only alter the priority of processes
shutdown. they own, and can only monotonically increase their ``nice value'' within
the range 0 to PRIO_MAX (20). (This prevents overriding administrative
-i Interrompt l'activité de toutes les interfaces fiats.) The super-user may alter the priority of any process and set the
réseaux avant la réinitialisation ou l'arrêt. priority to any value in the range PRIO_MIN (-20) to PRIO_MAX. Useful
priorities are: 20 (the affected processes will run only when nothing
DIAGNOSTIQUE else in the system wants to), 0 (the ``base'' scheduling priority), any-
Si vous n'êtes pas le super-utilisateur, vous n'obtiendrez thing negative (to make things go very fast).
que le message `must be superuser'.
FILES
NOTES /etc/passwd to map user names to user ID's
Dans les versions précédentes de sysvinit , reboot et halt
ne devaient jamais être appelés directement. A partir de SEE ALSO
cette version, halt et reboot appellent shutdown si le getpriority(2), setpriority(2)
système est dans un niveau d'exécution entre 1 et 5.
BUGS
Non super-users can not increase scheduling priorities of their own pro-
AUTEUR cesses, even if they were the ones that decreased the priorities in the
Miquel van Smoorenburg, miquels@cistron.nl first place.
The Linux kernel (at least version 2.0.0) and linux libc (at least ver-
VOIR AUSSI sion 5.2.18) does not agree entierly on what the specifics of the system-
shutdown(8), init(1). call interface to set nice values is. Thus causes renice to report bogus
previous nice values.

0 *
Supprimer récursivement le contenu des répertoires.
HISTORY
The renice command appeared in 4.0BSD. -v, --verbose
Afficher le nom de chaque fichier avant suppres-
4th Berkeley Distribution June 9, 1993 4th Berkeley Distribution sion.

--help Afficher un message d'aide sur la sortie standard,


et terminer correctement.

--version
Afficher le numéro de version sur la sortie stan-
dard, et terminer correctement.
NOM
rm - Effacer des fichiers. TRADUCTION
Christophe Blaess, 1997.
SYNOPSIS
rm [-dfirvR] [--directory] [--force] [--interactive]
[--recursive] [--help] [--version] [--verbose] nom...
FSF 5 Mai 1999 RM(1)
DESCRIPTION
Cette page de manuel documente la version GNU de rm ([NDT]
rm = remove - enlever).

rm efface chaque fichier indiqué. Par défaut, il n'efface # #


pas les répertoires.

Si un fichier n'est pas accessible en écriture, si NOM


l'entrée standard est un terminal tty, et si les options rmdir - Supprimer des répertoires vides.
-f ou --force ne sont pas indiquées, rm demande à l'util-
isateur de confirmer l'effacement du fichier. Si la SYNOPSIS
réponse n'est pas affirmative, le fichier est ignoré. rmdir [options] [repertoire...]

La version GNU de rm, comme tous les programmes utilisant Options POSIX : [-p]
la fonction getopt(3) pour analyser leurs arguments, vous
permet d'utiliser l'option -- pour indiquer que l'argument Options GNU (forme courte): [-p] [--help] [--version] [--]
suivant n'est pas une option. Pour supprimer un fichier rmdir [-p] [--parents] [--help] [--version] répertoire...
nomme `-f' dans le répertoire en cours, on peut utiliser
soit DESCRIPTION
rm -- -f rmdir supprime chaque répertoire vide indiqué. ([NDT]
soit rmdir = Remove Directory).
rm ./-f
La version Unix de rm utilise un unique `-' pour cela, car Tout argument (autre que les options) ne se rapportant pas
elle est antérieure au standard des options analysées par à un répertoire vide est considéré comme une erreur.
getopt().
OPTIONS POSIX
OPTIONS -p Effacer les répertoires parents s'ils deviennent
-d, --directory vides après la suppression des répertoires men-
Efface un répertoire avec `unlink' à la place de tionnés en argument. Ainsi `rmdir -p a/b/c' est
`rmdir', ne nécessitant pas que le répertoire soit équivalent à `rmdir a/b/c; rmdir a/b; rmdir a'.
vide. Seul le Super-User peut utiliser cette
option. Comme un 'unlink' sur un répertoire OPTIONS GNU
déréférence tous les fichiers qui y etaient con- -p, --parents
tenus, il est conseille d'effectuer un fsck sur le Comme décrit ci-dessus.
système de fichiers après cette opération.
--help Afficher un message d'aide sur la sortie standard
-f, --force et terminer correctement.
Ignorer les fichiers non existants, et ne pas
interroger l'utilisateur. --version
Afficher le numéro de version sur la sortie stan-
-i, --interactive dard et terminer correctement.
Demander à l'utilisateur de confirmer l'effacement
de chaque fichier. Si la réponse ne commence pas -- Fin des options.
par `y' ou `Y', le fichier est ignoré.
ENVIRONNEMENT
-r, -R, --recursive Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont
leurs significations habituelles. rpm [--uninstall|-e] [options_désinstallation] [paque-
tage]+
CONFORMITÉ rpm [--verify|-V] [options_vérification] [paquetage]+
POSIX 1003.2
Signatures:
NOTES rpm [--verify|-V] [options_vérification] [paquetage]+
La commande `rmdir foo' n'effacer le répertoire foo, que rpm [--resign] [fichier_paquetage]+
s'il est vide. Si on désire effacer également les réper- rpm [--addsign] [fichier_paquetage]+
toires non-vides, il faut utiliser `rm -r foo'.
Divers :
Cette page décrit la version de rmdir fournie dans le rpm [--showrc]
package fileutils-3.16. rpm [--setperms] [paquetage]+
rpm [--setgids] [paquetage]+
TRADUCTION
Christophe Blaess, 1997.

OPTIONS GENERALES
Ces options peuvent être utilisées dans différents modes.
FSF 27 Novembre 1996 RMDIR(1L)
-vv Afficher un tas d'horribles informations de débog-
gage.

" & " --quiet


Afficher le moins possible ; normalement seuls les
messages d'erreur seront affichés.

--help Afficher un message d'utilisation plus long que


NOM d'habitude.
rpm - Gestionnaire de Paquetages Red Hat.
--version
SYNOPSIS Afficher une seule ligne contenant le numéro de
rpm [options] version utilisé par rpm.
DESCRIPTION --rcfile <liste_fichiers>
rpm est un puissant gestionnaire de paquetages, qui peut Chacun des fichiers dans la <liste_fichiers>
être utilisé pour construire, installer, interroger, séparés par des deux-point est lu séquentiellement
vérifier, mettre à jour, et désinstaller des paquetages de par rpm pour obtenir des informations de configura-
logicies individuels. Un paquetage consiste en une tion. La <liste_fichiers> par défaut est
archive de fichiers, et en de l'information sur ce paque- /usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc. Seul le
tage, incluant le nom, la version et la description du premier fichier dans la liste doit exister, les
paquetage. tildes sont étendues à $HOME.
Un des modes de base suivants doit être sélectionné : Ini- --root <répertoire>
tialiser Base De Données, Reconstruire Base De Données, Utiliser le système "enraciné" dans <répertoire>
Construire Paquetage, Recompiler Paquetage, Construire pour toutes les opérations. Notez que cela signi-
Paquetage à partir Tarball, Interroger, Montrer Etiquettes fie que la base de données sera lue ou modifiée
de Requêtes, Installer, Rafraîchir, Désinstaller, dans <répertoire> et que chacun des scripts pre et
Vérifier, Vérifier Signature, Resigner, Ajouter Signature, post seront lancés après un chroot() vers <réper-
fixer propriétaires et groupes et Montrer Configuration. toire>.
Maintenance de la Base De Données : --dbpath <chemin>
rpm -i [--initdb] Utiliser la base de données RPM située dans
rpm -i [--rebuiddb] <chemin>.
Construction : --justdb
rpm [-b|t] [spec_paquetage]+ Mettre à jour uniquement la base de données, pas le
rpm [--rebuild] [source_rpm]+ système de fichiers.
rpm [--tarbuild] [source_tarrée]+
--ftpproxy <hôte>, --httpproxy <hôte>
Requêtes : Utiliser <hôte> en tant qu'hôte proxy FTP ou HTTP.
rpm [--query] [options_de_requête] Voir OPTIONS FTP/HTTP.
rpm [--querytags]
--ftpport <port>, --httpport <port>
Maintenir les paquetages installés : Utiliser <port> comme port FTP ou HTTP sur l'hôte
rpm [--install] [options] [fichier_paquetage]+ proxy. Voir OPTIONS FTP/HTTP.
rpm [--freshen|-F] [options_installation]
[fichier_paquetage]+ --pipe <cmd>
!
Envoyer la sortie de rpm à la commande <cmd> par
l'intermédiaire d'un tube. --noscripts
Ne pas exécuter les scripts de pré- et post-
installation.
OPTIONS D'INSTALLATION ET DE MISE A NIVEAU
La forme de la commande d'installation rpm est --notriggers
Ne pas exécuter les scripts qui sont déclenchés par
rpm -i [options_installation] <fichier_paquetage>+ l'installation de ce paquetage.

Ceci installe un nouveau paquetage. La forme générale --ignoresize


d'une commande de mise à niveau rpm est Ne pas examiner les systèmes de fichiers montés
pour vérifier qu'il y ait un espace disque suff-
rpm -U [options_installation] <fichier_paquetage>+ isant avant d'installer ce paquetage.

Ceci met à jour ou installe le paquetage installé --excludepath <chemin>


actuellement à la version du nouveau RPM. Ceci est la Ne pas installer les fichiers dont les noms commen-
même chose que l'installation, sauf que les autres ver- cent par <chemin>.
sions du paquetage sont supprimées du système.
--excludedocs
rpm [-F|--rafraîchir] [options_installation] Ne pas installer de fichiers qui sont marqués comme
<fichier_paquetage>+ documentation (ce qui inclut les pages de manuel et
les documents texinfo).
Ceci mettra à niveau les paquetages, mais uniquement si
une version plus ancienne existe actuellement. --includedocs
Installer les fichiers de documentation. C'est le
Le <fichier_paquetage> peut être spécifié par une URL ftp comportement par défaut.
ou http, auquel cas le paquetage sera téléchargé avant
d'être installé. Voir OPTIONS FTP/HTTP pour obtenir des --test Ne pas installer le paquetage, uniquement le
informations sur le support intégré de ftp et http par vérifier et rapporter les conflits potentiels.
RPM.
--ignorearch
Ceci permet l'installation ou la mise à niveau même
--force si l'architecture du binaire RPM et de l'hôte ne
Idem que --replacepkgs, --replacefiles, et --oldpa- correspondent pas.
quetage.
--ignoreos
-h, --hash Ceci permet l'installation ou la mise à niveau même
Afficher 50 marques de hachage quand l'archive du si les systèmes d'exploitation du binaire RPM et de
paquetage est déballée. A utiliser avec -v pour un l'hôte ne correspondent pas.
bel affichage.
--prefix <chemin>
--oldpackage Ceci fixe le préfixe d'installation à <chemin> pour
Permettre à une mise à niveau de remplacer un les paquetages relogeables.
paquetage par un paquetage plus ancien.
--relocate <ancien_chemin>=<nouveau_chemin>
--percent Pour les paquetages relogeables, traduit les
Afficher les pourcentages quand les fichiers sont fichiers qui seraient mis dans <oldchemin> par
extraits de l'archive du paquetage, ceci dans le <newchemin>.
but de rendre RPM facile à lancer à partir d'autres
outils. --badreloc
A utiliser en conjonction avec --relocate, ceci
--replacefiles force le relogement même si le paquetage n'est pas
Installer les paquetages même s'ils remplacent des relogeable.
fichiers d'autres paquetages déjà installés.
--noorder
--replacepkgs Ne pas réordonner les paquetages pour une installa-
Installer les paquetages même si certains d'entre tion. La liste des paquetages devrait normalement
eux sont déjà installés sur ce système. être réordonnée pour satisfaire aux dépendances.

--allfiles
Installer ou mettre à niveau tous les fichiers man- OPTIONS DE REQUETE
quants du paquetage, même s'ils existent déjà. La forme générale d'une commande de requête rpm est

--nodeps rpm -q [options_de_requête]


Ne pas effectuer de vérification de dépendances
avant d'installer ou de mettre à niveau un paque- Vous pouvez spécifier le format d'information de paquetage
tage. qui sera affiché. Pour cela, utilisez l'option [--query-
'
format|-qf], suivie de la chaîne de caractères de format. Bien que toutes les informations (p.ex. les listes
de fichiers) ne soient pas disponibles, ce type
Les formats de requête sont des versions modifiées du for- d'interrogation permet à rpm d'être utilisé pour
mattage standard printf(3). Ce format est constitué de extraire de l'information de fichiers de spécifica-
chaînes de caractères statiques (qui peuvent inclure les tions sans avoir à écrire un parseur de fichiers de
séquences d'échappement du C standard pour les sauts de spécifications.
lignes, les tabulations, et d'autres caractères spéciaux)
et les formatteurs du type de ceux de printf(3). Comme --querybynombre <nombre>
rpm connaît déjà les types à afficher, le spécificateur de Interroger la <nombre>ième entrée de la base de
type doit néanmoins être omis, et remplacé par le nom de données directement; ceci est utile à des fins de
l'étiquette (tag) d'entête à afficher, enfermé dans des déboggage.
caractères {}. La partie RPMTAG_ du nom de l'étiquette
peut être omise. --triggeredby <pkg>
Interroger les paquetages qui sont déclenchés par
Des formats de sortie alternatifs peuvent être requis en les paquetages <pkg>.
faisant suivre l'étiquette par :typetag. Actuellement,
les types suivants sont supportés : octal, date, shescape,
perms, fflags, et depflags. Options de sélection d'information :

Par exemple, pour afficher uniquement les noms des paque- -i Afficher l'information du paquetage, incluant son
tages requis, vous pouvez utiliser %{NOM} comme chaîne de nom, sa version, et sa description. Cette option
caractères de format. Pour afficher de l'information de utilisera --queryformat s'il a été spécifié.
nom et de distribution en deux colonnes, vous pouvez
utiliser %-30{NOM}%{DISTRIBUTION}. -R, --requires
Lister les paquetages desquels dépend ce paquetage.
rpm affichera une liste de toutes les étiquettes qu'il
connaît quand il est invoqué avec l'argument --querytags. --provides
Lister les capacités que fournit ce paquetage.
Il y a deux sous-ensembles d'option pour les requêtes : la
sélection de paquetages et la sélection d'information. --changelog
Lister les informations de modifications de ce
Options de sélection de paquetages : paquetage.

<nom_paquetage> -l, --list


Interroger le paquetage intallé nommé <nom_paque- Lister les fichiers du paquetage.
tage>.
-s, --state
-a, --all Afficher les états des fichiers du paquetage
Interroger tous les paquetages intallés. (implique -l). L'état de chaque fichier est soit
normal, non installé, ou remplacé.
--whatrequires <capacité>
Interroger tous les paquetages qui ont besoin de -d, --docfiles
<capacité> pour leur fonctionnement propre. Lister uniquement les fichiers de documentation
(implique -l).
--whatprovides <virtuel>
Interroger tous les paquetages qui fournissent la -c, --configfiles
capacité <virtuel>. Lister uniquement les fichiers de configuration
(implique -l).
-f <fichier>, --fichier <fichier>
Interroger le paquetage possédant <fichier>. --scripts
Lister les scripts shell spécifiques au paquetage
-g <groupe>, --groupe <groupe> qui sont utilisés comme une partie des processus
Interroger les paquetages dont le groupe est d'installation et de désinstallation, s'il y en a.
<groupe>.
--triggers, --triggerscripts
-p <fichier_paquetage> Afficher les scripts de déclenchement, s'il y en a,
Interroger un paquetage <fichier_paquetage> non qui sont contenus dans le paquetage.
installé . Le <fichier_paquetage> peut être
spécifié comme une URL de type ftp ou http, auquel --dump Afficher l'information du fichier comme suit :
cas l'entête du paquetage sera téléchargée et chemin taille mtime somme_md5 mode propriétaire
interrogée. Voir OPTIONS FTP/HTTP pour obtenir de groupe isconfig isdoc rdev symlink. Ceci doit être
l'information sur le support intégré d'un client utilisé avec au moins une option parmi -l, -c, -d.
ftp et http par RPM.
--last Ordonner le listing des paquetages par date
--specfile <fichier_de_specs> d'installation de sorte que les derniers fichiers
Analyse syntaxiquement (parse) et interroge installés soient au sommet.
<fichier_de_specs> comme s'il était un paquetage.
- &
--filesbypkg
Lister tous les fichiers de chaque paquetage. M Mode (inclut les permissions et le type de fichier)

--triggerscripts
Montrer tous les scripts de déclenchement pour les VERIFICATION DE SIGNATURE
paquetages sélectionnés. La forme générale d'une commande de vérification d'une
signature rpm est

OPTIONS DE VERIFICATION rpm --checksig <fichier_paquetage>+


La forme générale d'une commande de vérification rpm est
Ceci vérifie la signature PGP du paquetage <fichier_paque-
rpm -V|-y|--verify [verify-options] tage> pour s'assurer de son intégrité et de son origine.
Les informations de configurations de PGP sont lues à par-
Vérifier un paquetage compare les informations sur les tir des fichiers de configuration. Voir la section sur
fichiers installés dans le paquetage avec les informations les SIGNATURES PGP pour les détails.
sur les fichiers obtenues à partir du paquetage original
et conservées dans la base de données rpm. Entre autres
choses, la vérification compare la taille, la somme MD5, OPTIONS DE DESINSTALLATION
les permissions, le propriétaire et les groupes de chaque La forme générale d'une commande de désinstallation rpm
fichier. Toutes les discordances sont affichées. Les est
options de spécification de paquetage sont les mêmes que
pour l'interrogation de paquetages. rpm -e <nom_paquetage>+

Les fichiers qui n'étaient pas installés en provenance du


paquetage, par exemple les fichiers de documentation --allmatches
exclus à l'installation en utilisant l'option "--exclude- Supprimer toutes les versions du paquetage auquel
docs", sont ignorés silencieusement. correspond <nom_paquetage>. Normalement, une
erreur est émise si <paquetage_nom> correspond à de
Options pouvant être utilisées en mode de vérification : multiples paquetages.

--noscripts
--nomd5 Ne pas exécuter les scripts de pré- et de post-
Ignore les erreurs de somme de contrôle MD5 pendant désinstallation.
la vérification.
--notriggers
--nopgp Ne pas exécuter les scripts qui sont déclenchés par
Ignore les erreurs de contrôle PGP pendant la la suppression de ce paquetage.
vérification.
--nodeps
--nofiles Ne pas vérifier les dépendances avant de désin-
Ignore les fichiers manquants pendant la vérifica- staller les paquetages.
tion.
--test Ne pas réellement désinstaller quoi que ce soit,
Le format de sortie est constitué d'une chaîne de juste effectuer un test pour voir si c'est possi-
caractères de 8 caractère, d'un "c" éventuel dénot- ble. Utile en conjonction avec l'option -vv.
tant un fichier de configuration, et ensuite du nom
du fichier. Chacun des 8 caractères dénote le
résultat d'une comparaison d'un attribut du fichier OPTIONS DE CONSTRUCTION
avec la valeur de cet attribut enregistré dans la La forme générale d'une commande de construction rpm est
base de données rpm. Un simple "." (point) signi-
fie que le test s'est bien passé. Les caractères rpm -[b|t]O [options_de_construction] <spec_paque-
suivants dénote l'échec à certains tests : tage>+

L'argument utilisé est -b si un fichier de spécifications


5 Somme MD5 est utilisé pour construire le paquetage et -t si RPM
devrait regarder à l'intérieur d'un fichier gzippé (ou
S Taille du fichier tarré) pour obtenir le fichier de spécifications à
utiliser. Après le premier argument, l'argument suivant
L Lien symbolique (O) spécifie les étapes de construction et de mise en
paquets à effectuer et est un argument parmi :
T Mtime

D Périphérique -bp Exécute l'étape "%prep" du fichier de spécifica-


tions. Normalement, ceci implique de déballer les
U Utilisateur sources et d'appliquer tous les patchs.

G Groupe -bl Faire une "vérification de liste". La section


0 *
"%files" du fichier de spécifications subit conséquence.
l'expansion des macros, et des vérifications sont
effectuées pour vérifier que chaque fichier existe. --buildarch <arch>
Pendant la construction du paquetage, fixer
-bc Effectuer l'étape "%build" du fichier de spécifica- l'architecture à <arch>. Cette option a été rendue
tions (après avoir effectué l'étape prep). Cela obsolète par --target dans RPM 3.0.
implique en général l'équivalent d'un "make".
--buildos <se>
-bi Effectuer l'étape "%install" du fichier de spécifi- Pendant la construction du paquetage, fixer
cations (après avoir effectué les étapes prep et l'architecture à <os>. Cette option a été rendue
build). Cela implique en général l'équivalent d'un obsolète par --target dans RPM 3.0.
"make install".

-bb Construire un paquetage binaire (après avoir OPTIONS DE RECONSTRUCTION ET DE RECOMPILATION


effectué les étapes prep, build, et install). Il y a deux autres façons d'invoquer une construction avec
rpm:
-bs Construire uniquement le paquetage source (après
avoir effectué les étapes prep, build, et install). rpm --recompile <fichier_paquetage_sources>+

-ba Construire les paquetages paquetages binaires et rpm --rebuild <fichier_paquetage_sources>+


sources (après avoir effectué les étapes prep,
build, et install). Quand il est invoqué de cette façon, rpm installe le
paquetage de sources désigné, et effectue une préparation,
Les options suivantes peuvent également être utilisées : une compilation et une installation. En plus, --rebuild
construit un nouveau paquetage bianire. Quand la con-
--short-circuit struction est terminée, le répertoire de construction est
Passer directement à l'étape spécifiée (çàd, passer supprimé (comme avec --clean) et les sources ainsi que le
toutes les étapes menant à l'étape spécifiée). fichier de spécifications du paquetage sont supprimés.
Uniquement valide avec -bc et -bi.

--timecheck SIGNATURE D'UN RPM EXISTANT


Fixer l'âge de "timecheck" (0 pour le désactiver). rpm --resign <fichier_paquetage_binaires>+
Cette valeur peut également être configurée en
définissant la macro "_timecheck". La valeur de Cette option génère et insère de nouvelles signatures pour
timecheck exprime, en secondes, l'âge maximum d'un les paquetages spécifiés. Toute signature existante est
fichier en train d'être mis en paquetage. Des supprimée.
avertissements seront affichés pour tous les
fichiers au-delà de l'âge de timecheck. rpm --addsign <fichier_paquetage_binaires>+

--clean Cette option génère et concatène les nouvelles signatures


Supprimer l'arbre de construction après que les des paquetages spécifiés à celles qui existaient déjà.
paquetages aient été créés.

--rmsource SIGNATURES PGP


Supprimer les sources et le fichier de spécifica- Pour utiliser la caractéristique des signatures, RPM doit
tions après la construction (peut également être être configuré pour lancer PGP, et il doit être capable de
utilisé seul, p.ex. "rpm --rmsource foo.spec"). trouver un groupe de clés publiques (keyring) avec des
clés publiques RPM à l'intérieur. Par défaut, RPM utilise
--test N'exécuter aucune étape de construction. Utile les comportements par défaut de PGP pour trouver les
pour tester en profondeur les fichiers de spécifi- keyrings (en utilisant PGPPATH). Si vos keyrings ne sont
cations. pas situées là où PGP s'attend à ce qu'elles soient, vous
aurez besoin de configurer la macro
--sign Incorpore une signature PGP dans le paquetage.
Cette signature peut être utilisée pour vérifier
l'intégrité et l'origine du paquetage. Voir la _pgp_path
section sur les SIGNATURES PGP pour les détails de pour fournir la localisation des keyrings PGP à
configuration. utiliser.

--buildroot <répertoire>
Pendant la construction du paquetage, surcharger Si vous voulez être capable de signer les paquetages que
l'étiquette de Construction de Racine avec le vous avez créés vous-même, vous devrez également créer
répertoire <répertoire>. votre propre paire clé publique/clé secrète (voir le
manuel PGP). Vous devrez également configurer les macros
--target <plate-forme> suivantes :
Pendant la construction du paquetage, interpréter
<plate-forme> comme arch-vendor-os et fixer les
macros _target, _target_arch et _target_os en _signature
Le type de la signature. Actuellement, seule celle
de pgp est supportée. ftp://<utilisa-
teur>:<mot_de_passe>@nom_hôte:<port>/chemin/vers/paque-
_pgp_name tage.rpm
Le nom de l'"utilisateur" dont vous voulez utiliser
la clé pour signer vos paquetages. Si la partie :mot_de_passe est omise, le mot de passe sera
demandé (une seule fois par paire utilisateur/nom_hôte).
Si l'utilisateur et le mot de passe sont omis, le ftp
Pendant la construction de paquetages, vous ajouterez anonyme est utilisé. Dans tous les cas, des transferts
ensuite le signe -- à la ligne de commandes. On vous ftp passifs (PASV) sont utilisés.
demandera votre phrase de passe, et votre paquetage sera
construit et signé. RPM permet d'utiliser les options suivantes avec les URLs
ftp :
Par exemple, pour être capable d'utiliser PGP pour signer
les paquetages en tant qu'utilisateur "John Doe
<jdoe@foo.com>" à partir des key rings situées dans --ftpproxy <nom_hôte>
/etc/rpm/.pgp en utilisant l'exécutable /usr/bin/pgp, vous L'hôte <nom_hôte> sera utilisé comme un serveur
devriez inclure délégué (proxy) pour tous les transferts ftp, ce
qui permet aux utilisateurs d'effectuer des connex-
%_signature pgp ions au travers des gardes-barrière qui utilisent
des systèmes de proxies. Cette option peut égale-
%_pgp_path /etc/rpm/.pgp ment être spécifiée en configurant la macro _ftp-
proxy.
%_pgp_name John Doe <jdoe@foo.com>

%_pgpbin /usr/bin/pgp --ftpport <port>


Le port TCP numéro <port> à utiliser pour les con-
dans un fichier de configuration de macros. Utilisez nexions ftp sur le serveur proxy ftp au lieu du
/etc/rpm/macros pour une configuration par système et port par défaut. Cette option peut également être
~/.rpmmacros pour une configuration par utilisateur. spécifiée en configurant la macro _ftpport.

OPTIONS DE RECONSTRUCTION DE LA BASE DE DONNEES RPM permet d'utiliser les options suivantes avec les URLs
La forme générale d'une commande de reconstruction d'une http :
base de données rpm est

rpm --rebuiddb --httpproxy <nom_hôte>


L'hôte <nom_hôte> sera utilisé comme un serveur
délégué (proxy) pour tous les transferts http.
Pour reconstuire une nouvelle base de données, tapez : Cette option peut également être spécifiée en con-
figurant la macro _httpproxy.
rpm --initdb

--httpport <port>
Les seules options pour ces modes sont --dbchemin et Le port TCP numéro <port> à utiliser pour les con-
--root. nexions http sur le serveur proxy ftp au lieu du
port par défaut. Cette option peut également être
spécifiée en configurant la macro _httpport.
SHOWRC
Lancer

FICHIERS
rpm --showrc /usr/lib/rpm/rpmrc
/etc/rpmrc
~/.rpmrc
montrera les valeurs que va utiliser RPM pour toutes les /usr/lib/rpm/macros
options qui peuvent être fixées dans les fichiers rpmrc. /etc/rpm/macros
~/.rpmmacros
/var/lib/rpm/conflictsindex.rpm
OPTIONS FTP/HTTP /var/lib/rpm/fileindex.rpm
RPM inclut des simples clients FTP et HTTP pour simplifier /var/lib/rpm/groupindex.rpm
l'installation et l'interrogation de paquetages qui sont /var/lib/rpm/nameindex.rpm
disponibles sur internet. Les fichiers de paquetage pour /var/lib/rpm/packages.rpm
l'installation, la mise à niveau et les opérations /var/lib/rpm/providesindex.rpm
d'interrogation peuvent être spécifiés dans une URL du /var/lib/rpm/requiredby.rpm
style ftp ou http : /var/lib/rpm/triggerindex.rpm
/tmp/rpm*
!
découragée, et ses résultats ne sont pas toujours
VOIR AUSSI ce à quoi l'on s'attend.
glint(8) , rpm2cpio(8) , http://www.rpm.org/
-f Ne pas effectuer de fsck en cas de redémarrage.
AUTEURS
Marc Ewing <marc@redhat.com> -F Forcer l'utilisation de fsck en cas de redémarrage.
Jeff Johnson <jbj@redhat.com>
Erik Troan <ewt@redhat.com> -c Annuler un shutdown en cours. Avec cette option,
il n'est évidemment pas possible de donner l'argu-
TRADUCTION ment heure, mais vous pouvez entrer un message
Frédéric Delanoy, 2000. d'explication sur la ligne de commandes qui sera
envoyé à tous les utilisateurs.

heure Quand effectuer le shutdown.

( ' # $ " & ( ' # $ " message-avertissement


Message à envoyer à tous les utilisateurs.

L'argument heure peut avoir différents formats. Primo, il


peut être dans le format absolu hh:mm, dans lequel hh est
NOM l'heure (1 ou 2 chiffres) et mm la minute de l'heure (en
shutdown - Arrêter le système. deux chiffres). Secundo, il peut être au format +m, dans
lequel m est le nombre de minutes à attendre. Le mot now
SYNOPSIS est un synonyme pour +0.
/sbin/shutdown [-t sec] [-arkhncfF] heure [message-aver-
tissement] Si shutdown est appelé avec un délai, il crée le fichier
de recommandation /etc/nologin qui permet à des programmes
DESCRIPTION comme login(1) de refuser des nouvelles connexions d'util-
shutdown arrête le système d'une façon sécurisée. Tous isateurs. Shutdown ne supprime ce fichier que s'il a été
les utilisateurs connectés sont informés que le système va stoppé avant qu'il n'ait informé init (çàd qu'il ait été
s'arrêter, et login(1) est bloqué. Il est possible annulé ou que quelque chose se soit mal passé). Sinon, il
d'arrêter le système immédiatement ou après un certain est de la responsabilité des scripts d'arrêt ou de démar-
délai. En premier lieu, tous les processus sont informés rage du système de supprimer ce fichier de sorte que les
que le système est en train de s'arrêter par le signal utilisateurs puissent à nouveau se connecter.
SIGTERM. Ceci donne le temps à des programmes comme vi(1)
de sauver le fichier en cours d'édition, la chance à des Le drapeau -f signifie `redémarrage rapide'. Ceci crée
programmes de traitement de mails et de nouvelles de se uniquement un fichier de recommandation /fastboot qui peut
terminer proprement, etc. shutdown fait son travail en être testé par le système quand il revient à la vie. Le
donnant l'ordre au processus init de modifier le niveau fichier de démarrage rc peut tester si ce fichier existe,
d'exécution. Le niveau d'exécution 0 est utilisé pour et décider de ne pas lancer fsck(1) puisque le système a
arrêter le système, le niveau d'exécution 6 est utilisé été arrêté d'une manière propre. Après cela, le processus
pour redémarrer le système, et le niveau d'exécution 1 est de démarrage devrait supprimer /fastboot.
utilisé pour mettre le système dans un état où des tâches
administratives peuvent être effectuées; c'est le com- Le drapeau -F signifie `forcer le fsck'. Ceci crée
portement par défaut si ni -h ni -r ne sont donnés comme uniquement un fichier de recommandation /forcefsck qui
option à shutdown. Pour voir quelles actions sont peut être testé par le système quand il revient à la vie.
entreprises durant l'arrêt ou le redémarrage, voyez les Le fichier de démarrage rc peut tester si ce fichier
entrées appropriées pour ces niveaux d'exécution dans le existe, et décider de lancer fsck(1) avec un drapeau
fichier /etc/inittab. spécial d'"obligation" de sorte que même les systèmes de
fichiers démontés proprement sont être vérifiés. Après
OPTIONS cela, le processus de démarrage devrait supprimer /forcef-
-a Utiliser /etc/shutdown.allow. sck.
-t sec Avertir init(8) d'attendre sec secondes entre le Le drapeau -n empêche shutdown d'appeler init, mais lui
moment de l'émission du signal d'avertissement et fait tuer les processus en cours d'exécution lui-même.
celui du signal de fin aux processus, avant shutdown désactive ensuite les quotas, les comptes, et le
d'effectuer un changement de niveau d'exécution. swap et démont tous les systèmes de fichiers.
-k Ne pas réellement s'arrêter; uniquement envoyer les CONTRÔLE D'ACCÈS
messages d'avertissements à tous les processus. shutdown peut être appelé à partir de init(8) quand les
touches magiques CTRL-ALT-DEL sont pressées, en créant une
-r Redémarrer la machine après l'arrêt du système. entrée appropriée dans /etc/inittab. Cela signifie que
tous ceux qui ont un accès physique au clavier de la con-
-h Arrêter la machine après l'arrêt du système. sole peuvent arrêter le système. Pour empêcher cela,
shutdown peut vérifier si un utilisateur autorisé est con-
-n [DÉPRÉCIÉ] Ne pas appeler init(8) mais le faire necté sur une des consoles virtuelles. Si shutdown est
soi-même. L'utilisation de cette option est appelé avec l'argument -a (ajouter cette invocation de
'
shutdown dans /etc/inittab), il vérifie si le fichier
/etc/shutdown.allow est présent. Il compare ensuite les
noms de connexion de ce fichier avec la liste des person-
nes qui sont connectées sur une console virtuelle (à par- ( (
tir de /var/run/utmp). Il ne poursuivera son exécution
que si l'un des utilisateurs autorisés ou root est con-
necté.

Si un des utilisateurs autorisés (ou root) est connecté, NOM


il poursuivera son exécution. Sinon, il affichera le mes- sort - Trier les lignes d'un fichier texte.
sage
SYNOPSIS
shutdown : no authorized users logged in sort [-cmus] [-t séparateur] [-o fichier_de_sortie] [-T
répertoire_temporaire] [-bdfiMnr] [+POS1 [-POS2]] [-k
(çàd aucun utilisateur autorisé connecté) sur la console POS1[,POS2]] [fichier...]
(physique) du système. Le format de /etc/shutdown.allow sort {--help,--version}
est formé d'un nom d'utilisateur par ligne. Les lignes
vides et les commentaires (préfixés par un #) sont permis. DESCRIPTION
Actuellement, il y a une limite de 32 utilisateurs dans ce Cette page de manuel documente la version GNU de sort.
fichier.
sort trie, regroupe ou compare toutes les lignes des
FICHIERS fichiers indiqués. Si aucun fichier n'est fourni, ou si
/fastboot le nom `-' est mentionné, la lecture se fera depuis
/etc/inittab l'entrée standard.
/etc/init.d/halt
/etc/init.d/reboot Par défaut, sort écrit ses résultats sur la sortie stan-
/etc/shutdown.allow dard.

BOGUES sort peut opérer suivant trois modes : tri (par défaut),
Pas vraiment un bogue, mais la plupart des utilisateurs regroupement, et vérification de l'ordre. Les options
oublient de donner l'argument heure et sont ensuite suivantes modifient le mode opératoire :
intrigués par le message d'erreur produit par shutdown.
L'argument heure est obligatoire; dans 90% des cas ce sera -c ([NDT] c = check - vérifier) Vérifie si les
le mot now. fichiers fournis sont déjà triés : s'ils ne le sont
pas, afficher un message d'erreur, et terminer avec
AUTEUR un code de retour valant 1.
Miquel van Smoorenburg, miquels@cistron.nl
-m ([NDT] m = merge - melanger) Regrouper les fichiers
VOIR AUSSI indiqués en les triant. Chaque fichier d'entrée
fsck(8), init(1), halt(8), reboot(8) doit déjà être trié individuellement. Il est tou-
jours possible de trier plutôt que de réunir, le
TRADUCTION regroupement est fourni parce qu'il est plus rapide
Frédéric Delanoy, 2000. dans les cas où il fonctionne.

La comparaison de deux lignes se fait ainsi : Si un champ


clé a été indiqué, sort compare chaque paire de champs,
dans l'ordre précisé sur la ligne de commande, jusqu'à ce
qu'une différence soit trouvée, ou qu'il ne reste plus de
champs.

Si l'une des options globales Mbdfinr est utilisée, et si


aucun champ clé n'est indiqué, sort compare les lignes
entières en fonction des options globales.

Finalement, si toutes les clés sont égales, en dernier


ressort sort compare les lignes octet par octet suivant
l'ordre défini sur la machine. Cette dernière comparaison
accepte l'option globale -r. L'option -s (stable) inhibe
cette comparaison en dernier recours afin que les lignes
considérées comme égales restent à leurs positions rela-
tives. Si aucun champ clé, et aucune option ne sont four-
nis, -s est sans effet.

La version GNU de sort n'a pas de limitation concernant la


longueur des lignes d'entrée ou les caractères autorisés.
De plus, si le dernier octet d'une ligne d'entrée n'est
Linux 22 Août 2000 SHUTDOWN(8) pas un saut de ligne (NewLine), la version GNU de sort en

- &
ajoute un automatiquement. Ceci signifie qu'avec l'entrée ` foo bar', sort
distingue deux champs ` foo' et ` bar'. Le
Si la variable d'environnement TMPDIR est configurée, sort séparateur n'appartient ni au champ précédent, ni
utilise ce répertoire pour stocker les fichiers tempo- au champ suivant.
raires à la place du répertoire par défaut /tmp. L'option
-T répertoire_temporaire permet également de sélectionner -u Pour l'action par défaut, ou pour l'action -m,
un répertoire pour placer les fichiers temporaires, elle a n'afficher que la première séquence de lignes con-
priorité sur la variable d'environnement. sidérées comme égales. Pour l'action -c, vérifier
qu'aucune lignes consécutives ne soient égales.
Les options suivantes affectent l'ordre des lignes de sor-
tie. Elles peuvent être mentionnées globalement, ou +POS1 [-POS2]
appliquées à un champ clé spécifique. Si aucun champ clé Indiquer un champ à utiliser comme clé de tri pour
n'est indiqué, les options globales s'appliquent aux com- chaque ligne. Le champ consiste en une portion de
paraisons des lignes entières, sinon elles sont transmises de ligne débutant à la position POS1, et s'étendant
aux champs clés n'ayant pas d'option spécifique. jusqu'à POS2 non-inclue (ou jusqu'à la fin de la
ligne si POS2 n'est pas mentionnée). Les positions
-b Ignorer les blancs en début de ligne pendant la des champs et des caractères sont numérotées à par-
recherche de la clé de tri sur chaque ligne. tir de 0.

-d Trier dans l'ordre des répertoires téléphoniques : -k POS1[,POS2]


ignorer pour le tri tous les caractères autres que Une autre syntaxe possible pour indiquer les clés
les lettres, les chiffres et les blancs. de tri. Les positions des champs et des caractères
sont numérotées à partir de 1.
-f Considérer les minuscules comme leur équivalent en
majuscule pendant le tri. Ainsi `b' est trie de Une position est de la forme f.c, où f est le numéro du
manière équivalente a `B'. ([NDT] Bien entendu cela champ à utiliser, et c le numéro du premier caractère
ne fonctionne pas avec les minuscules depuis le début du champ (avec +pos) ou depuis la fin du
accentuées...) champ précédent (avec -pos). La partie .c de la position
peut être omise, auquel cas le caractère considéré est le
-i Ignorer pour le tri les caractères en dehors de premier du champ. Si l'option -b est choisie, la partie
l'intervalle ASCII octal 040-0176 (bornes com- .c d'une spécification de champ est comptée à partir du
prises). premier caractère non-blanc du champ (pour +pos) ou à par-
tir du premier caractère non-blanc suivant le champ
-M Une chaîne initiale, consistant en un nombre quel- précédent (pour -pos).
conque de blancs, suivi de trois lettres correspon-
dant à une abreviation de mois est convertie en Un argument +pos ou -pos peut également avoir un préfixe
majuscules avant d'être comparée dans l'ordre `JAN' constitué d'une des lettres d'option Mbdfinr auquel cas
< `FEB' < ... < `DEC.' Les noms invalides sont les options globales ne s'appliquent pas à ce champ.
considéres comme inférieurs aux noms valides. l'option -b peut être attachée indépendament aux parties
([NDT] Qu'en-est-il vis à vis de la localisation ?) +pos ou -pos d'une spécification de champ. Si elle est
héritée d'une option globale, elle s'appliquera aux deux
-n Comparer suivant la valeur arithmétique d'une parties. Si une option -n ou -M est utilisée, ceci
chaîne numérique initiale composée d'espaces implique que l'option -b s'applique aux deux spécifica-
éventuels, suivis optionnellement du signe -, et de tions +pos et -pos. Les clés peuvent s'étendre sur
zéro ou plusieurs chiffres, éventuellement suivi plusieurs champs.
d'un point décimal et de zéro ou plusieurs
chiffres. De plus quand la version GNU de sort est invoquée avec un
seul argument, les options suivantes sont reconnues :
-r Inverser l'ordre de tri, afin que les lignes avec
la plus grande valeur de clé apparaissent en pre- --help Afficher un message d'aide sur la sortie standard
mier. et terminer normalement.

Les autres options sont : --version


Afficher un numéro de version sur la sortie stan-
-o fichier_de_sortie dard et terminer normalement.
Ecrire dans le fichier_de_sortie plutôt que sur la
sortie standard. Si fichier_de_sortie est égale- COMPATIBILITE
ment un fichier d'entrée, sort copie les données Les implémentations historiques (BSD et System V) de sort
dans un fichier temporaire avant le tri pour pou- diffèrent dans leurs interprétations de certaines options,
voir écrire correctement ses résultats dans le notamment -b, -f, et -n. La version GNU suit le comporte-
fichier_de_sortie. ment POSIX, qui est généralement (mais pas toujours) celui
de la version System V. Suivant POSIX -n n'implique plus
-t caractère_séparateur obligatoirement -b. Pour assurer l'homogénéïte, -M a été
Utiliser le caractère_séparateur afin de distinguer modifiée de la même manière. Dans certains cas, assez
les champs pour rechercher la clé de tri sur obscurs, ceci peut affecter la signification des positions
chaque ligne. Par défaut le séparateur de champs de caractères dans les spécifications de champs. Si ceci
est une chaîne blanche entre chaînes non-blanches. vous perturbe, vous pouvez ajouter explicitement un -b.
0 !*
BOGUES [-]cstopb
Les différentes significations des numéros de champs en Utilise deux bits d'arrêt par caractère (un seul
fonction de l'utilisation ou non de l'option -k induit une avec `-').
confusion certaine. C'est la faute à POSIX !
[-]cread
Permet la réception de données.
TRADUCTION
Christophe Blaess, 1997. [-]clocal
Désactive les signaux de contrôle propres aux
modems.

FSF 14 Janvier 1997 SORT(1) [-]crtscts (np)


Active le contrôle de flux RTS/CTS.

Paramètres d'entrée:
( 0 ( 0
[-]ignbrk
Ignorer les signaux breaks.
NOM [-]brkint
stty - Modifier et afficher la configuration de la ligne Un break déclenche un signal d'interruption.
de terminal.
[-]ignpar
SYNOPSIS Ignorer les erreurs de parité.
stty [configuration...]
stty {-a,--all,-g,--help,--save,--version} [-]parmrk
Signaler les erreurs de parité par une séquence
DESCRIPTION 255-0-caractère.
Cette page de manuel documente la version GNU de stty.
[-]inpck
Si aucun argument n'est fourni, stty affiche la vitesse de Active la vérification de parité.
communication, le numéro de discipline de ligne (sur les
systèmes le supportant) et les éléments de configuration [-]istrip
modifiés par rapport aux valeurs fixées par `stty sane'. Effacer le bit de poids fort (8ième) des caractères
en entrée.
La configuration en question est celle de la ligne tty
connectée sur l'entrée standard. [-]inlcr
Traduire les Sauts-de-ligne (NewLine) en Retours-
stty accepte les arguments suivants, qui modifient le com- Chariots (Carriage Return).
portement de la ligne.
[-]igncr
Un `[-]' devant un argument signifie que l'on peut Ignorer les Retours-Chariot (Carriage Return).
l'inhiber en le faisant précéder d'un `-'. Certains argu-
ments ne sont pas disponibles sur tous les systèmes, car [-]icrnl
il s'agit d'extensions non-POSIX. Ils sont indiqués par Traduire les Retours-Chariots (Carriage Return) en
`(np)'. Sauts-de-ligne (NewLine).
Paramètres de controle : [-]ixon
Activer le controle de flux XON/XOFF.
[-]parenb [-]ixoff [-]tandem
Transmet un bit de parité en sortie, et en attend Activer l'émission d'un caractère d'arrêt lorsque
un en entrée. le buffer d'entrée est presque plein, et d'un car-
actère de redémarrage lorsqu'il est à nouveau vide
[-]parodd
Indique une parite impaire (paire si précéde de [-]iuclc (np)
`-'). Convertir les majuscules en minuscules.
cs5 cs6 cs7 cs8 [-]ixany (np)
Indique une taille de caractère de 5, 6, 7, ou 8 Permet l'utilisation de n'importe quel caractère
bits. pour redémarrer la sortie (si l'on utilise `-',
seul le caractère Start sera actif).
[-]hupcl [-]hup
Envoie un signal de déconnexion (Hangup) lorsque le [-]imaxbel (np)
dernier processus referme la ligne tty. Valider l'émission d'un signal sonore lorsqu'un
! !
caractère arrive alors que le buffer d'entrée est Valider les caractères spéciaux non-Posix.
plein, dans ce cas le buffer n'est pas purgé.
[-]echo
Paramètres de sortie : Activer l'écho des caractères saisis.

[-]echoe, [-]crterase
[-]opost Effectuer l'écho du caractère d'effacement sous
Postprocess output ([NDT] ???). forme BackSpace-Espace-BackSpace.

[-]olcuc (np) [-]echok


Traduire les minuscules en majuscules ([NDT] Ceci Ajouter l'écho d'un Saut-de-Ligne (NewLine) après
ne fonctionne pas avec les caractères accentués...) le caractère Kill.

[-]ocrnl (np) [-]echonl


Convertir les Retours-Chariot (Carriage Return) en Effectuer l'écho des Sauts-de-Ligne (NewLine) même
Sauts-de-ligne (Newline). si l'écho des autres caractères est désactive.

[-]onlcr (np) [-]noflsh


Convertir les Sauts-de-ligne (Newline) en Retours- Désactiver la purge du buffer après les caractères
Chariot (Carriage Return). spéciaux Interrupt et Quit.

[-]onocr (np) [-]xcase (np)


Ne pas afficher les Retours-Chariots en première Activer l'entrée et la sortie de caractères majus-
colonne. cules en faisant précéder leur équivalent minuscule
par `\', si l'option ICANNON est active.
[-]onlret (np)
Ajouter un Retour-Chariot au Saut-de-ligne. [-]tostop (np)
Arrêter les travaux en arrière-plan qui tentent
[-]ofill (np) d'écrire sur leur terminal.
Utiliser des caractères de remplissage plutôt que
des délais d'attente. [-]echoprt [-]prterase (np)
Effectuer l'écho des caractères effacés entre `\'
[-]ofdel (np) et '/'.
Utiliser l'effacement (Delete) comme caractère de
remplissage, à la place du caractère Null. [-]echoctl [-]ctlecho (np)
Afficher l'écho des caractères de contrôle avec la
nl1 nl0 (np) notation (`^c') plutôt que sous leur forme
Type de délai pour le Saut-de-ligne. littérale.

cr3 cr2 cr1 cr0 (np) [-]echoke [-]crtkill (np)


Type de délai pour le Retour-chariot. Effectuer l'écho du caractère spécial Kill en
effaçant chaque caractère sur la ligne comme
tab3 tab2 tab1 tab0 (np) indiqué par les paramètres Echoprt et Echoe, à la
Type de délai pour la Tabulation horizontale. place des paramètres Echoctl et Echok.

bs1 bs0 (np) Paramètres combinés :


Type de délai pour le Retour en arrière
(BackSpace).
[-]evenp [-]parity
vt1 vt0 (np) Identique à parenb -parodd cs7. Avec `-', iden-
Type de délai pour la Tabulation verticale. tique à -parenb cs8.

ff1 ff0 (np) [-]oddp


Type de délai pour le Saut-de-page (Form Feed). Identique à parenb parodd cs7. Avec `-', identique
à -parenb cs8.
Paramètres locaux :
[-]nl Identique à -icrnl -onlcr. Avec `-', identique à
icrnl -inlcr -igncr onlcr -ocrnl -onlret.
[-]isig
Valider les caractères spéciaux Interrupt, Quit, et ek Réinitialise les caractères spéciaux Erase et Kill
Suspend. à leurs valeurs par défaut.

[-]icanon sane Identique à cread -ignbrk brkint -inlcr -igncr


Valider les caractères spéciaux Erase, Kill, icrnl -ixoff -iuclc -ixany imaxbel opost -olcuc
Werase, et Rprnt. -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0
tab0 bs0 vt0 ff0 isig icanon iexten echo echoe
[-]iexten echok -echonl -noflsh -xcase -tostop -echoprt
! !!
echoctl echoke. Réinitialise également tous les eol2 (np)
caractères de contrôle à leurs valeurs par défaut. Autre caractère pour terminer la ligne.

[-]cooked swtch (np)


Identique à brkint ignpar istrip icrnl ixon opost Basculer à un autre niveau de shell.
isig icanon. Réinitialise également les caractères
Eof et Eol à leurs valeurs par défaut si ce sont start Redémarrage de la sortie après un arrêt.
les mêmes que les caractères Min et Time (voir plus
bas). Avec `-', identique à raw. stop Arrêt de la sortie.

[-]raw Identique à -ignbrk -brkint -ignpar -parmrk -inpck susp Emission d'un signal Terminal Stop
-istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc
-ixany -imaxbel -opost -isig -icanon -xcase min 1 dsusp (np)
time 0. Avec `-', identique à cooked. Emission d'un signal Terminal Stop après avoir vidé
le buffer d'entrée.
[-]cbreak
Identique à -icanon. rprnt (np)
Réafficher la ligne en cours.
[-]pass8
Identique à -parenb -istrip cs8. avec `-', iden- werase (np)
tique à parenb istrip cs7. Effacement du dernier mot saisi.

[-]litout lnext (np)


Identique à -parenb -istrip -opost cs8. Avec `-', Lire le caractère suivant littéralement, même s'il
Identique à parenb istrip opost cs7. s'agit d'un caractère spécial.

[-]decctlq (np) Paramètres spéciaux :


Identique à -ixany.

[-]tabs (np) min N Lorsque -icanon est configuré, indique le nombre


Identique à tab0. Avec `-', identique à tab3. minimal de caractères à lire pendant la durée
`time' avant que la lecture n'échoue.
[-]lcase [-]LCASE (np)
Identique à xcase iuclc olcuc. time N Lorsque -icanon est configuré, indique la durée (en
dixièmes de secondes) pour lire `min' caractères
crt Identique à echoe echoctl echoke. avant que la lecture n'échoue.

dec Identique à echoe echoctl echoke -ixany. Configure ispeed N


également les caractères spéciaux Interrupt avec la Configure la vitesse d'entrée à la valeur N
valeur Ctrl-C, Erase avec Del, et Kill avec Ctrl-U.
ospeed N
Caractères spéciaux : Configure la vitesse de sortie à la valeur N

rows N (np)
Les valeurs par défaut des caractères spéciaux varient Indique au noyau que le terminal dispose de N
suivant les systèmes. Ils sont configurés en utilisant la lignes.
syntaxe `nom valeur'. Les noms sont indiqués ci-dessous,
et les valeurs peuvent être fournies soit littéralement en cols N columns N (np)
utilisant la notation (`^c'), soit avec un entier commen- Indique au noyau que le terminal dispose de N
cant par `0x' pour une valeur héxadécimale, `0' pour une colonnes.
valeur octale, ou tout autre chiffre pour une valeur
décimale. Indiquer la valeur `^-' ou `undef' permet de size (np)
désactiver le caractère spécial. Affiche le nombre de lignes et de colonnes dont
dispose le terminal selon les informations fournies
par le noyau. Les systèmes ne permettant pas la
intr Envoie le signal Intr. configuration de rows et cols dans le noyau
utilisent généralement les variables d'environ-
quit Envoie le signal Quit. nement LINES et COLUMNS à la place. Toutefois, la
version GNU de stty ne les utilise pas.
erase Efface le dernier caractère saisi.
line N (np)
kill Efface la ligne en cours. Utiliser la discipline de ligne N.

eof Signale une fin de fichier (terminer la saisie). speed Affiche la vitesse du terminal.

eol Fin de ligne. N Fixe les vitesses d'entrée et de sortie à la valeur


N. N peut prendre les valeurs suivantes : 0 50 75
! !'
110 134 134.5 150 200 300 600 1200 1800 2400 4800 (celui du Super-Utilisateur).
9600 19200 38400 exta extb. exta est equivalent a
19200, extb a 38400. 0 raccroche la ligne si -clo- Par défaut, su ne change pas de répertoire. Il positionne
cal est configuré. les variables d'environnement `HOME' et `SHELL' à partir
des valeurs lues dans le fichier des mots de passe, et si
OPTIONS l'utilisateur demandé n'est pas root, renseigne les vari-
-a, --all ables `USER' et `LOGNAME'. Par défaut le shell exécuté
Afficher la configuration en cours de manière lisi- n'est pas un shell de connexion.
ble humainement.
Si un ou plusieurs arguments sont fournis, ils sont trans-
--help Afficher un message d'aide sur la sortie standard mis comme arguments supplémentaires au shell.
et terminer normalement.
su ne gère pas spécifiquement /bin/sh ou tout autre shell
-g, --save (en positionnant argv[0] a "-su", en transmettant la com-
Afficher la configuration en cours de manière util- mande -c seulement à certains shells, etc...)
isable comme argument pour une autre commande stty
qui restituera le même paramètrage. Sur les systèmes disposant de la journalisation syslog, su
peut être compilé afin de fournir des rapports d'échec, et
--version éventuellement de réussite des tentatives d'utilisation de
Afficher un numéro de version sur la sortie stan- su.
dard et terminer normalement.
Ce programme ne gère pas le "groupe wheel" utilisé pour
restreindre l'accès par su au compte Super-Utilisateur,
TRADUCTION car il pourrait aider des administrateurs systèmes fas-
Christophe Blaess, 1997. cistes à disposer d'un pouvoir incontrôlé sur les autres
utilisateurs.

OPTIONS
FSF 7 Janvier 1997 STTY(1L) -c COMMANDE, --command=COMMANDE
Transmet la COMMANDE (sur une seule ligne) au shell
avec l'option -c plutot que démarrer un shell
interactif.
(' (' -f, --fast
Transmet l'argument -f au shell. Ceci n'a proba-
blement de signification que pour csh et tcsh, pour
lesquels l'option -f évite la lecture du fichier de
NOM démarrage (.cshrc). Avec les shells de type Bourne,
su - Executer un shell avec un User-ID et un Group-ID l'option -f désactive le développement des motifs
différents. génériques dans les noms de fichiers, ce qui n'est
généralement pas le but recherché.
SYNOPSIS
su [-flmp] [-c commande] [-s shell] [--login] [--fast] --help Afficher un message d'aide sur la sortie standard
[--preserve-environment] [--command=commande] et terminer normalement.
[--shell=shell] [-] [--help] [--version] [utilisateur
[arg...]] -, -l, --login
Appelle le shell sous forme de shell de connexion.
DESCRIPTION Voici ce que cela signifie : Invalider toutes les
Cette page de manuel documente la version GNU de su. variables d'environnement sauf `TERM', `HOME', et
`SHELL' (qui sont renseignées comme décrit ci-
su permet à un utilisateur de se transformer temporaire- dessus), ainsi que `USER' et `LOGNAME' (qui sont
ment en un autre utilisateur. alors remplies même pour le Super-Utilisateur).
Remplir `PATH' avec une valeur par défaut donnée
Un shell est exécute avec les UID, GID effectifs et réels, lors de la compilation. Se déplacer dans le réper-
ainsi que les groupes supplémentaires de l'utilisateur toire HOME de l'utilisateur. Ajouter "-" au nom du
indiqué. shell, pour que celui-ci lise son ou ses fichiers
de démarrage.
Si aucun nom d'utilisateur n'est mentionné, le nom root,
le Super-Utilisateur, est utilisé par défaut. -m, -p, --preserve-environment
Ne pas changer les variables d'environnement
Le shell exécuté est celui mentionné dans l'enregistrement `HOME', `USER', `LOGNAME', et `SHELL'. Executer le
correspondant à l'utilisateur dans le fichier /etc/passwd. shell correspondant à la variable d'environnement
Si aucun shell n'y est indiqué, /bin/sh est exécuté par `SHELL' plutot que celui présent dans l'enreg-
défaut. istrement /etc/passwd de l'utilisateur, à moins que
ce dernier ait un shell restreint, et que
Si l'utilisateur dispose d'un mot de passe, su le réclame, l'appelant ne soit pas le Super-Utilisateur. Un
à moins qu'il n'ait été invoque avec un UID réel valant 0 shell est restreint s'il n'est pas dans la liste
!- !&
/etc/shells, ou dans une liste fournie lors de la
compilation si ce dernier fichier n'existe pas. Le AUTHOR
comportement de cette option peut être partielle- Written by Jim Meyering.
ment modifiée avec les options --login et --shell.
REPORTING BUGS
-s, --shell shell Report bugs to <bug-fileutils@gnu.org>.
Exécute le shell indiqué plutôt que celui présent
dans l'enregistrement /etc/passwd de l'utilisateur, COPYRIGHT
à moins que ce dernier ait un shell restreint, et Copyright (C) 2001 Free Software Foundation, Inc.
que l'appelant ne soit pas le Super-Utilisateur. This is free software; see the source for copying condi-
tions. There is NO warranty; not even for MERCHANTABILITY
--version or FITNESS FOR A PARTICULAR PURPOSE.
Afficher un numéro de version sur la sortie stan-
dard et terminer normalement. SEE ALSO
The full documentation for sync is maintained as a Texinfo
manual. If the info and sync programs are properly
Pourquoi GNU SU ne gère-t-il pas le groupe `wheel' (par Richard installed at your site, the command
Stallman)
Il peut arriver qu'un petit groupe d'utilisateurs essayent info sync
de s'approprier l'ensemble du système. Par exemple, en
1984, quelques utilisateurs du laboratoire d'I.A du MIT should give you access to the complete manual.
ont tentés de prendre le pouvoir en modifiant le mot de
passe de l'opérateur sur le système Twenex, et en gardant
ce mot de passe secret. (J'ai pu les en empêcher en modi-
fiant le noyau, et restaurer ainsi les autres accès, mais sync (fileutils) 4.1 April 2001 SYNC(1)
je ne saurais pas en faire autant sous Unix).

Néanmoins, il arrive parfois que les chefs fournissent le


mot de passe de root à un utilisateur ordinaire. Avec le (0( #" (/ & & * (0( #"
mécanisme habituel de su, une fois que quelqu'un connaît
ce mot de passe, il peut le transmettre à ses amis. Le
principe du "groupe wheel" rend ce partage impossible, ce
qui renforce la puissance des chefs.
NAME
Je me situe du cote du peuple, pas du côté des chefs. Si sysklogd - Linux system logging utilities.
vous avez l'habitude de soutenir les patrons et les admin-
istrateurs systèmes quoi qu'ils fassent, cette idée peut SYNOPSIS
vous paraître étrange au premier abord. syslogd [ -a socket ] [ -d ] [ -f config file ] [ -h ] [
-l hostlist ] [ -m interval ] [ -n ] [ -p socket ] [ -r ]
[ -s domainlist ] [ -v ] [ -x ]
TRADUCTION
Christophe Blaess, 1997.
DESCRIPTION
Sysklogd provides two system utilities which provide sup-
port for system logging and kernel message trapping. Sup-
FSF 7 Janvier 1997 SU(1L) port of both internet and unix domain sockets enables this
utility package to support both local and remote logging.

System logging is provided by a version of syslogd(8)


derived from the stock BSD sources. Support for kernel
(0 !(! (0 logging is provided by the klogd(8) utility which allows
kernel logging to be conducted in either a standalone
fashion or as a client of syslogd.

NAME Syslogd provides a kind of logging that many modern pro-


sync - flush filesystem buffers grams use. Every logged message contains at least a time
and a hostname field, normally a program name field, too,
SYNOPSIS but that depends on how trusty the logging program is.
sync [OPTION]
While the syslogd sources have been heavily modified a
DESCRIPTION couple of notes are in order. First of all there has been
Force changed blocks to disk, update the super block. a systematic attempt to insure that syslogd follows its
default, standard BSD behavior. The second important con-
--help display this help and exit cept to note is that this version of syslogd interacts
transparently with the version of syslog found in the
--version standard libraries. If a binary linked to the standard
output version information and exit shared libraries fails to function correctly we would like

!0 *
an example of the anomalous behavior. behavior is the opposite of how older versions
behave, so you might have to turn this on.
The main configuration file /etc/syslog.conf or an alter-
native file, given with the -f option, is read at startup. -s domainlist
Any lines that begin with the hash mark (``#'') and empty Specify a domainname that should be stripped off
lines are ignored. If an error occurs during parsing the before logging. Multiple domains may be specified
whole line is ignored. using the colon (``:'') separator. Please be
advised that no sub-domains may be specified but
only entire domains. For example if -s north.de is
specified and the host logging resolves to
OPTIONS satu.infodrom.north.de no domain would be cut, you
-a socket will have to specify two domains like: -s
Using this argument you can specify additional north.de:infodrom.north.de.
sockets from that syslogd has to listen to. This
is needed if you're going to let some daemon run -v Print version and exit.
within a chroot() environment. You can use up to
19 additional sockets. If your environment needs -x Disable name lookups when receiving remote mes-
even more, you have to increase the symbol MAXFUNIX sages. This avoids deadlocks when the nameserver
within the syslogd.c source file. An example for a is running on the same machine that runs the syslog
chroot() daemon is described by the people from daemon.
OpenBSD at http://www.psionic.com/papers/dns.html.

-d Turns on debug mode. Using this the daemon will SIGNALS


not proceed a fork(2) to set itself in the back- Syslogd reacts to a set of signals. You may easily send a
ground, but opposite to that stay in the foreground signal to syslogd using the following:
and write much debug information on the current
tty. See the DEBUGGING section for more informa- kill -SIGNAL `cat /var/run/syslogd.pid`
tion.

-f config file SIGHUP This lets syslogd perform a re-initialization. All


Specify an alternative configuration file instead open files are closed, the configuration file
of /etc/syslog.conf, which is the default. (default is /etc/syslog.conf) will be reread and
the syslog(3) facility is started again.
-h By default syslogd will not forward messages it
receives from remote hosts. Specifying this switch SIGTERM
on the command line will cause the log daemon to The syslogd will die.
forward any remote messages it receives to forward-
ing hosts which have been defined. SIGINT, SIGQUIT
If debugging is enabled these are ignored, other-
-l hostlist wise syslogd will die.
Specify a hostname that should be logged only with
its simple hostname and not the fqdn. Multiple SIGUSR1
hosts may be specified using the colon (``:'') sep- Switch debugging on/off. This option can only be
arator. used if syslogd is started with the -d debug
option.
-m interval
The syslogd logs a mark timestamp regularly. The SIGCHLD
default interval between two -- MARK -- lines is 20 Wait for childs if some were born, because of
minutes. This can be changed with this option. wall'ing messages.
Setting the interval to zero turns it off entirely.

-n Avoid auto-backgrounding. This is needed espe- CONFIGURATION FILE SYNTAX DIFFERENCES


cially if the syslogd is started and controlled by Syslogd uses a slightly different syntax for its configu-
init(8). ration file than the original BSD sources. Originally all
messages of a specific priority and above were forwarded
-p socket to the log file.
You can specify an alternative unix domain socket
instead of /dev/log. For example the following line caused ALL output
from daemons using the daemon facilities (debug is
-r This option will enable the facility to receive the lowest priority, so every higher will also
message from the network using an internet domain match) to go into /usr/adm/daemons:
socket with the syslog service (see services(5)).
The default is to not receive any messages from the # Sample syslog.conf
network. daemon.debug /usr/adm/daemons

This option is introduced in version 1.3 of the Under the new scheme this behavior remains the same. The
sysklogd package. Please note that the default difference is the addition of four new specifiers, the
asterisk (*) wildcard, the equation sign (=), the exclama- command line. The default behavior is that syslogd won't
tion mark (!), and the minus sign (-). listen to the network.

The * specifies that all messages for the specified facil- The strategy is to have syslogd listen on a unix domain
ity are to be directed to the destination. Note that this socket for locally generated log messages. This behavior
behavior is degenerate with specifying a priority level of will allow syslogd to inter-operate with the syslog found
debug. Users have indicated that the asterisk notation is in the standard C library. At the same time syslogd lis-
more intuitive. tens on the standard syslog port for messages forwarded
from other hosts. To have this work correctly the ser-
The = wildcard is used to restrict logging to the speci- vices(5) files (typically found in /etc) must have the
fied priority class. This allows, for example, routing following entry:
only debug messages to a particular logging source.
syslog 514/udp
For example the following line in syslog.conf would
direct debug messages from all sources to the If this entry is missing syslogd neither can receive
/usr/adm/debug file. remote messages nor send them, because the UDP port cant
be opened. Instead syslogd will die immediately, blowing
# Sample syslog.conf out an error message.
*.=debug /usr/adm/debug
To cause messages to be forwarded to another host replace
The ! is used to exclude logging of the specified priori- the normal file line in the syslog.conf file with the name
ties. This affects all (!) possibilities of specifying of the host to which the messages is to be sent prepended
priorities. with an @.

For example the following lines would log all mes- For example, to forward ALL messages to a remote
sages of the facility mail except those with the host use the following syslog.conf entry:
priority info to the /usr/adm/mail file. And all
messages from news.info (including) to news.crit # Sample syslogd configuration file to
(excluding) would be logged to the /usr/adm/news # messages to a remote host forward all.
file. *.* @hostname

# Sample syslog.conf To forward all kernel messages to a remote host the


mail.*;mail.!=info /usr/adm/mail configuration file would be as follows:
news.info;news.!crit /usr/adm/news
# Sample configuration file to forward all kernel
You may use it intuitively as an exception specifier. The # messages to a remote host.
above mentioned interpretation is simply inverted. Doing kern.* @hostname
that you may use

mail.none If the remote hostname cannot be resolved at startup,


or because the name-server might not be accessible (it may be
mail.!* started after syslogd) you don't have to worry. Syslogd
or will retry to resolve the name ten times and then com-
mail.!debug plain. Another possibility to avoid this is to place the
hostname in /etc/hosts.
to skip every message that comes with a mail facility.
There is much room to play with it. :-) With normal syslogds you would get syslog-loops if you
send out messages that were received from a remote host to
The - may only be used to prefix a filename if you want to the same host (or more complicated to a third host that
omit sync'ing the file after every write to it. sends it back to the first one, and so on). In my domain
(Infodrom Oldenburg) we accidently got one and our disks
This may take some acclimatization for those individuals filled up with the same single message. :-(
used to the pure BSD behavior but testers have indicated
that this syntax is somewhat more flexible than the BSD To avoid this in further times no messages that were
behavior. Note that these changes should not affect stan- received from a remote host are sent out to another (or
dard syslog.conf(5) files. You must specifically modify the same) remote host anymore. If there are scenarios
the configuration files to obtain the enhanced behavior. where this doesn't make sense, please drop me (Joey) a
line.

SUPPORT FOR REMOTE LOGGING If the remote host is located in the same domain as the
These modifications provide network support to the syslogd host, syslogd is running on, only the simple hostname will
facility. Network support means that messages can be for- be logged instead of the whole fqdn.
warded from one node running syslogd to another node run-
ning syslogd where they will be actually logged to a disk In a local network you may provide a central log server to
file. have all the important information kept on one machine.
If the network consists of different domains you don't
To enable this you have to specify the -r option on the have to complain about logging fully qualified names
!
instead of simple hostnames. You may want to use the ets will of course expose a system to risks outside of
strip-domain feature -s of this server. You can tell the programs or individuals on the local machine.
syslogd to strip off several domains other than the one
the server is located in and only log simple hostnames. There are a number of methods of protecting a machine:

Using the -l option there's also a possibility to define 1. Implement kernel firewalling to limit which hosts
single hosts as local machines. This, too, results in or networks have access to the 514/UDP socket.
logging only their simple hostnames and not the fqdns.
2. Logging can be directed to an isolated or non-root
The UDP socket used to forward messages to remote hosts or filesystem which, if filled, will not impair the
to receive messages from them is only opened when it is machine.
needed. In releases prior to 1.3-23 it was opened every
time but not opened for reading or forwarding respec- 3. The ext2 filesystem can be used which can be con-
tively. figured to limit a certain percentage of a filesys-
tem to usage by root only. NOTE that this will
require syslogd to be run as a non-root process.
OUTPUT TO NAMED PIPES (FIFOs) ALSO NOTE that this will prevent usage of remote
This version of syslogd has support for logging output to logging since syslogd will be unable to bind to the
named pipes (fifos). A fifo or named pipe can be used as 514/UDP socket.
a destination for log messages by prepending a pipy symbol
(``|'') to the name of the file. This is handy for debug- 4. Disabling inet domain sockets will limit risk to
ging. Note that the fifo must be created with the mkfifo the local machine.
command before syslogd is started.
5. Use step 4 and if the problem persists and is not
The following configuration file routes debug mes- secondary to a rogue program/daemon get a 3.5 ft
sages from the kernel to a fifo: (approx. 1 meter) length of sucker rod* and have a
chat with the user in question.
# Sample configuration to route kernel debugging
# messages ONLY to /usr/adm/debug which is a Sucker rod def. -- 3/4, 7/8 or 1in. hardened steel
# named pipe. rod, male threaded on each end. Primary use in the
kern.=debug |/usr/adm/debug oil industry in Western North Dakota and other
locations to pump 'suck' oil from oil wells. Sec-
ondary uses are for the construction of cattle feed
INSTALLATION CONCERNS lots and for dealing with the occasional recalci-
There is probably one important consideration when trant or belligerent individual.
installing this version of syslogd. This version of sys-
logd is dependent on proper formatting of messages by the
syslog function. The functioning of the syslog function DEBUGGING
in the shared libraries changed somewhere in the region of When debugging is turned on using -d option then syslogd
libc.so.4.[2-4].n. The specific change was to null-termi- will be very verbose by writing much of what it does on
nate the message before transmitting it to the /dev/log stdout. Whenever the configuration file is reread and re-
socket. Proper functioning of this version of syslogd is parsed you'll see a tabular, corresponding to the internal
dependent on null-termination of the message. data structure. This tabular consists of four fields:

This problem will typically manifest itself if old stati- number This field contains a serial number starting by
cally linked binaries are being used on the system. Bina- zero. This number represents the position in the
ries using old versions of the syslog function will cause internal data structure (i.e. the array). If one
empty lines to be logged followed by the message with the number is left out then there might be an error in
first character in the message removed. Relinking these the corresponding line in /etc/syslog.conf.
binaries to newer versions of the shared libraries will
correct this problem. pattern
This field is tricky and represents the internal
Both the syslogd(8) and the klogd(8) can either be run structure exactly. Every column stands for a
from init(8) or started as part of the rc.* sequence. If facility (refer to syslog(3)). As you can see,
it is started from init the option -n must be set, other- there are still some facilities left free for for-
wise you'll get tons of syslog daemons started. This is mer use, only the left most are used. Every field
because init(8) depends on the process ID. in a column represents the priorities (refer to
syslog(3)).

SECURITY THREATS action This field describes the particular action that
There is the potential for the syslogd daemon to be used takes place whenever a message is received that
as a conduit for a denial of service attack. Thanks go to matches the pattern. Refer to the syslog.conf(5)
John Morrison (jmorriso@rflab.ee.ubc.ca) for alerting me manpage for all possible actions.
to this potential. A rogue program(mer) could very easily
flood the syslogd daemon with syslog messages resulting in arguments
the log files consuming all the remaining space on the This field shows additional arguments to the
filesystem. Activating logging over the inet domain sock- actions in the last field. For file-logging this
'
is the filename for the logfile; for user-logging
this is a list of users; for remote logging this is Version 1.3 12 October 1998 SYSKLOGD(8)
the hostname of the machine to log to; for console-
logging this is the used console; for tty-logging
this is the specified tty; wall has no additional
arguments.

FILES
/etc/syslog.conf
Configuration file for syslogd. See syslog.conf(5)
for exact information. NOM
/dev/log tail - Afficher la dernière partie d'un fichier.
The Unix domain socket to from where local syslog
messages are read. SYNOPSIS
/var/run/syslogd.pid tail [-c [+]N[bkm]] [-n [+]N] [-fqv] [--bytes=[+]N[bkm]]
The file containing the process id of syslogd. [--lines=[+]N] [--follow] [--quiet] [--silent] [--verbose]
[--help] [--version] [fichier...]
BUGS
If an error occurs in one line the whole rule is ignored. tail [{-,+}Nbcfklmqv] [fichier...]

Syslogd doesn't change the filemode of opened logfiles at DESCRIPTION


any stage of process. If a file is created it is world Cette page de manuel documente la version GNU de tail
readable. If you want to avoid this, you have to create ([NDT] tail = queue).
it and change permissions on your own. This could be done
in combination with rotating logfiles using the savelog(8) tail affiche la dernière partie (par défaut : 10 lignes)
program that is shipped in the smail 3.x distribution. de chacun des fichiers indiqués.
Remember that it might be a security hole if everybody is
able to read auth.* messages as these might contain pass- Si aucun fichier n'est fourni, ou si le nom `-' est men-
words. tionné, la lecture se fera depuis l'entrée standard.

Si plusieurs fichiers sont fournis, un en-tête est affiché


SEE ALSO avant chaque fichier contenant son nom encadré par `==>'
syslog.conf(5), klogd(8), logger(1), syslog(2), syslog(3), et `<=='.
services(5), savelog(8)
La version GNU de tail peut afficher n'importe quelle
quantité de données, contrairement à la version UNIX qui
COLLABORATORS utilise un buffer de taille fixe.
Syslogd is taken from BSD sources, Greg Wettstein
(greg@wind.enjellic.com) performed the port to Linux, Mar- Elle ne dispose pas pas d'option -r (afficher à l'envers).
tin Schulze (joey@linux.de) fixed some bugs and added sev- Imprimer un fichier à l'envers est un travail n'ayant rien
eral new features. Klogd was originally written by Steve à voir avec l'affichage de sa fin. La version BSD de tail
Lord (lord@cray.com), Greg Wettstein made major improve- ne peut imprimer à l'envers que des fichiers tenant dans
ments. son buffer, qui à generalement la taille de 32 Ko. Une
manière beaucoup plus fiable et souple d'inverser un
Dr. Greg Wettstein fichier est d'utiliser la commande GNU tac.
Enjellic Systems Development
Oncology Research Division Computing Facility OPTIONS
Roger Maris Cancer Center tail accepte deux formats d'options différents. Le nouveau
Fargo, ND format dans lequel les nombres sont des arguments précédés
greg@wind.enjellic.com par les lettres représentant des options, et l'ancien for-
mat dans lequel un `+' ou un `-' est suivi d'un nombre
Stephen Tweedie puis d'une lettre d'option.
Department of Computer Science
Edinburgh University, Scotland Si un nombre (`N') est précédé de `+', tail commence
sct@dcs.ed.ac.uk l'affichage à partir du Nième élément en partant du début
du fichier (au lieu de la fin).
Juha Virtanen
jiivee@hut.fi -c N, --bytes N
Afficher N octets. N est un entier non nul,
Shane Alderton éventuellement suivi d'un caractère indiquant une
shane@ion.apana.org.au unité différente :

Martin Schulze b blocs de 512 octets.


Infodrom Oldenburg
joey@linux.de k blocs de 1 Ko.

m blocs de 1 Mo.

- &
] [ -Z, --compress, --uncompress ] [ -z, --gzip,
-f, --follow --ungzip ] [ --use-compress-program PROG ] [ --block-
Boucler indéfiniment, en essayant de lire de plus compress ] [ -[0-7][lmh] ]
en plus de caractères à la fin du fichier, celui-ci
devant grandir. Cette option est ignorée si la filename1 [ filename2, ... filenameN ]
lecture se fait depuis un tube (pipe). Si plusieurs
fichiers d'entrée sont indiqués tail affiche un en- directory1 [ directory2, ...directoryN ]
tête dès qu'un fichier est modifié, pour montrer
celui qui est imprimé. DESCRIPTION
Voici la pages de manuel de la version GNU de tar, un pro-
-l, -n N, --lines N gramme de gestion d'archive utilisé pour créer et restau-
Afficher N lignes. -l n'est reconnu que dans rer des fichiers à partir d'une archive connue sous le nom
l'ancien format d'options. tarfile. Un fichier tarfile peut être sur un lecteur de
bande, cependant il est possible de produire un fichier
-q, --quiet, --silent tarfile comme un fichier normal. Le première argument de
Ne jamais afficher l'en-tête avec le nom du fichier tar doit être obligatoirement une de ces lettres: Acdrtux,
suivis par n'importe quelles fonctions optionnelles. Les
-v, --verbose arguments finaux de tar sont les noms des fichiers ou des
Toujours afficher l'en-tête avec le nom du fichier répertoires qui doivent être archivés. L'utilisation d'un
nom de répertoire implique toujours que les sous-réper-
--help Afficher un message d'aide sur la sortie standard toires seront inclus dans l'archive.
et terminer normalement.
OPTIONS PRINCIPALES
--version Il faut obligatoirement utiliser l'une des options suiv-
Afficher un numéro de version sur la sortie stan- antes :
dard et terminer normalement.
-A, --catenate, --concatenate
ajouter des fichiers à une archive.
TRADUCTION
Christophe Blaess, 1997. -c, --create
créer une nouvelle archive.

-d, --diff, --compare


FSF 14 Janvier 1997 TAIL(1) trouver les différence entre une archive et les
fichiers indiqués.

--delete
supprimer des fichiers d'une archive. (à ne pas
utiliser avec les lecteurs de bandes!)

-r, --append
ajouter des fichiers à la fin d'une archive.
NOM
tar - la version GNU de l'utilitaire tar de gestion -t, --list
d'archives. liste le contenu d'une archive.
SYNOPSIS -u, --update
tar [ - ] A --catenate --concatenate | c --create | d ajoute seulement les fichiers qui sont plus récents
--diff --compare | r --append | t --list | u --update | x que ceux de l'archive.
-extract --get [ --atime-preserve ] [ -b, --block-size N ]
[ -B, --read-full-blocks ] [ -C, --directory DIR ] [ -x, --extract, --get
--checkpoint ] [ -f, --file [HOSTNAME:]F ] [ --force- restaure les fichiers contenus dans une archive.
local ] [ -F, --info-script F --new-volume-script F ] [
-G, --incremental ] [ -g, --listed-incremental F ] [ -h, AUTRES OPTIONS
--dereference ] [ -i, --ignore-zeros ] [ --ignore-failed- --atime-preserve
read ] [ -k, --keep-old-files ] [ -K, --starting-file F ] ne modifie pas les dates d'accés des fichiers de
[ -l, --one-file-system ] [ -L, --tape-length N ] [ -m, l'archive.
--modification-time ] [ -M, --multi-volume ] [ -N,
--after-date DATE, --newer DATE ] [ -o, --old-archive, -b, --block-size N
--portability ] [ -O, --to-stdout ] [ -p, --same-permis- impose des blocs de N*512 octets (par défaut N=20).
sions, --preserve-permissions ] [ -P, --absolute-paths ] [
--preserve ] [ -R, --record-number ] [ --remove-files -B, --read-full-blocks
] [ -s, --same-order, --preserve-order ] [ --same-owner ] reforme des blocs valides (pour lire les tubes
[ -S, --sparse ] [ -T, --files-from F ] [ --null ] [ 4.2BSD).
--totals ] [ -v, --verbose ] [ -V, --label NOM ] [
--version ] [ -w, --interactive, --confirmation ] [ -W, -C, --directory DIR
--verify ] [ --exclude FILE ] [ -X, --exclude-from FILE aller dans le répertoire DIR.
0 '*
restaure les fichiers vers la sortie standard.
--checkpoint
affiche les noms des répertoires durant la lecture -p, --same-permissions, --preserve-permissions
de l'archive. restaure toutes les informations de protection.

-f, --file [HOSTNAME:]F -P, --absolute-paths


utilise le fichier archive F ou le périphérique F n'enlève pas les '/' au début des noms des
(par defaut /dev/rmt0). fichiers.

--force-local --preserve
le fichier archive est local même si son nom con- comme -p -s
tient un deux-points.
-R, --record-number
-F, --info-script F --new-volume-script F accompage chaque message du numéro d'enregistrement
lance un script à la fin de chaque bande (implique au sein de l'archive.
-M).
--remove-files
-G, --incremental efface les fichiers après les avoir ajoutés à
crée/liste/restaure les anciens formats GNU de l'archive.
backup par incrémentation.
-s, --same-order, --preserve-order
-g, --listed-incremental F la liste des fichiers à restaurer est triée dans
crée/liste/restaure les nouveaux formats GNU de l'ordre d'archivage.
backup par incrémentation.
--same-owner
-h, --dereference conserve les appartenances des fichiers restaurés.
ne pas archiver les liens symboliques, archiver les
fichiers vers lesquels ils pointent. -S, --sparse
traite efficacement les fichiers à trous.
-i, --ignore-zeros
ignorer, dans l'archive, les blocs de zéros, qui -T, --files-from F
correspondent normalement à EOF. obtenir la liste des fichiers à extraire ou à
archiver depuis le fichier F.
--ignore-failed-read
n'abandonne pas l'opération si un fichier est --null
illisible. lire les noms se terminant par des caractères nuls.
Désactive l'option -C.
-k, --keep-old-files
conserve les fichiers existants; ne les remplace --totals
pas par les fichiers présents dans l'archive. affiche la taille totale de l'archive créée avec
--create
-K, --starting-file F
commence par le fichier F dans l'archive. -v, --verbose
afficher la liste des fichiers traités.
-l, --one-file-system
reste dans le système de fichier local quand -V, --label NOM
l'archive est créée. créer une archive avec le nom de volume NAME.

-L, --tape-length N --version


changes la cassette (ou disquette, le support) affiche la version de tar.
après avoir écrit N*1024 octets.
-w, --interactive, --confirmation
-m, --modification-time demande une confirmation pour chaque action.
ne restaure pas la date de modification du fichier.
-W, --verify
-M, --multi-volume tente de vérifier l'archive après l'avoir produite.
crée/liste/restaure les archives multivolumes.
--exclude FILE
-N, --after-date DATE, --newer DATE exclut le fichier FILE du traitement.
enregistre seulement les fichiers plus récent que
DATE. -X, --exclude-from FILE
exclut du traitement les fichiers dont les noms
-o, --old-archive, --portability sont contenus dans FILE.
ecrit une archive au format V7, plutôt qu'au format
ANSI. -Z, --compress, --uncompress
compresse l'archive avec compressFP.
-O, --to-stdout
' '
-z, --gzip, --ungzip
compresse l'archive avec gzip.

--use-compress-program PROG FSF 8 Janvier 1997 TEE(1L)


compresse l'archive en utilisant le programme PROG
(qui doit accepter la option -d pour la décompres-
sion).

--block-compress
% % (/ & *& &
stoppe la sortie des programmes de compression pour
les lecteurs de bandes. NAME
telnet - user interface to the TELNET protocol
-[0-7][lmh]
spécifie le lecteur et sa densité. SYNOPSIS
telnet [-8EFKLacdfrx] [-X authtype] [-b hostalias] [-e escapechar]
[-k realm] [-l user] [-n tracefile] [host [port]]
TRADUCTION
Jérome Signouret, 2000. DESCRIPTION
The telnet command is used to communicate with another host using the
TELNET protocol. If telnet is invoked without the host argument, it
enters command mode, indicated by its prompt (telnet>). In this mode, it
accepts and executes the commands listed below. If it is invoked with
Linux 2 Avril 2000 TAR(1) arguments, it performs an open command with those arguments.

The options are as follows:

-8 Specifies an 8-bit data path. This causes an attempt to negoti-


%% %% ate the TELNET BINARY option on both input and output.

-E Stops any character from being recognized as an escape character.

NOM -F If Kerberos V5 authentication is being used, the -F option allows


tee - Copier l'entrée standard sur la sortie standard et the local credentials to be forwarded to the remote system,
dans un fichier. including any credentials that have already been forwarded into
the local environment.
SYNOPSIS
tee [-ai] [--append] [--ignore-interrupts] [--help] -K Specifies no automatic login to the remote system.
[--version] [fichier...]
-L Specifies an 8-bit data path on output. This causes the BINARY
DESCRIPTION option to be negotiated on output.
Cette page de manuel documente la version GNU de tee.
-X atype
La commande tee copie l'entrée standard sur la sortie Disables the atype type of authentication.
standard, et dans tous les fichiers fournis en argument.
-a Attempt automatic login. Currently, this sends the user name via
Si un fichier n'existe pas, il est créé. Si le fichier the USER variable of the ENVIRON option if supported by the
existe deja, il est écrasé, à moins que l'option -a soit remote system. The name used is that of the current user as
précisée. returned by getlogin(2) if it agrees with the current user ID,
otherwise it is the name associated with the user ID.
OPTIONS
-a, --append -b hostalias
Ajouter l'entrée standard aux fichiers indiqués Uses bind(2) on the local socket to bind it to an aliased address
plutôt que de les écraser. (see ifconfig(8) and the ``alias'' specifier) or to the address
of another interface than the one naturally chosen by connect(2).
--help Afficher un message d'aide sur la sortie standard This can be useful when connecting to services which use IP
et terminer normalement. addresses for authentication and reconfiguration of the server is
undesirable (or impossible).
-i, --ignore-interrupts
Ignorer les signaux d'interruption. -c Disables the reading of the user's .telnetrc file. (See the
toggle skiprc command on this man page.)
--version
Afficher un numéro de version sur la sortie stan- -d Sets the initial value of the debug toggle to TRUE.
dard et terminer normalement.
-e escapechar
Sets the initial telnet escape character to escapechar. If
TRADUCTION escapechar is omitted, then there will be no escape character.
Christophe Blaess, 1997.

' '!
-f If Kerberos V5 authentication is being used, the -f option allows of quit and intr).
the local credentials to be forwarded to the remote system.
While connected to a remote host, telnet command mode may be entered by
-k realm typing the telnet ``escape character'' (initially ``^]''). When in com-
If Kerberos authentication is being used, the -k option requests mand mode, the normal terminal editing conventions are available. Note
that telnet obtain tickets for the remote host in realm realm that the escape character will return to the command mode of the initial
instead of the remote host's realm, as determined by invocation of telnet that has the controlling terminal. Use the send
krb_realmofhost(3). escape command to switch to command mode in subsequent telnet processes
on remote hosts.
-l user
When connecting to the remote system, if the remote system under- The following telnet commands are available. Only enough of each command
stands the ENVIRON option, then user will be sent to the remote to uniquely identify it need be typed (this is also true for arguments to
system as the value for the variable USER. This option implies the mode, set, toggle, unset, slc, environ, and display commands).
the -a option. This option may also be used with the open com-
mand. auth argument [...]
The auth command manipulates the information sent through the
-n tracefile TELNET AUTHENTICATE option. Valid arguments for the auth com-
Opens tracefile for recording trace information. See the set mand are as follows:
tracefile command below.
disable type Disables the specified type of authentication.
-r Specifies a user interface similar to rlogin(1). In this mode, To obtain a list of available types, use the
the escape character is set to the tilde (~) character, unless auth disable ? command.
modified by the -e option.
enable type Enables the specified type of authentication.
-x Turns on encryption of the data stream if possible. To obtain a list of available types, use the
auth enable ? command.
host Indicates the official name, an alias, or the Internet address of
a remote host. status Lists the current status of the various types of
authentication.
port Indicates a port number (address of an application). If a number
is not specified, the default telnet port is used. close Close a TELNET session and return to command mode.

When in rlogin mode, a line of the form ~. disconnects from the remote display argument [...]
host; ~ is the telnet escape character. Similarly, the line ~^Z suspends Displays all, or some, of the set and toggle values (see
the telnet session. The line ~^] escapes to the normal telnet escape below).
prompt.
encrypt argument [...]
Once a connection has been opened, telnet will attempt to enable the The encrypt command manipulates the information sent through
TELNET LINEMODE option. If this fails, telnet will revert to one of two the TELNET ENCRYPT option.
input modes: either ``character at a time'' or ``old line by line''
depending on what the remote system supports. Valid arguments for the encrypt command are as follows:

When LINEMODE is enabled, character processing is done on the local sys- disable type [input|output]
tem, under the control of the remote system. When input editing or char- Disables the specified type of encryption. If
acter echoing is to be disabled, the remote system will relay that infor- you omit input and output, both input and output
mation. The remote system will also relay changes to any special charac- are disabled. To obtain a list of available
ters that happen on the remote system, so that they can take effect on types, use the encrypt disable ? command.
the local system.
enable type [input|output]
In ``character at a time'' mode, most text typed is immediately sent to Enables the specified type of encryption. If
the remote host for processing. you omit input and output, both input and output
are enabled. To obtain a list of available
In ``old line by line'' mode, all text is echoed locally, and (normally) types, use the encrypt enable ? command.
only completed lines are sent to the remote host. The ``local echo char-
acter'' (initially ``^E'') may be used to turn off and on the local echo input This is the same as the encrypt start input com-
(this would mostly be used to enter passwords without the password being mand.
echoed).
-input This is the same as the encrypt stop input com-
If the LINEMODE option is enabled, or if the localchars toggle is TRUE mand.
(the default for ``old line by line''; see below), the user's quit, intr,
and flush characters are trapped locally, and sent as TELNET protocol output This is the same as the encrypt start output
sequences to the remote side. If LINEMODE has ever been enabled, then command.
the user's susp and eof are also sent as TELNET protocol sequences, and
quit is sent as a TELNET ABORT instead of BREAK. There are options (see -output This is the same as the encrypt stop output com-
toggle autoflush and toggle autosynch below) which cause this action to mand.
flush subsequent output to the terminal (until the remote host acknowl-
edges the TELNET sequence) and flush previous terminal input (in the case start [input|output]
' ''
Attempts to start encryption. If you omit input remote side does not understand the LINEMODE
and output, both input and output are enabled. option, then enter ``character at a time'' mode.
To obtain a list of available types, use the
encrypt enable ? command. line Enable the TELNET LINEMODE option, or, if the
remote side does not understand the LINEMODE
status Lists the current status of encryption. option, then attempt to enter ``old-line-by-
line'' mode.
stop [input|output]
Stops encryption. If you omit input and output, isig (-isig) Attempt to enable (disable) the TRAPSIG mode of
encryption is on both input and output. the LINEMODE option. This requires that the
LINEMODE option be enabled.
type type Sets the default type of encryption to be used
with later encrypt start or encrypt stop com- edit (-edit) Attempt to enable (disable) the EDIT mode of the
mands. LINEMODE option. This requires that the
LINEMODE option be enabled.
environ arguments [...]
The environ command is used to manipulate the variables that softtabs (-softtabs)
may be sent through the TELNET ENVIRON option. The initial Attempt to enable (disable) the SOFT_TAB mode of
set of variables is taken from the users environment, with the LINEMODE option. This requires that the
only the DISPLAY and PRINTER variables being exported by LINEMODE option be enabled.
default. The USER variable is also exported if the -a or -l
options are used. litecho (-litecho)
Valid arguments for the environ command are: Attempt to enable (disable) the LIT_ECHO mode of
the LINEMODE option. This requires that the
define variable value LINEMODE option be enabled.
Define the variable variable to have a value of
value. Any variables defined by this command are ? Prints out help information for the mode com-
automatically exported. The value may be enclosed mand.
in single or double quotes so that tabs and spaces
may be included. open host [-l user] [[-] port]
Open a connection to the named host. If no port number is
undefine variable specified, telnet will attempt to contact a TELNET server at
Remove variable from the list of environment vari- the default port. The host specification may be either a host
ables. name (see hosts(5)) or an Internet address specified in the
``dot notation'' (see inet(3)). The -l option may be used to
export variable specify the user name to be passed to the remote system via
Mark the variable variable to be exported to the the ENVIRON option. When connecting to a non-standard port,
remote side. telnet omits any automatic initiation of TELNET options. When
the port number is preceded by a minus sign, the initial
unexport variable option negotiation is done. After establishing a connection,
Mark the variable variable to not be exported the file .telnetrc in the user's home directory is opened.
unless explicitly asked for by the remote side. Lines beginning with a ``#'' are comment lines. Blank lines
are ignored. Lines that begin without whitespace are the
list List the current set of environment variables. start of a machine entry. The first thing on the line is the
Those marked with a * will be sent automatically, name of the machine that is being connected to. The rest of
other variables will only be sent if explicitly the line, and successive lines that begin with whitespace are
requested. assumed to be telnet commands and are processed as if they had
been typed in manually to the telnet command prompt.
? Prints out help information for the environ com-
mand. quit Close any open TELNET session and exit telnet. An end-of-file
(in command mode) will also close a session and exit.
logout Sends the TELNET LOGOUT option to the remote side. This com-
mand is similar to a close command; however, if the remote send arguments
side does not support the LOGOUT option, nothing happens. If, Sends one or more special character sequences to the remote
however, the remote side does support the LOGOUT option, this host. The following are the arguments which may be specified
command should cause the remote side to close the TELNET con- (more than one argument may be specified at a time):
nection. If the remote side also supports the concept of sus-
pending a user's session for later reattachment, the logout abort Sends the TELNET ABORT (Abort processes) sequence.
argument indicates that you should terminate the session imme-
diately. ao Sends the TELNET AO (Abort Output) sequence, which
should cause the remote system to flush all output
mode type type is one of several options, depending on the state of the from the remote system to the user's terminal.
TELNET session. The remote host is asked for permission to go
into the requested mode. If the remote host is capable of ayt Sends the TELNET AYT (Are You There) sequence, to
entering that mode, the requested mode will be entered. which the remote system may or may not choose to
respond.
character Disable the TELNET LINEMODE option, or, if the
'- '&
brk Sends the TELNET BRK (Break) sequence, which may have
significance to the remote system. ? Prints out help information for the send command.

ec Sends the TELNET EC (Erase Character) sequence, which set argument value
should cause the remote system to erase the last char-
acter entered. unset argument value
The set command will set any one of a number of telnet vari-
el Sends the TELNET EL (Erase Line) sequence, which ables to a specific value or to TRUE. The special value off
should cause the remote system to erase the line cur- turns off the function associated with the variable; this is
rently being entered. equivalent to using the unset command. The unset command will
disable or set to FALSE any of the specified functions. The
eof Sends the TELNET EOF (End Of File) sequence. values of variables may be interrogated with the display com-
mand. The variables which may be set or unset, but not tog-
eor Sends the TELNET EOR (End of Record) sequence. gled, are listed here. In addition, any of the variables for
the toggle command may be explicitly set or unset using the
escape Sends the current telnet escape character (initially set and unset commands.
``^]'').
ayt If TELNET is in localchars mode, or LINEMODE is
ga Sends the TELNET GA (Go Ahead) sequence, which likely enabled, and the status character is typed, a TELNET
has no significance to the remote system. AYT sequence (see send ayt preceding) is sent to the
remote host. The initial value for the "Are You
getstatus There" character is the terminal's status character.
If the remote side supports the TELNET STATUS command,
getstatus will send the subnegotiation to request that echo This is the value (initially ``^E'') which, when in
the server send its current option status. ``line by line'' mode, toggles between doing local
echoing of entered characters (for normal processing),
ip Sends the TELNET IP (Interrupt Process) sequence, and suppressing echoing of entered characters (for
which should cause the remote system to abort the cur- entering, say, a password).
rently running process.
eof If telnet is operating in LINEMODE or ``old line by
nop Sends the TELNET NOP (No OPeration) sequence. line'' mode, entering this character as the first
character on a line will cause this character to be
susp Sends the TELNET SUSP (SUSPend process) sequence. sent to the remote system. The initial value of the
eof character is taken to be the terminal's eof char-
synch Sends the TELNET SYNCH sequence. This sequence causes acter.
the remote system to discard all previously typed (but
not yet read) input. This sequence is sent as TCP erase If telnet is in localchars mode (see toggle localchars
urgent data (and may not work if the remote system is below), and if telnet is operating in ``character at a
a 4.2BSD system -- if it doesn't work, a lower case time'' mode, then when this character is typed, a
``r'' may be echoed on the terminal). TELNET EC sequence (see send ec above) is sent to the
remote system. The initial value for the erase char-
do cmd Sends the TELNET DO cmd sequence. cmd can be either a acter is taken to be the terminal's erase character.
decimal number between 0 and 255, or a symbolic name
for a specific TELNET command. cmd can also be either escape This is the telnet escape character (initially ``^['')
help or ? to print out help information, including a which causes entry into telnet command mode (when con-
list of known symbolic names. nected to a remote system).

dont cmd flushoutput


Sends the TELNET DONT cmd sequence. cmd can be either If telnet is in localchars mode (see toggle localchars
a decimal number between 0 and 255, or a symbolic name below) and the flushoutput character is typed, a
for a specific TELNET command. cmd can also be either TELNET AO sequence (see send ao above) is sent to the
help or ? to print out help information, including a remote host. The initial value for the flush charac-
list of known symbolic names. ter is taken to be the terminal's flush character.

will cmd forw1


Sends the TELNET WILL cmd sequence. cmd can be either
a decimal number between 0 and 255, or a symbolic name forw2 If TELNET is operating in LINEMODE, these are the
for a specific TELNET command. cmd can also be either characters that, when typed, cause partial lines to be
help or ? to print out help information, including a forwarded to the remote system. The initial value for
list of known symbolic names. the forwarding characters are taken from the termi-
nal's eol and eol2 characters.
wont cmd
Sends the TELNET WONT cmd sequence. cmd can be either interrupt
a decimal number between 0 and 255, or a symbolic name If telnet is in localchars mode (see toggle localchars
for a specific TELNET command. cmd can also be either below) and the interrupt character is typed, a TELNET
help or ? to print out help information, including a IP sequence (see send ip above) is sent to the remote
list of known symbolic names. host. The initial value for the interrupt character
'0 -*
is taken to be the terminal's intr character. ? Displays the legal set (unset) commands.

kill If telnet is in localchars mode (see toggle localchars skey sequence challenge
below), and if telnet is operating in ``character at a The skey command computes a response to the S/Key challenge.
time'' mode, then when this character is typed, a See skey(1) for more information on the S/Key system.
TELNET EL sequence (see send el above) is sent to the
remote system. The initial value for the kill charac- slc state The slc command (Set Local Characters) is used to set or
ter is taken to be the terminal's kill character. change the state of the special characters when the TELNET
LINEMODE option has been enabled. Special characters are
lnext If telnet is operating in LINEMODE or ``old line by characters that get mapped to TELNET commands sequences (like
line'' mode, then this character is taken to be the ip or quit) or line editing characters (like erase and kill).
terminal's lnext character. The initial value for the By default, the local special characters are exported.
lnext character is taken to be the terminal's lnext
character. check Verify the current settings for the current spe-
cial characters. The remote side is requested to
quit If telnet is in localchars mode (see toggle localchars send all the current special character settings,
below) and the quit character is typed, a TELNET BRK and if there are any discrepancies with the local
sequence (see send brk above) is sent to the remote side, the local side will switch to the remote
host. The initial value for the quit character is value.
taken to be the terminal's quit character.
export Switch to the local defaults for the special char-
reprint acters. The local default characters are those of
If telnet is operating in LINEMODE or old line by the local terminal at the time when telnet was
line'' mode, then this character is taken to be the started.
terminal's reprint character. The initial value for
the reprint character is taken to be the terminal's import Switch to the remote defaults for the special
reprint character. characters. The remote default characters are
those of the remote system at the time when the
rlogin This is the rlogin escape character. If set, the nor- TELNET connection was established.
mal TELNET escape character is ignored unless it is
preceded by this character at the beginning of a line. ? Prints out help information for the slc command.
This character, at the beginning of a line, followed
by a "." closes the connection; when followed by a ^Z status Show the current status of telnet. This includes the peer one
it suspends the telnet command. The initial state is is connected to, as well as the current mode.
to disable the rlogin escape character.
toggle arguments [...]
start If the TELNET TOGGLE-FLOW-CONTROL option has been Toggle (between TRUE and FALSE) various flags that control how
enabled, then this character is taken to be the termi- telnet responds to events. These flags may be set explicitly
nal's start character. The initial value for the to TRUE or FALSE using the set and unset commands listed
start character is taken to be the terminal's start above. More than one argument may be specified. The state of
character. these flags may be interrogated with the display command.
Valid arguments are:
stop If the TELNET TOGGLE-FLOW-CONTROL option has been
enabled, then this character is taken to be the termi- authdebug Turns on debugging information for the authenti-
nal's stop character. The initial value for the stop cation code.
character is taken to be the terminal's stop charac-
ter. autoflush If autoflush and localchars are both TRUE, then
when the ao or quit characters are recognized
susp If telnet is in localchars mode, or LINEMODE is (and transformed into TELNET sequences; see set
enabled, and the suspend character is typed, a TELNET above for details), telnet refuses to display
SUSP sequence (see send susp above) is sent to the any data on the user's terminal until the remote
remote host. The initial value for the suspend char- system acknowledges (via a TELNET TIMING MARK
acter is taken to be the terminal's suspend character. option) that it has processed those TELNET
sequences. The initial value for this toggle is
tracefile TRUE if the terminal user had not done an "stty
This is the file to which the output, caused by noflsh", otherwise FALSE (see stty(1)).
netdata or option tracing being TRUE, will be written.
If it is set to ``-'', then tracing information will autodecrypt When the TELNET ENCRYPT option is negotiated, by
be written to standard output (the default). default the actual encryption (decryption) of
the data stream does not start automatically.
worderase The autoencrypt (autodecrypt) command states
If telnet is operating in LINEMODE or ``old line by that encryption of the output (input) stream
line'' mode, then this character is taken to be the should be enabled as soon as possible.
terminal's worderase character. The initial value for
the worderase character is taken to be the terminal's autologin If the remote side supports the TELNET
worderase character. AUTHENTICATION option TELNET attempts to use it
to perform automatic authentication. If the
- -
AUTHENTICATION option is not supported, the tocol processing (having to do with TELNET
user's login name are propagated through the options). The initial value for this toggle is
TELNET ENVIRON option. This command is the same FALSE.
as specifying a option on the open command.
prettydump When the netdata toggle is enabled, if
autosynch If autosynch and localchars are both TRUE, then prettydump is enabled the output from the
when either the intr or quit character is typed netdata command will be formatted in a more user
(see set above for descriptions of the intr and readable format. Spaces are put between each
quit characters), the resulting TELNET sequence character in the output, and the beginning of
sent is followed by the TELNET SYNCH sequence. any TELNET escape sequence is preceded by a '*'
This procedure should cause the remote system to to aid in locating them.
begin throwing away all previously typed input
until both of the TELNET sequences have been skiprc When the skiprc toggle is TRUE, TELNET skips the
read and acted upon. The initial value of this reading of the .telnetrc file in the user's home
toggle is FALSE. directory when connections are opened. The ini-
tial value for this toggle is FALSE.
binary Enable or disable the TELNET BINARY option on
both input and output. termdata Toggles the display of all terminal data (in
hexadecimal format). The initial value for this
inbinary Enable or disable the TELNET BINARY option on toggle is FALSE.
input.
verbose_encrypt
outbinary Enable or disable the TELNET BINARY option on When the verbose_encrypt toggle is TRUE, telnet
output. prints out a message each time encryption is
enabled or disabled. The initial value for this
crlf If this is TRUE, then carriage returns will be toggle is FALSE.
sent as <CR><LF>. If this is FALSE, then car-
riage returns will be send as <CR><NUL>. The ? Displays the legal toggle commands.
initial value for this toggle is FALSE.
z Suspend telnet. This command only works when the user is
crmod Toggle carriage return mode. When this mode is using the csh(1).
enabled, most carriage return characters
received from the remote host will be mapped ! [command]
into a carriage return followed by a line feed. Execute a single command in a subshell on the local system.
This mode does not affect those characters typed If command is omitted, then an interactive subshell is
by the user, only those received from the remote invoked.
host. This mode is not very useful unless the
remote host only sends carriage return, but ? [command]
never line feeds. The initial value for this Get help. With no arguments, telnet prints a help summary.
toggle is FALSE. If a command is specified, telnet will print the help informa-
tion for just that command.
debug Toggles socket level debugging (useful only to
the superuser). The initial value for this tog- ENVIRONMENT
gle is FALSE. telnet uses at least the HOME, SHELL, DISPLAY, and TERM environment vari-
ables. Other environment variables may be propagated to the other side
encdebug Turns on debugging information for the encryp- via the TELNET ENVIRON option.
tion code.
FILES
localchars If this is TRUE, then the flush, interrupt, ~/.telnetrc user customized telnet startup values
quit, erase, and kill characters (see set above)
are recognized locally, and transformed into HISTORY
(hopefully) appropriate TELNET control sequences The telnet command appeared in 4.2BSD.
(respectively ao, ip, brk, ec, and el; see send
above). The initial value for this toggle is NOTES
TRUE in ``old line by line'' mode, and FALSE in On some remote systems, echo has to be turned off manually when in ``old
``character at a time'' mode. When the LINEMODE line by line'' mode.
option is enabled, the value of localchars is
ignored, and assumed to always be TRUE. If In ``old line by line'' mode or LINEMODE the terminal's eof character is
LINEMODE has ever been enabled, then quit is only recognized (and sent to the remote system) when it is the first
sent as abort, and eof and suspend are sent as character on a line.
eof and susp (see send above).
Source routing is not supported yet for IPv6.
netdata Toggles the display of all network data (in hex-
adecimal format). The initial value for this BSD February 3, 1994 BSD
toggle is FALSE.

options Toggles the display of some internal telnet pro-


- -!
'
FIELD DESCRIPTIONS
top displays a variety of information about the processor
state. The display is updated every 5 seconds by default,
but you can change that with the d command-line option or
NAME the s interactive command.
top - display top CPU processes
uptime
SYNOPSIS This line displays the time the system has been up,
top [-] [d delay] [p pid] [q] [c] [C] [S] [s] [i] [n iter] and the three load averages for the system. The load
[b] averages are the average number of process ready to
run during the last 1, 5 and 15 minutes. This line
DESCRIPTION is just like the output of uptime(1). The uptime
top provides an ongoing look at processor activity in real display may be toggled by the interactive l command.
time. It displays a listing of the most CPU-intensive
tasks on the system, and can provide an interactive inter- processes
face for manipulating processes. It can sort the tasks by The total number of processes running at the time of
CPU usage, memory usage and runtime. can be better con- the last update. This is also broken down into the
figured than the standard top from the procps suite. Most number of tasks which are running, sleeping, stopped,
features can either be selected by an interactive command or undead. The processes and states display may be
or by specifying the feature in the personal or system- toggled by the t interactive command.
wide configuration file. See below for more information.
CPU states
Shows the percentage of CPU time in user mode, system
COMMAND-LINE OPTIONS mode, niced tasks, and idle. (Niced tasks are only
d Specifies the delay between screen updates. You can those whose nice value is negative.) Time spent in
change this with the s interactive command. niced tasks will also be counted in system and user
time, so the total will be more than 100%. The pro-
p Monitor only processes with given process id. This cesses and states display may be toggled by the t
flag can be given up to twenty times. This option is interactive command.
neither available interactively nor can it be put
into the configuration file. Mem Statistics on memory usage, including total available
memory, free memory, used memory, shared memory, and
q This causes top to refresh without any delay. If the memory used for buffers. The display of memory infor-
caller has superuser priviledges, top runs with the mation may be toggled by the m interactive command.
highest possible priority.
Swap Statistics on swap space, including total swap space,
S Specifies cumulative mode, where each process is available swap space, and used swap space. This and
listed with the CPU time that it as well as its dead Mem are just like the output of free(1).
children has spent. This is like the -S flag to
ps(1). See the discussion below of the S interactive PID The process ID of each task.
command.
PPID The parent process ID each task.
s Tells top to run in secure mode. This disables the
potentially dangerous of the interactive commands UID The user ID of the task's owner.
(see below). A secure top is a nifty thing to leave
running on a spare terminal. USER The user name of the task's owner.
i Start top ignoring any idle or zombie processes. See PRI The priority of the task.
the interactive command i below.
NI The nice value of the task. Negative nice values are
C display total CPU states in addition to individual higher priority.
CPUs. This option only affects SMP systems.
SIZE The size of the task's code plus data plus stack
c display command line instead of the command name space, in kilobytes, is shown here.
only. The default behaviour has been changed as this
seems to be more useful. TSIZE
The code size of the task. This gives strange values
n Number of iterations. Update the display this number for kernel processes and is broken for ELF processes.
of times and then exit.
DSIZE
b Batch mode. Useful for sending output from top to Data + Stack size. This is broken for ELF processes.
other programs or to a file. In this mode, top will
not accept command line input. It runs until it pro- TRS Text resident size.
duces the number of iterations requested with the n
option or until killed. Output is plain text suitable SWAP Size of the swapped out part of the task.
for display on a dumb terminal.

- -'
D Size of pages marked dirty. mands, and the status of secure and cumulative modes.

LC Last used processor. (That this changes from time to k Kill a process. You will be prompted for the PID of
time is not a bug; Linux intentionally uses weak the task, and the signal to send to it. For a normal
affinity. Also notice that the very act of running kill, send signal 15. For a sure, but rather abrupt,
top may break weak affinity and cause more processes kill, send signal 9. The default signal, as with
to change current CPU more often because of the extra kill(1), is 15, SIGTERM. This command is not avail-
demand for CPU time.) able in secure mode.

RSS The total amount of physical memory used by the task, i Ignore idle and zombie processes. This is a toggle
in kilobytes, is shown here. For ELF processes used switch.
library pages are counted here, for a.out processes
not. I Toggle between Solaris (CPU percentage divided by
total number of CPUs) and Irix (CPU percentage calcu-
SHARE lated solely by amount of time) views. This is a
The amount of shared memory used by the task is shown toggle switch that affects only SMP systems.
in this column.
n or #
STAT The state of the task is shown here. The state is Change the number of processes to show. You will be
either S for sleeping, D for uninterruptible sleep, R prompted to enter the number. This overrides auto-
for running, Z for zombies, or T for stopped or matic determination of the number of processes to
traced. These states are modified by trailing < for a show, which is based on window size measurement. If
process with negative nice value, N for a process 0 is specified, then top will show as many processes
with positive nice value, W for a swapped out process as will fit on the screen; this is the default.
(this does not work correctly for kernel processes).
q Quit.
WCHAN
depending on the availablity of either r Re-nice a process. You will be prompted for the PID
/boot/psdatabase or the kernel link map /boot/Sys- of the task, and the value to nice it to. Entering a
tem.map this shows the address or the name of the positve value will cause a process to be niced to
kernel function the task currently is sleeping in. negative values, and lose priority. If root is run-
ning top, a negative value can be entered, causing a
TIME Total CPU time the task has used since it started. process to get a higher than normal priority. The
If cumulative mode is on, this also includes the CPU default renice value is 10. This command is not
time used by the process's children which have died. available in secure mode.
You can set cumulative mode with the S command line
option or toggle it with the interactive command S. S This toggles cumulative mode, the equivalent of ps
The header line will then be changed to CTIME. -S, i.e., that CPU times will include a process's
defunct children. For some programs, such as compil-
%CPU The task's share of the CPU time since the last ers, which work by forking into many seperate tasks,
screen update, expressed as a percentage of total CPU normal mode will make them appear less demanding than
time per processor. they actually are. For others, however, such as
shells and init, this behavior is correct. In any
%MEM The task's share of the physical memory. case, try cumulative mode for an alternative view of
CPU use.
COMMAND
The task's command name, which will be truncated if s Change the delay between updates. You will be
it is too long to be displayed on one line. Tasks in prompted to enter the delay time, in seconds, between
memory will have a full command line, but swapped-out updates. Fractional values are recognized down to
tasks will only have the name of the program in microseconds. Entering 0 causes continuous updates.
parentheses (for example, "(getty)"). The default value is 5 seconds. Note that low values
cause nearly unreadably fast displays, and greatly
A , WP raise the load. This command is not available in
these fields from the kmem top are not supported. secure mode.

INTERACTIVE COMMANDS f or F
Several single-key commands are recognized while top is Add fields to display or remove fields from the dis-
running. Some are disabled if the s option has been given play. See below for more information.
on the command line.
o or O
space Change order of displayed fields. See below for more
Immediately updates the display. information.

^L Erases and redraws the screen. l toggle display of load average and uptime
information.
h or ?
Displays a help screen giving a brief summary of com- m toggle display of memory information.
-- -&
of time between updates. For the first update, a short
t toggle display of processes and CPU states informa- delay is used, and top itself dominates the CPU usage.
tion. After that, top will drop back, and a more reliable esti-
mate of CPU usage is available.
c toggle display of command name or full command line.
The SIZE and RSS fields don't count the page tables and
N sort tasks by pid (numerically). the task_struct of a process; this is at least 12K of mem-
ory that is always resident. SIZE is the virtual size of
A sort tasks by age (newest first). the process (code+data+stack).

P sort tasks by CPU usage (default). Keep in mind that a process must die for its time to be
recorded on its parent by cumulative mode. Perhaps more
M sort tasks by resident memory usage. useful behavior would be to follow each process upwards,
adding time, but that would be more expensive, possibly
T sort tasks by time / cumulative time. prohibitively so. In any case, that would make top's
behavior incompatible with ps.
W Write current setup to ~/.toprc. This is the recom-
mended way to write a top configuration file. FILES
/etc/toprc The global configuration file. ~/.toprc The
The Field and Order Screens personal configuration file.
After pressing f, F, o or O you will be shown a screen
specifying the field order on the top line and short SEE ALSO
descriptions of the field contents. The field order string ps(1), free(1), uptime(1), kill(1), renice(1).
uses the following syntax: If the letter in the filed
string corresponding to a field is upper case, the field BUGS
will be displayed. This is furthermore indicated by an If the window is less than about 70x7, top will not format
asterisk in front of the field description. The order of information correctly.
the fields corresponds to the order of the letters in the Many fields still have problems with ELF processes.
string. the help screens are not yet optimized for windows with
From the field select screen you can toggle the display less than 25 lines
of a field by pressing the corresponding letter.
From the order screen you may move a field to the left by AUTHOR
pressing the corresponding upper case letter resp. to the top was originally written by Roger Binns, based on Branko
right by pressing the lower case one. Lankester's <lankeste@fwi.uva.nl> ps program. Robert
Nation <nation@rocket.sanders.lockheed.com> re-wrote it
Configuration Files significantly to use the proc filesystem, based on Michael
Top reads it's default configuration from two files, K. Johnson's <johnsonm@redhat.com> proc-based ps program.
/etc/toprc and ~/.toprc. The global configuration file Michael Shields <mjshield@nyx.cs.du.edu> made many
may be used to restrict the usage of top to the secure changes, including secure and cumulative modes and a gen-
mode for non-priviledged users. If this is desired, the eral cleanup. Tim Janik <timj@gtk.org> added age sorting
file should contain a 's' to specify secure mode and a and the ability to monitor specific processes through
digit d (2<=d<=9) for the default delay (in seconds) on a their ids.
single line. The personal configuration file contains two
lines. The first line contains lower and upper letters to Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Heavily
specify which fields in what order are to be displayed. changed it to include support for configurable fields and
The letters correspond to the letters in the Fields or other new options, and did further cleanup and use of the
Order screens from top. As this is not very instructive, new readproc interface.
it is recommended to select fields and order in a running
top process and to save this using the W interactive com- The "b" and "n" options contributed by George Bonser
mand. The second line is more interesting (and impor- <george@captech.com> for CapTech IT Services.
tant). It contains information on the other options. Most
important, if you have saved a configuration in secure Michael K. Johnson <johnsonm@redhat.com> is now the main-
mode, you will not get an insecure top without removing tainer.
the lower 's' from the second line of your ~/.toprc. A
digit specifies the delay time between updates, a capital Please send bug reports to <procps-bugs@redhat.com>
'S' cumulative mode, a lower 'i' no-idle mode, a capital
'I' Irix view. As in interactive mode, a lower 'm', 'l',
and 't' suppresses the display of memory, uptime resp.
process and CPU state information. Currently changing the Linux Feb 1 1993 TOP(1)
default sorting order (by CPU usage) is not supported.

NOTES
0 0
This proc-based top works by reading the files in the proc
filesystem, mounted on /proc. If /proc is not mounted,
top will not work.
NOM
%CPU shows the cputime/realtime percentage in the period tty - Afficher le nom du terminal associe à l'entrée stan-

-0 &*
dard. -n, --nodename
Afficher le nom d'hôte de la machine sur le réseau.
SYNOPSIS
tty [-s] [--silent] [--quiet] [--help] [--version] -r, --release
Afficher le numéro de version du système
DESCRIPTION d'exploitation.
Cette page de manuel documente la version GNU de tty.
-s, --sysname
tty affiche le nom de fichier du tty associé à son entrée Afficher le nom du système d'exploitation.
standard. Il affiche `not a tty' si l'entrée standard
n'est pas un terminal. -v Afficher la version du système d'exploitation.

Son code de retour vaut : -a, --all


0 si l'entrée standard est un tty Afficher toutes les informations décrites ci-
1 si l'entrée standard n'est pas un tty dessus.
2 si un argument est incorrect
3 s'il y a eu une erreur d'écriture --help Afficher un message d'aide sur la sortie standard
et terminer normalement.
OPTIONS
--help Afficher un message d'aide sur la sortie standard --version
et terminer normalement. Afficher un numéro de version sur la sortie stan-
dard et terminer normalement.
-s, --silent, --quiet
Ne rien afficher, renvoyer simplement le code de
retour. TRADUCTION
Christophe Blaess, 1997.
--version
Afficher un numéro de version sur la sortie stan-
dard et terminer normalement.
FSF 9 Janvier 1997 UNAME(1L)

TRADUCTION
Christophe Blaess, 1997.
' # %# ' # %#

FSF 9 Janvier 1997 TTY(1L)


NAME
' % ' % updatedb - update the slocate database

SYNOPSIS
updatedb [-u] [-u path] [-e path1,path2,...] [-f
NOM fstype1,...] [-l [01] ] [-q] [-v,--verbose] [-V, --ver-
uname - Afficher des informations sur le système. sion] [-h, --help] pattern...

SYNOPSIS DESCRIPTION
uname [-snrvma] [--sysname] [--nodename] [--release] This manual page documents slocate, a security-enhanced
[--machine] [--all] [--help] [--version] version of locate. updatedb is simply a link to slocate
that implies the -u option.
DESCRIPTION
Cette page de manuel documente la version GNU de uname. OPTIONS
-u Create slocate database starting at the root direc-
uname affiche des informations concernant la machine et le tory. This is the default behavior when called as
système d'exploitation sur lequel il est invoqué. updatedb.

Si aucune option n'est fournie, uname agit comme si -U path


l'argument -s était indiqué. Create slocate database starting at path path.

Si plusieurs options sont indiquées, ou si l'argument -a -e dirs


est fourni, les informations sont affichées dans l'ordre Exclude directories in the comma-separated list
`snrvm' avec un espace entre chaque élément. dirs from the slocate database.

OPTIONS -f fstypes
-m, --machine Exclude file systems in the comma-separated list
Afficher le type (matériel) de machine. dirs from the slocate database.

& &
-l <num> The date on which the user account will be dis-
Security level. -l 0 turns security checks off, abled. The date is specified in the format YYYY-
which will make searches faster. -l 1 turns secu- MM-DD.
rity checks on. This is the default.
-f inactive_days
-q Quiet mode; error messages are suppressed. The number of days after a password expires until
the account is permanently disabled. A value of 0
-v Verbose mode; display files indexed when creating disables the account as soon as the password has
database expired, and a value of -1 disables the feature.
The default value is -1.
--help Print a summary of the options to slocate and exit.
-g initial_group
--version The group name or number of the user's initial
Print the version number of slocate and exit. login group. The group name must exist. A group
number must refer to an already existing group.
ENVIRONMENT The default group number is 1.
SEE ALSO
locate(1L), -G group,[...]
A list of supplementary groups which the user is
also a member of. Each group is separated from the
next by a comma, with no intervening whitespace.
UPDATEDB(1L) The groups are subject to the same restrictions as
the group given with the -g option. The default is
for the user to belong only to the initial group.

'(% ## " '(% ## " -m The user's home directory will be created if it
does not exist. The files contained in skele-
ton_dir will be copied to the home directory if the
-k option is used, otherwise the files contained in
/etc/skel will be used instead. Any directories
NAME contained in skeleton_dir or /etc/skel will be cre-
useradd - Create a new user or update default new user ated in the user's home directory as well. The -k
information option is only valid in conjunction with the -m
option. The default is to not create the directory
SYNOPSIS and to not copy any files.
useradd [-c comment] [-d home_dir]
[-e expire_date] [-f inactive_time] -M The user home directory will not be created, even
[-g initial_group] [-G group[,...]] if the system wide settings from /etc/login.defs is
[-m [-k skeleton_dir] | -M] [-p passwd] to create home dirs.
[-s shell] [-u uid [ -o]] [-n] [-r] login
-n A group having the same name as the user being
useradd -D [-g default_group] [-b default_home] added to the system will be created by default.
[-f default_inactive] [-e default_expire_date] This option will turn off this Red Hat Linux spe-
[-s default_shell] cific behavior.
DESCRIPTION -r This flag is used to create a system account. That
Creating New Users is, an user with an UID lower than value of UID_MIN
When invoked without the -D option, the useradd command defined in /etc/login.defs. Note that useradd will
creates a new user account using the values specified on not create a home directory for such an user,
the command line and the default values from the system. regardless of the default setting in
The new user account will be entered into the system files /etc/login.defs. You have to specify -m option if
as needed, the home directory will be created, and initial you want a home directory for a system account to
files copied, depending on the command line options. The be created. This is an option added by Red Hat.
version provided with Red Hat Linux will create a group
for each user added to the system, unless -n option is -p passwd
given. The options which apply to the useradd command are The encrypted password, as returned by crypt(3).
The default is to disable the account.
-c comment
The new user's password file comment field. -s shell
The name of the user's login shell. The default is
-d home_dir to leave this field blank, which causes the system
The new user will be created using home_dir as the to select the default login shell.
value for the user's login directory. The default
is to append the login name to default_home and use -u uid The numerical value of the user's ID. This value
that as the login directory name. must be unique, unless the -o option is used. The
value must be non-negative. The default is to use
-e expire_date the smallest ID value greater than 99 and greater
& &!
than every other user. Values between 0 and 99 are '(% #% " '(% #% "
typically reserved for system accounts.

Changing the default values


When invoked with the -D option, useradd will either dis-
play the current default values, or update the default NAME
values from the command line. The valid options are userdel - Delete a user account and related files

-b default_home SYNOPSIS
The initial path prefix for a new user's home userdel [-r] login
directory. The user's name will be affixed to the
end of default_home to create the new directory DESCRIPTION
name if the -d option is not used when creating a The userdel command modifies the system account files,
new account. deleting all entries that refer to login. The named user
must exist.
-e default_expire_date
The date on which the user account is disabled. -r Files in the user's home directory will be removed
along with the home directory itself and the user's
-f default_inactive mail spool. Files located in other file systems
The number of days after a password has expired will have to be searched for and deleted manually.
before the account will be disabled.
FILES
-g default_group /etc/passwd - user account information
The group name or ID for a new user's initial /etc/shadow - secure user account information
group. The named group must exist, and a numerical /etc/group - group information
group ID must have an existing entry .
CAVEATS
-s default_shell userdel will not allow you to remove an account if the
The name of the new user's login shell. The named user is currently logged in. You must kill any running
program will be used for all future new user processes which belong to an account that you are delet-
accounts. ing. You may not remove any NIS attributes on an NIS
client. This must be performed on the NIS server.
If no options are specified, useradd displays the current
default values. SEE ALSO
chfn(1), chsh(1), groupadd(8), groupdel(8), groupmod(8),
NOTES passwd(1), useradd(8), usermod(8)
The system administrator is responsible for placing the
default user files in the /etc/skel directory. AUTHOR
This version of useradd was modified by Red Hat to suit Julianne Frances Haugh (jfh@austin.ibm.com)
Red Hat user/group conventions.

CAVEATS
You may not add a user to an NIS group. This must be per- USERDEL(8)
formed on the NIS server.

FILES $ ' $
/etc/passwd - user account information
/etc/shadow - secure user account information
/etc/group - group information
/etc/gshadow - secure group information NAME
/etc/default/useradd - default information w - Show who is logged on and what they are doing.
/etc/login.defs - system-wide settings
/etc/skel - directory containing default files SYNOPSIS
w - [husfV] [user]
SEE ALSO
chfn(1), chsh(1), crypt(3), groupadd(8), groupdel(8), DESCRIPTION
groupmod(8), passwd(1), userdel(8), usermod(8) w displays information about the users currently on the
machine, and their processes. The header shows, in this
AUTHOR order, the current time, how long the system has been
Julianne Frances Haugh (jfh@austin.ibm.com) running, how many users are currently logged on, and the
system load averages for the past 1, 5, and 15 minutes.

The following entries are displayed for each user: login


USERADD(8) name, the tty name, the remote host, login time, idle
time, JCPU, PCPU, and the command line of their current
process.

& &'
The JCPU time is the time used by all processes attached
to the tty. It does not include past background jobs, but Le message peut être fourni en tant qu'argument sur la
does include currently running background jobs. ligne de commande, ou il peut être envoyé dans l'entrée
standard de wall. Quant l'entrée standard est un termi-
The PCPU time is the time used by the current process, nal, le message doit se terminer par la touche EOF (la
named in the "what" field. plupart du temps Controle-D).

VOIR AUSSI
mesg(1).
COMMAND-LINE OPTIONS
-h Don't print the header. AUTHOR
Miquel van Smoorenburg, miquels@drinkel.ow.org
-u Ignores the username while figuring out the current
process and cpu times. To demonstrate this, do a
"su" and do a "w" and a "w -u". TRADUCTION
Christophe Blaess, 1997.
-s Use the short format. Don't print the login time,
JCPU or PCPU times.

-f Toggle printing the from (remote hostname) field. Linux 16 Avril 1997 WALL(1)
The default as released is for the from field to not
be printed, although your system administrator or
distribution maintainer may have compiled a version
in which the from field is shown by default. $ ' $
-V Display version information.

user Show information about the specified user only.


NAME
watch - execute a program periodically, showing output
FILES fullscreen
/etc/utmp information about who is currently logged on
/proc process information SYNOPSIS
watch [-dhv] [-n <seconds>] [--differences[=cumulative]]
[--help] [--interval=<seconds>] [--version] <command>
SEE ALSO
free(1), ps(1), top(1), uptime(1), utmp(5), who(1) DESCRIPTION
watch runs command repeatedly, displaying its output (the
first screenfull). This allows you to watch the program
AUTHORS output change over time. By default, the program is run
w was re-written almost entirely by Charles Blake, based every 2 seconds; use -n or --interval to specify a differ-
on the version by Larry Greenfield <greenfie@gauss.rut- ent interval.
gers.edu> and Michael K. Johnson <johnsonm@redhat.com>.
The -d or --differences flag will highlight the differ-
Please send bug reports to <procps-bugs@redhat.com> ences between successive updates. The --cumulative option
makes highlighting "sticky", presenting a running display
of all positions that have ever changed.

8 Dec 1993 W(1) watch will run until interrupted.

NOTE
Note that command is given to "sh -c" which means that you
may need to use extra quoting to get the desired effect.
$ $
Note that POSIX option processing is used (i.e., option
processing stops at the first non-option argument). This
means that flags after command don't get interpreted by
NOM watch itself.
wall -- Envoyer un message sur les terminaux de tout les
utilisateurs. EXAMPLES
To watch for mail, you might do
SYNOPSIS
wall [ message ] watch -n 60 from

DESCRIPTION To watch the contents of a directory change, you could use


Wall envoie un message à tous les utilisateurs connectés,
dont l'autorisation mesg(1) est positionnée à yes. watch -d ls -l

&- &&
fichier, précédée du nom du fichier s'il a été indiqué en
If you're only interested in files owned by user joe, you argument.
might use
Si plusieurs fichiers sont mentionnés, wc ajoute une ligne
watch -d 'ls -l | fgrep joe' finale de statistiques, contenant le cumul des valeurs,
précédé du nom `total'. Les statistiques sont affichées
To see the effects of quoting, try these out dans l'ordre suivant : nombre de lignes, de mots, et
d'octets.
watch echo $$
Par défaut wc affiche les trois valeurs. Les options per-
watch echo '$$' mettent de n'en afficher que certaines d'entre elles. Les
options ne se surchargent pas, mais cumulent leurs effets,
watch echo "'"'$$'"'" ainsi wc --bytes --words affiche à la fois le nombre
d'octets et de mots.
You can watch for your administrator to install the latest
kernel with OPTIONS
-c, --bytes, --chars
watch uname -r Afficher uniquement le nombre d'octets.

(Just kidding.) -w, --words


Afficher uniquement le nombre de mots
BUGS
Upon terminal resize, the screen will not be correctly -l, --lines
repainted until the next scheduled update. All --differ- Afficher uniquement le nombre de sauts de lignes
ences highlighting is lost on that update as well.
--help Afficher un message d'aide sur la sortie standard,
Non-printing characters are stripped from program output. et terminer normalement.
Use "cat -v" as part of the command pipeline if you want
to see them. --version
Afficher un numéro de version sur la sortie stan-
AUTHORS dard, et terminer normalement.
The original watch was written by Tony Rems
<rembo@unisoft.com> in 1991, with mods and corrections by
Francois Pinard. It was reworked and new features added TRADUCTION
by Mike Coleman <mkc@acm.org> in 1999. Christophe Blaess, 1997.

1999 Apr 3 WATCH(1) FSF 13 Janvier 1997 WC(1)

$ $ $ $

NOM NOM
wc - Afficher le nombre d'octets, de mots et de lignes who - Montrer qui est connecté.
d'un fichier.
SYNOPSIS
SYNOPSIS who [-imqsuwHT] [--count] [--idle] [--heading] [--help]
wc [-clw] [--bytes] [--chars] [--lines] [--words] [--help] [--message] [--mesg] [--version] [--writable] [fichier]
[--version] [fichier...] [am i]

DESCRIPTION DESCRIPTION
Cette page de manuel documente la version GNU de wc ([NDT] Cette page de manuel documente la version GNU de who.
wc = Word Count).
Si aucun argument n'est fourni, hormis d'éventuelles
wc compte le nombre d'octets, de mots séparés par des options, who affiche les informations suivantes pour
blancs, et de sauts de lignes (NewLines) dans chacun des chaque utilisateur connecté :
fichiers indiqués.
nom de connexion
Si aucun fichier n'est fourni, ou si le nom `-' est men- terminal
tionné, la lecture se fait depuis l'entrée standard. heure de connexion
nom d'hote distant, ou numéro de terminal X
Une ligne de statistiques est affichée pour chaque

&0 0*
Si un argument est fourni qui ne soit pas une option, who $ % 1 *+ & & $ %
l'utilise à la place de /etc/utmp comme nom de fichier
contenant les enregistrements des connexions. /etc/wtmp
est souvent utilisé comme argument lors de l'appel de who
pour voir qui s'est connecté précédemment.
NOM
Si deux arguments ne représentant pas des options sont write - Envoyer un message à un autre utilisateur.
fournis, who affiche seulement les informations concernant
l'utilisateur qui l'a invoqué (ceci étant déterminé grâce SYNOPSIS
à son entrée standard), précédé du nom d'hôte. Tradition- write utilisateur [nom_terminal]
nellement, les deux arguments sont `am i', comme dans `who
am i'. ([NDT] Mais ca marche aussi tres bien avec `who DESCRIPTION
suis je' ;-) Write vous permet de communiquer avec d'autres utilisa-
teurs, en copiant des lignes de votre terminal sur le
OPTIONS leur.
-m Identique `who am i'.
Quand vous exécutez la commande write , l'utilisateur à
-q, --count qui vous écrivez reçoit un message de la forme :
Affiche uniquement les noms d'utilisateurs et le
nombres de personnes connectées. Ceci a priorité Message de votrenom@votremachine sur votreterminal
sur toutes les autres options. à hh:mm ...

-s Sans effet - uniquement pour assurer la compati- Toutes les lignes suivantes que vous entrerez seront
bilité avec d'autres versions de who. copiées sur le terminal de l'utilisateur spécifié. Si
l'autre utilisateur veut répondre, il doit également
-i, -u, --idle lancer write.
Après l'heure de connexion, affiche le nombre
d'heures et de minutes d'inactivité (idle) de Quand vous avez terminé, entrez un caractère de fin de
l'utilisateur. `.' signifie que l'utilisateur a fichier (EOF) ou bien un caractère d'interruption.
été actif durant la dernière minute. `old' signi- L'autre utilisateur verra le message EOF qui indique que
fie que l'utilisateur a été inactif pendant plus de la conversation est terminée.
24 heures.
Vous pouvez empêcher quiconque (à l'exception du
-H, --heading super-utilisateur) d'écrire sur votre terminal en util-
Afficher une ligne de libellé pour les colonnes. isant la commande mesg(1). Certaines commandes, par exem-
ple nroff(1) et pr(1), peuvent désactiver automatiquement
-w, -T, --mesg, --message, --writable l'écriture sur votre terminal, de sorte que leur sortie ne
Comme -s, mais ajoute après le nom de connexion un soit pas écrasée.
caractère indiquant le statut de l'utilisateur vis
à vis des messages : Si l'utilisateur que vous voulez joindre est connecté sur
plus d'un terminal, vous pouvez spécifier sur quel termi-
+ les messages émis par write sont autorisés nal écrire en spécifiant le nom du terminal comme second
argument à la commande write. Sinon, vous pouvez laisser
- les messages émis par write ne sont pas write sélectionner un des terminaux ; il prendra celui en
autorisés activité depuis le moins longtemps, pour que si l'utilisa-
teur est connecté au travail et s'est connecté ensuite à
? impossible de trouver le périphérique du la maison, le message ira au bon endroit (à la maison).
terminal
L'arrangement traditionnel utilisé pour écrire à quelqu'un
--help Afficher un message d'aide sur la sortie standard est que quand la chaîne de caractères "-o" est placée dans
et terminer normalement. ou à la fin d'une ligne, c'est au tour de l'autre personne
à parler. La chaîne de caractères "oo" signifie que la
--version personne concernée croit que la conversation est terminée.
Afficher un numéro de version sur la sortie stan-
dard et terminer normalement. VOIR AUSSI
mesg(1), talk(1), who(1)

TRADUCTION HISTORIQUE
Christophe Blaess, 1997. Une commande write est apparue dans la version 6 de UNIX
AT&T.

TRADUCTION
FSF 9 Janvier 1997 WHO(1L) Frédéric Delanoy, 2000.

0 0
play server and related utilities, Xserver, rgb, mkfont-
Linux 7 Août 2000 WRITE(1) dir; remote execution utilities, rstart and xon; a clip-
board manager, xclipboard; keyboard description compiler
and related utilities, xkbcomp, xkbprint, xkbbell, xkbevd,
xkbvleds, and xkbwatch; a utility to terminate clients,
.2 .! "3 .2 xkill; an optimized X protocol proxy, lbxproxy; a firewall
security proxy, xfwp; a proxy manager to control them,
proxymngr; a utility to find proxies, xfindproxy; Netscape
Navigator Plug-ins, libxrx.so and libxrxnest.so; an RX
MIME-type helper program, xrx; and a utility to cause part
NAME or all of the screen to be redrawn, xrefresh.
X - a portable, network-transparent window system
Many other utilities, window managers, games, toolkits,
SYNOPSIS etc. are included as user-contributed software in the X
The X Window System is a network transparent window system Consortium distribution, or are available using anonymous
which runs on a wide range of computing and graphics ftp on the Internet. See your site administrator for
machines. It should be relatively straightforward to details.
build the X Consortium software distribution on most ANSI
C and POSIX compliant systems. Commercial implementations STARTING UP
are also available for a wide range of platforms. There are two main ways of getting the X server and an
initial set of client applications started. The particu-
The X Consortium requests that the following names be used lar method used depends on what operating system you are
when referring to this software: running and whether or not you use other window systems in
addition to X.
X
X Window System xdm (the X Display Manager)
X Version 11 If you want to always have X running on your dis-
X Window System, Version 11 play, your site administrator can set your machine
X11 up to use the X Display Manager xdm. This program
is typically started by the system at boot time
X Window System is a trademark of X Consortium, Inc. and takes care of keeping the server running and
getting users logged in. If you are running xdm,
DESCRIPTION you will see a window on the screen welcoming you
X Window System servers run on computers with bitmap dis- to the system and asking for your username and
plays. The server distributes user input to and accepts password. Simply type them in as you would at a
output requests from various client programs through a normal terminal, pressing the Return key after
variety of different interprocess communication channels. each. If you make a mistake, xdm will display an
Although the most common case is for the client programs error message and ask you to try again. After you
to be running on the same machine as the server, clients have successfully logged in, xdm will start up
can be run transparently from other machines (including your X environment. By default, if you have an
machines with different architectures and operating sys- executable file named .xsession in your home
tems) as well. directory, xdm will treat it as a program (or
shell script) to run to start up your initial
X supports overlapping hierarchical subwindows and text clients (such as terminal emulators, clocks, a
and graphics operations, on both monochrome and color dis- window manager, user settings for things like the
plays. For a full explanation of the functions that are background, the speed of the pointer, etc.). Your
available, see the Xlib - C Language X Interface manual, site administrator can provide details.
the X Window System Protocol specification, the X Toolkit
Intrinsics - C Language Interface manual, and various xinit (run manually from the shell)
toolkit documents. Sites that support more than one window system
might choose to use the xinit program for starting
The number of programs that use X is quite large. Pro- X manually. If this is true for your machine,
grams provided in the core X Consortium distribution your site administrator will probably have pro-
include: a terminal emulator, xterm; a window manager, vided a program named "x11", "startx", or "xstart"
twm; a display manager, xdm; a console redirect program, that will do site-specific initialization (such as
xconsole; a mail interface, xmh; a bitmap editor, bitmap; loading convenient default resources, running a
resource listing/manipulation tools, appres, editres; window manager, displaying a clock, and starting
access control programs, xauth, xhost, and iceauth; user several terminal emulators) in a nice way. If
preference setting programs, xrdb, xcmsdb, xset, xsetroot, not, you can build such a script using the xinit
xstdcmap, and xmodmap; clocks, xclock and oclock; a font program. This utility simply runs one user-speci-
displayer, (xfd; utilities for listing information about fied program to start the server, runs another to
fonts, windows, and displays, xlsfonts, xwininfo, start up any desired clients, and then waits for
xlsclients, xdpyinfo, xlsatoms, and xprop; screen image either to finish. Since either or both of the
manipulation utilities, xwd, xwud, and xmag; a performance user-specified programs may be a shell script,
measurement utility, x11perf; a font compiler, bdftopcf; a this gives substantial flexibility at the expense
font server and related utilities, xfs, fsinfo, fslsfonts, of a nice interface. For this reason, xinit is
fstobdf; an X Image Extension exerciser, xieperf; a dis- not intended for end users.
0 0!
tacting a given server, The hostname part of the display
DISPLAY NAMES name is used to determine the type of channel (also called
From the user's perspective, every X server has a display a transport layer) to be used. X servers generally
name of the form: support the following types of connections:

hostname:displaynumber.screennumber local
The hostname part of the display name should be
This information is used by the application to determine the empty string. For example: :0, :1, and :0.1.
how it should connect to the server and which screen it The most efficient local transport will be chosen.
should use by default (on displays with multiple moni-
tors): TCPIP
The hostname part of the display name should be
hostname the server machine's IP address name. Full Inter-
The hostname specifies the name of the machine to net names, abbreviated names, and IP addresses are
which the display is physically connected. If the all allowed. For example: x.org:0, expo:0,
hostname is not given, the most efficient way of 198.112.45.11:0, bigmachine:1, and hydra:0.1.
communicating to a server on the same machine will
be used. DECnet
The hostname part of the display name should be
displaynumber the server machine's nodename, followed by two
The phrase "display" is usually used to refer to colons instead of one. For example: myws::0,
collection of monitors that share a common key- big::1, and hydra::0.1.
board and pointer (mouse, tablet, etc.). Most
workstations tend to only have one keyboard, and
therefore, only one display. Larger, multi-user ACCESS CONTROL
systems, however, frequently have several displays An X server can use several types of access control.
so that more than one person can be doing graphics Mechanisms provided in Release 6 are:
work at once. To avoid confusion, each display on Host Access Simple host-based access control.
a machine is assigned a display number (beginning MIT-MAGIC-COOKIE-1 Shared plain-text "cookies".
at 0) when the X server for that display is XDM-AUTHORIZATION-1 Secure DES based private-keys.
started. The display number must always be given SUN-DES-1 Based on Sun's secure rpc system.
in a display name. MIT-KERBEROS-5 Kerberos Version 5 user-to-user.

screennumber Xdm initializes access control for the server and also
Some displays share a single keyboard and pointer places authorization information in a file accessible to
among two or more monitors. Since each monitor the user. Normally, the list of hosts from which connec-
has its own set of windows, each screen is tions are always accepted should be empty, so that only
assigned a screen number (beginning at 0) when the clients with are explicitly authorized can connect to the
X server for that display is started. If the display. When you add entries to the host list (with
screen number is not given, screen 0 will be used. xhost), the server no longer performs any authorization on
connections from those machines. Be careful with this.
On POSIX systems, the default display name is stored in
your DISPLAY environment variable. This variable is set The file from which Xlib extracts authorization data can
automatically by the xterm terminal emulator. However, be specified with the environment variable XAUTHORITY, and
when you log into another machine on a network, you will defaults to the file .Xauthority in the home directory.
need to set DISPLAY by hand to point to your display. For Xdm uses $HOME/.Xauthority and will create it or merge in
example, authorization records if it already exists when a user
logs in.
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY If you use several machines and share a common home direc-
The xon script can be used to start an X program on a tory across all of the machines by means of a network file
remote machine; it automatically sets the DISPLAY variable system, you never really have to worry about authorization
correctly. files, the system should work correctly by default. Oth-
erwise, as the authorization files are machine-indepen-
Finally, most X programs accept a command line option of dent, you can simply copy the files to share them. To
-display displayname to temporarily override the contents manage authorization files, use xauth. This program
of DISPLAY. This is most commonly used to pop windows on allows you to extract records and insert them into other
another person's screen or as part of a "remote shell" files. Using this, you can send authorization to remote
command to start an xterm pointing back to your display. machines when you login, if the remote machine does not
For example, share a common home directory with your local machine.
Note that authorization information transmitted ``in the
% xeyes -display joesws:0 -geometry 1000x1000+0+0 clear'' through a network file system or using ftp or rcp
% rsh big xterm -display myws:0 -ls </dev/null & can be ``stolen'' by a network eavesdropper, and as such
may enable unauthorized access. In many environments,
X servers listen for connections on a variety of different this level of security is not a concern, but if it is, you
communications channels (network byte streams, shared mem- need to know the exact semantics of the particular autho-
ory, etc.). Since there can be more than one way of con- rization data to know if this is actually a problem.
0 0'
For more information on access control, see the Xsecurity xterm -fn 6x10 -geometry 80x24+30+200 &
manual page. xclock -geometry 48x48-0+0 &
xload -geometry 48x48-96+0 &
GEOMETRY SPECIFICATIONS xbiff -geometry 48x48-48+0 &
One of the advantages of using window systems instead of
hardwired terminals is that applications don't have to be
restricted to a particular size or location on the screen. WINDOW MANAGERS
Although the layout of windows on a display is controlled The layout of windows on the screen is controlled by spe-
by the window manager that the user is running (described cial programs called window managers. Although many win-
below), most X programs accept a command line argument of dow managers will honor geometry specifications as given,
the form -geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, others may choose to ignore them (requiring the user to
HEIGHT, XOFF, and YOFF are numbers) for specifying a pre- explicitly draw the window's region on the screen with the
ferred size and location for this application's main win- pointer, for example).
dow.
Since window managers are regular (albeit complex) client
The WIDTH and HEIGHT parts of the geometry specification programs, a variety of different user interfaces can be
are usually measured in either pixels or characters, built. The X Consortium distribution comes with a window
depending on the application. The XOFF and YOFF parts are manager named twm which supports overlapping windows,
measured in pixels and are used to specify the distance of popup menus, point-and-click or click-to-type input mod-
the window from the left or right and top and bottom edges els, title bars, nice icons (and an icon manager for those
of the screen, respectively. Both types of offsets are who don't like separate icon windows).
measured from the indicated edge of the screen to the cor-
responding edge of the window. The X offset may be speci- See the user-contributed software in the X Consortium dis-
fied in the following ways: tribution for other popular window managers.

+XOFF The left edge of the window is to be placed XOFF FONT NAMES
pixels in from the left edge of the screen (i.e., Collections of characters for displaying text and symbols
the X coordinate of the window's origin will be in X are known as fonts. A font typically contains images
XOFF). XOFF may be negative, in which case the that share a common appearance and look nice together (for
window's left edge will be off the screen. example, a single size, boldness, slant, and character
set). Similarly, collections of fonts that are based on a
-XOFF The right edge of the window is to be placed XOFF common type face (the variations are usually called roman,
pixels in from the right edge of the screen. XOFF bold, italic, bold italic, oblique, and bold oblique) are
may be negative, in which case the window's right called families.
edge will be off the screen.
Fonts come in various sizes. The X server supports scal-
The Y offset has similar meanings: able fonts, meaning it is possible to create a font of
arbitrary size from a single source for the font. The
+YOFF The top edge of the window is to be YOFF pixels server supports scaling from outline fonts and bitmap
below the top edge of the screen (i.e., the Y fonts. Scaling from outline fonts usually produces sig-
coordinate of the window's origin will be YOFF). nificantly better results than scaling from bitmap fonts.
YOFF may be negative, in which case the window's
top edge will be off the screen. An X server can obtain fonts from individual files stored
in directories in the file system, or from one or more
-YOFF The bottom edge of the window is to be YOFF pixels font servers, or from a mixtures of directories and font
above the bottom edge of the screen. YOFF may be servers. The list of places the server looks when trying
negative, in which case the window's bottom edge to find a font is controlled by its font path. Although
will be off the screen. most installations will choose to have the server start up
with all of the commonly used font directories in the font
Offsets must be given as pairs; in other words, in order path, the font path can be changed at any time with the
to specify either XOFF or YOFF both must be present. Win- xset program. However, it is important to remember that
dows can be placed in the four corners of the screen using the directory names are on the server's machine, not on
the following specifications: the application's.

+0+0 upper left hand corner. Bitmap font files are usually created by compiling a tex-
tual font description into binary form, using bdftopcf.
-0+0 upper right hand corner. Font databases are created by running the mkfontdir pro-
gram in the directory containing the source or compiled
-0-0 lower right hand corner. versions of the fonts. Whenever fonts are added to a
directory, mkfontdir should be rerun so that the server
+0-0 lower left hand corner. can find the new fonts. To make the server reread the
font database, reset the font path with the xset program.
In the following examples, a terminal emulator is placed For example, to add a font to a private directory, the
in roughly the center of the screen and a load average following commands could be used:
monitor, mailbox, and clock are placed in the upper right
hand corner: % cp newfont.pcf ~/myfonts
0- 0&
% mkfontdir ~/myfonts ning. The objname is a normal, case-insensitive DECnet
% xset fp rehash object name. The cataloguelist specifies a list of cata-
logue names, with '+' as a separator.
The xfontsel and xlsfonts programs can be used to browse
through the fonts available on a server. Font names tend Examples: DECnet/SRVNOD::FONT$DEFAULT, dec-
to be fairly long as they contain all of the information net/44.70::font$special/symbols.
needed to uniquely identify individual fonts. However,
the X server supports wildcarding of font names, so the COLOR NAMES
full specification Most applications provide ways of tailoring (usually
through resources or command line arguments) the colors of
-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1 various elements in the text and graphics they display. A
color can be specified either by an abstract color name,
might be abbreviated as: or by a numerical color specification. The numerical
specification can identify a color in either device-depen-
-*-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1 dent (RGB) or device-independent terms. Color strings are
case-insensitive.
Because the shell also has special meanings for * and ?,
wildcarded font names should be quoted: X supports the use of abstract color names, for example,
"red", "blue". A value for this abstract name is obtained
% xlsfonts -fn '-*-courier-medium-r-normal--*-100-*-*-*-*-*-*' by searching one or more color name databases. Xlib first
searches zero or more client-side databases; the number,
The xlsfonts program can be used to list all of the fonts location, and content of these databases is implementation
that match a given pattern. With no arguments, it lists dependent. If the name is not found, the color is looked
all available fonts. This will usually list the same font up in the X server's database. The text form of this
at many different sizes. To see just the base scalable database is commonly stored in the file
font names, try using one of the following patterns: <XRoot>/lib/X11/rgb.txt, where <XRoot> is replaced by the
root of the X11 install tree.
-*-*-*-*-*-*-0-0-0-0-*-0-*-*
-*-*-*-*-*-*-0-0-75-75-*-0-*-* A numerical color specification consists of a color space
-*-*-*-*-*-*-0-0-100-100-*-0-*-* name and a set of values in the following syntax:

To convert one of the resulting names into a font at a <color_space_name>:<value>/.../<value>


specific size, replace one of the first two zeros with a
nonzero value. The field containing the first zero is for An RGB Device specification is identified by the prefix
the pixel size; replace it with a specific height in pix- "rgb:" and has the following syntax:
els to name a font at that size. Alternatively, the field
containing the second zero is for the point size; replace rgb:<red>/<green>/<blue>
it with a specific size in decipoints (there are 722.7
decipoints to the inch) to name a font at that size. The <red>, <green>, <blue> := h | hh | hhh | hhhh
last zero is an average width field, measured in tenths of h := single hexadecimal digits
pixels; some servers will anamorphically scale if this Note that h indicates the value scaled in 4 bits, hh the
value is specified. value scaled in 8 bits, hhh the value scaled in 12 bits,
and hhhh the value scaled in 16 bits, respectively. These
FONT SERVER NAMES values are passed directly to the X server, and are
One of the following forms can be used to name a font assumed to be gamma corrected.
server that accepts TCP connections:
The eight primary colors can be represented as:
tcp/hostname:port
tcp/hostname:port/cataloguelist black rgb:0/0/0
red rgb:ffff/0/0
The hostname specifies the name (or decimal numeric green rgb:0/ffff/0
address) of the machine on which the font server is run- blue rgb:0/0/ffff
ning. The port is the decimal TCP port on which the font yellow rgb:ffff/ffff/0
server is listening for connections. The cataloguelist magenta rgb:ffff/0/ffff
specifies a list of catalogue names, with '+' as a separa- cyan rgb:0/ffff/ffff
tor. white rgb:ffff/ffff/ffff

Examples: tcp/x.org:7100, tcp/198.112.45.11:7100/all. For backward compatibility, an older syntax for RGB Device
is supported, but its continued use is not encouraged.
One of the following forms can be used to name a font The syntax is an initial sharp sign character followed by
server that accepts DECnet connections: a numeric specification, in one of the following formats:

decnet/nodename::font$objname #RGB (4 bits each)


decnet/nodename::font$objname/cataloguelist #RRGGBB (8 bits each)
#RRRGGGBBB (12 bits each)
The nodename specifies the name (or decimal numeric #RRRRGGGGBBBB (16 bits each)
address) of the machine on which the font server is run-
00 **
The R, G, and B represent single hexadecimal digits. When keymap table
fewer than 16 bits each are specified, they represent the Applications translate event keycodes and modifier
most-significant bits of the value (unlike the "rgb:" syn- masks into keysyms using a keysym table which con-
tax, in which values are scaled). For example, #3a7 is tains one row for each keycode and one column for
the same as #3000a0007000. various modifier states. This table is initial-
ized by the server to correspond to normal type-
An RGB intensity specification is identified by the prefix writer conventions. The exact semantics of how
"rgbi:" and has the following syntax: the table is interpreted to produce keysyms
depends on the particular program, libraries, and
rgbi:<red>/<green>/<blue> language input method used, but the following con-
ventions for the first four keysyms in each row
The red, green, and blue are floating point values between are generally adhered to:
0.0 and 1.0, inclusive. They represent linear intensity
values, with 1.0 indicating full intensity, 0.5 half The first four elements of the list are split into two
intensity, and so on. These values will be gamma cor- groups of keysyms. Group 1 contains the first and second
rected by Xlib before being sent to the X server. The keysyms; Group 2 contains the third and fourth keysyms.
input format for these values is an optional sign, a Within each group, if the first element is alphabetic and
string of numbers possibly containing a decimal point, and the the second element is the special keysym NoSymbol,
an optional exponent field containing an E or e followed then the group is treated as equivalent to a group in
by a possibly signed integer string. which the first element is the lowercase letter and the
second element is the uppercase letter.
The standard device-independent string specifications have
the following syntax: Switching between groups is controlled by the keysym named
MODE SWITCH, by attaching that keysym to some key and
CIEXYZ:<X>/<Y>/<Z> (none, 1, none) attaching that key to any one of the modifiers Mod1
CIEuvY:<u>/<v>/<Y> (~.6, ~.6, 1) through Mod5. This modifier is called the ``group modi-
CIExyY:<x>/<y>/<Y> (~.75, ~.85, 1) fier.'' Group 1 is used when the group modifier is off,
CIELab:<L>/<a>/<b> (100, none, none) and Group 2 is used when the group modifier is on.
CIELuv:<L>/<u>/<v> (100, none, none)
TekHVC:<H>/<V>/<C> (360, 100, 100) Within a group, the modifier state determines which keysym
to use. The first keysym is used when the Shift and Lock
All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are modifiers are off. The second keysym is used when the
floating point values. Some of the values are constrained Shift modifier is on, when the Lock modifier is on and the
to be between zero and some upper bound; the upper bounds second keysym is uppercase alphabetic, or when the Lock
are given in parentheses above. The syntax for these val- modifier is on and is interpreted as ShiftLock. Other-
ues is an optional '+' or '-' sign, a string of digits wise, when the Lock modifier is on and is interpreted as
possibly containing a decimal point, and an optional expo- CapsLock, the state of the Shift modifier is applied first
nent field consisting of an 'E' or 'e' followed by an to select a keysym; but if that keysym is lowercase alpha-
optional '+' or '-' followed by a string of digits. betic, then the corresponding uppercase keysym is used
instead.
For more information on device independent color, see the
Xlib reference manual. OPTIONS
Most X programs attempt to use the same names for command
KEYBOARDS line options and arguments. All applications written with
The X keyboard model is broken into two layers: server- the X Toolkit Intrinsics automatically accept the follow-
specific codes (called keycodes) which represent the phys- ing options:
ical keys, and server-independent symbols (called keysyms)
which represent the letters or words that appear on the -display display
keys. Two tables are kept in the server for converting This option specifies the name of the X server to
keycodes to keysyms: use.

modifier list -geometry geometry


Some keys (such as Shift, Control, and Caps Lock) This option specifies the initial size and loca-
are known as modifier and are used to select dif- tion of the window.
ferent symbols that are attached to a single key
(such as Shift-a generates a capital A, and Con- -bg color, -background color
trol-l generates a control character ^L). The Either option specifies the color to use for the
server keeps a list of keycodes corresponding to window background.
the various modifier keys. Whenever a key is
pressed or released, the server generates an event -bd color, -bordercolor color
that contains the keycode of the indicated key as Either option specifies the color to use for the
well as a mask that specifies which of the modi- window border.
fier keys are currently pressed. Most servers set
up this list to initially contain the various -bw number, -borderwidth number
shift, control, and shift lock keys on the key- Either option specifies the width in pixels of the
board. window border.

* *
-fg color, -foreground color
Either option specifies the color to use for text RESOURCES
or graphics. To make the tailoring of applications to personal prefer-
ences easier, X provides a mechanism for storing default
-fn font, -font font values for program resources (e.g. background color, win-
Either option specifies the font to use for dis- dow title, etc.) Resources are specified as strings that
playing text. are read in from various places when an application is
run. Program components are named in a hierarchical fash-
-iconic ion, with each node in the hierarchy identified by a class
This option indicates that the user would prefer and an instance name. At the top level is the class and
that the application's windows initially not be instance name of the application itself. By convention,
visible as if the windows had be immediately the class name of the application is the same as the pro-
iconified by the user. Window managers may choose gram name, but with the first letter capitalized (e.g.
not to honor the application's request. Bitmap or Emacs) although some programs that begin with
the letter ``x'' also capitalize the second letter for
-name historical reasons.
This option specifies the name under which
resources for the application should be found. The precise syntax for resources is:
This option is useful in shell aliases to distin-
guish between invocations of an application, with- ResourceLine = Comment | IncludeFile | ResourceSpec | <empty line>
out resorting to creating links to alter the exe- Comment = "!" {<any character except null or newline>}
cutable file name. IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace
FileName = <valid filename for operating system>
-rv, -reverse ResourceSpec = WhiteSpace ResourceName WhiteSpace ":" WhiteSpace Value
Either option indicates that the program should ResourceName = [Binding] {Component Binding} ComponentName
simulate reverse video if possible, often by swap- Binding = "." | "*"
ping the foreground and background colors. Not WhiteSpace = {<space> | <horizontal tab>}
all programs honor this or implement it correctly. Component = "?" | ComponentName
It is usually only used on monochrome displays. ComponentName = NameChar {NameChar}
NameChar = "a"-"z" | "A"-"Z" | "0"-"9" | "_" | "-"
+rv Value = {<any character except null or unescaped newline>}
This option indicates that the program should not
simulate reverse video. This is used to override Elements separated by vertical bar (|) are alternatives.
any defaults since reverse video doesn't always Curly braces ({...}) indicate zero or more repetitions of
work properly. the enclosed elements. Square brackets ([...]) indicate
that the enclosed element is optional. Quotes ("...") are
-selectionTimeout used around literal characters.
This option specifies the timeout in milliseconds
within which two communicating applications must IncludeFile lines are interpreted by replacing the line
respond to one another for a selection request. with the contents of the specified file. The word
"include" must be in lowercase. The filename is inter-
-synchronous preted relative to the directory of the file in which the
This option indicates that requests to the X line occurs (for example, if the filename contains no
server should be sent synchronously, instead of directory or contains a relative directory specification).
asynchronously. Since Xlib normally buffers
requests to the server, errors do not necessarily If a ResourceName contains a contiguous sequence of two or
get reported immediately after they occur. This more Binding characters, the sequence will be replaced
option turns off the buffering so that the appli- with single "." character if the sequence contains only
cation can be debugged. It should never be used "." characters, otherwise the sequence will be replaced
with a working program. with a single "*" character.

-title string A resource database never contains more than one entry for
This option specifies the title to be used for a given ResourceName. If a resource file contains multi-
this window. This information is sometimes used ple lines with the same ResourceName, the last line in the
by a window manager to provide some sort of header file is used.
identifying the window.
Any whitespace character before or after the name or colon
-xnllanguage language[_territory][.codeset] in a ResourceSpec are ignored. To allow a Value to begin
This option specifies the language, territory, and with whitespace, the two-character sequence ``\space''
codeset for use in resolving resource and other (backslash followed by space) is recognized and replaced
filenames. by a space character, and the two-character sequence
``\tab'' (backslash followed by horizontal tab) is recog-
-xrm resourcestring nized and replaced by a horizontal tab character. To
This option specifies a resource name and value to allow a Value to contain embedded newline characters, the
override any defaults. It is also very useful for two-character sequence ``\n'' is recognized and replaced
setting resources that don't have explicit command by a newline character. To allow a Value to be broken
line arguments. across multiple lines in a text file, the two-character
* *!
sequence ``\newline'' (backslash followed by newline) is xrdb program will sort resources automatically and
recognized and removed from the value. To allow a Value place them in RESOURCE_MANAGER or
to contain arbitrary character codes, the four-character SCREEN_RESOURCES, as appropriate.
sequence ``\nnn'', where each n is a digit character in
the range of ``0''-``7'', is recognized and replaced with application-specific files
a single byte that contains the octal value specified by Directories named by the environment variable
the sequence. Finally, the two-character sequence ``\\'' XUSERFILESEARCHPATH or the environment variable
is recognized and replaced with a single backslash. XAPPLRESDIR (which names a single directory and
should end with a '/' on POSIX systems), plus
When an application looks for the value of a resource, it directories in a standard place (usually under
specifies a complete path in the hierarchy, with both <XRoot>/lib/X11/, but this can be overridden with
class and instance names. However, resource values are the XFILESEARCHPATH environment variable) are
usually given with only partially specified names and searched for for application-specific resources.
classes, using pattern matching constructs. An asterisk For example, application default resources are
(*) is a loose binding and is used to represent any number usually kept in <XRoot>/lib/X11/app-defaults/.
of intervening components, including none. A period (.) See the X Toolkit Intrinsics - C Language Inter-
is a tight binding and is used to separate immediately face manual for details.
adjacent components. A question mark (?) is used to match
any single component name or class. A database entry can- XENVIRONMENT
not end in a loose binding; the final component (which Any user- and machine-specific resources may be
cannot be "?") must be specified. The lookup algorithm specified by setting the XENVIRONMENT environment
searches the resource database for the entry that most variable to the name of a resource file to be
closely matches (is most specific for) the full name and loaded by all applications. If this variable is
class being queried. When more than one database entry not defined, a file named $HOME/.Xdefaults-host-
matches the full name and class, precedence rules are used name is looked for instead, where hostname is the
to select just one. name of the host where the application is execut-
ing.
The full name and class are scanned from left to right
(from highest level in the hierarchy to lowest), one com- -xrm resourcestring
ponent at a time. At each level, the corresponding compo- Resources can also be specified from the command
nent and/or binding of each matching entry is determined, line. The resourcestring is a single resource
and these matching components and bindings are compared name and value as shown above. Note that if the
according to precedence rules. Each of the rules is string contains characters interpreted by the
applied at each level, before moving to the next level, shell (e.g., asterisk), they must be quoted. Any
until a rule selects a single entry over all others. The number of -xrm arguments may be given on the com-
rules (in order of precedence) are: mand line.

1. An entry that contains a matching component (whether Program resources are organized into groups called
name, class, or "?") takes precedence over entries classes, so that collections of individual resources (each
that elide the level (that is, entries that match the of which are called instances) can be set all at once. By
level in a loose binding). convention, the instance name of a resource begins with a
lowercase letter and class name with an upper case letter.
2. An entry with a matching name takes precedence over Multiple word resources are concatenated with the first
both entries with a matching class and entries that letter of the succeeding words capitalized. Applications
match using "?". An entry with a matching class written with the X Toolkit Intrinsics will have at least
takes precedence over entries that match using "?". the following resources:

3. An entry preceded by a tight binding takes precedence


over entries preceded by a loose binding. background (class Background)
This resource specifies the color to use for the
Programs based on the X Tookit Intrinsics obtain resources window background.
from the following sources (other programs usually support
some subset of these sources):
borderWidth (class BorderWidth)
RESOURCE_MANAGER root window property This resource specifies the width in pixels of the
Any global resources that should be available to window border.
clients on all machines should be stored in the
RESOURCE_MANAGER property on the root window of
the first screen using the xrdb program. This is borderColor (class BorderColor)
frequently taken care of when the user starts up X This resource specifies the color to use for the
through the display manager or xinit. window border.

SCREEN_RESOURCES root window property Most applications using the X Toolkit Intrinsics also have
Any resources specific to a given screen (e.g. the resource foreground (class Foreground), specifying the
colors) that should be available to clients on all color to use for text and graphics within the window.
machines should be stored in the SCREEN_RESOURCES
property on the root window of that screen. The By combining class and instance specifications, applica-
* *'
tion preferences can be set quickly and easily. Users of See locale(7x), setlocale(3), locale(1).
color displays will frequently want to set Background and
Foreground classes to particular defaults. Specific color XMODIFIERS
instances such as text cursors can then be overridden This variable can be set to contain additional
without having to define all of the related resources. information important for the current locale set-
For example, ting. Typically set to @im=<input-method> to enable
a particular input method. See XSetLocaleModi-
bitmap*Dashed: off fiers(3).
XTerm*cursorColor: gold
XTerm*multiScroll: on XLOCALEDIR
XTerm*jumpScroll: on This must point to a directory containing the
XTerm*reverseWrap: on locale.alias file and Compose and XLC_LOCALE file
XTerm*curses: on hierarchies for all locales. The default value is
XTerm*Font: 6x10 <XRoot>/lib/X11/locale, i.e. normally
XTerm*scrollBar: on /usr/X11R6/lib/X11/locale.
XTerm*scrollbar*thickness: 5
XTerm*multiClickTime: 500 XENVIRONMENT
XTerm*charClass: 33:48,37:48,45-47:48,64:48 This must point to a file containing X resources.
XTerm*cutNewline: off The default is $HOME/.Xdefaults-<hostname>. Unlike
XTerm*cutToBeginningOfLine: off <XRoot>/lib/X11/Xresources, it is consulted each
XTerm*titeInhibit: on time an X application starts.
XTerm*ttyModes: intr ^c erase ^? kill ^u
XLoad*Background: gold XFILESEARCHPATH
XLoad*Foreground: red This must contain a colon separated list of path
XLoad*highlight: black templates, where libXt will search for resource
XLoad*borderWidth: 0 files. The default value consists of
emacs*Geometry: 80x65-0-0
emacs*Background: rgb:5b/76/86 <XRoot>/lib/X11/%L/%T/%N%C%S:\
emacs*Foreground: white <XRoot>/lib/X11/%l/%T/%N%C%S:\
emacs*Cursor: white <XRoot>/lib/X11/%T/%N%C%S:\
emacs*BorderColor: white <XRoot>/lib/X11/%L/%T/%N%S:\
emacs*Font: 6x10 <XRoot>/lib/X11/%l/%T/%N%S:\
xmag*geometry: -0-0 <XRoot>/lib/X11/%T/%N%S
xmag*borderColor: white
i.e. normally
If these resources were stored in a file called .Xre-
sources in your home directory, they could be added to any /usr/X11R6/lib/X11/%L/%T/%N%C%S:\
existing resources in the server with the following com- /usr/X11R6/lib/X11/%l/%T/%N%C%S:\
mand: /usr/X11R6/lib/X11/%T/%N%C%S:\
/usr/X11R6/lib/X11/%L/%T/%N%S:\
% xrdb -merge $HOME/.Xresources /usr/X11R6/lib/X11/%l/%T/%N%S:\
/usr/X11R6/lib/X11/%T/%N%S
This is frequently how user-friendly startup scripts merge
user-specific defaults into any site-wide defaults. All A path template is transformed to a pathname by
sites are encouraged to set up convenient ways of automat- substituting:
ically loading resources. See the Xlib manual section
Resource Manager Functions for more information. %N => name (basename) being searched for
%T => type (dirname) being searched for
ENVIRONMENT %S => suffix being searched for
DISPLAY %C => value of the resource "customization"
This is the only mandatory environment variable. It (class "Customization")
must point to an X server. See section "Display %L => the locale name
Names" above. %l => the locale's language (part before '_')
%t => the locale's territory (part after '_` but before '.')
XAUTHORITY %c => the locale's encoding (part after '.')
This must point to a file that contains authoriza-
tion data. The default is $HOME/.Xauthority. See XUSERFILESEARCHPATH
Xsecurity(7x), xauth(1), xdm(1), Xau(3). This must contain a colon separated list of path
templates, where libXt will search for user depen-
ICEAUTHORITY dent resource files. The default value is:
This must point to a file that contains authoriza-
tion data. The default is $HOME/.ICEauthority. $XAPPLRESDIR/%L/%N%C:\
$XAPPLRESDIR/%l/%N%C:\
LC_ALL, LC_CTYPE, LANG $XAPPLRESDIR/%N%C:\
The first non-empty value among these three deter- $HOME/%N%C:\
mines the current locale's facet for character han- $XAPPLRESDIR/%L/%N:\
dling, and in particular the default text encoding. $XAPPLRESDIR/%l/%N:\
*- *&
$XAPPLRESDIR/%N:\
$HOME/%N These variables influence the X Keyboard Extension.

$XAPPLRESDIR defaults to $HOME, see below. EXAMPLES


The following is a collection of sample command lines for
A path template is transformed to a pathname by some of the more frequently used commands.For more
substituting: information on a particular command, please refer to that
command's manual page.
%N => name (basename) being searched for
%T => type (dirname) being searched for % xrdb $HOME/.Xresources
%S => suffix being searched for % xmodmap -e "keysym BackSpace = Delete"
%C => value of the resource "customization" % mkfontdir /usr/local/lib/X11/otherfonts
(class "Customization") % xset fp+ /usr/local/lib/X11/otherfonts
%L => the locale name % xmodmap $HOME/.keymap.km
%l => the locale's language (part before '_') % xsetroot -solid 'rgbi:.8/.8/.8'
%t => the locale's territory (part after '_` but before '.') % xset b 100 400 c 50 s 1800 r on
%c => the locale's encoding (part after '.') % xset q
% twm
XAPPLRESDIR % xmag
This must point to a base directory where the user % xclock -geometry 48x48-0+0 -bg blue -fg white
stores his application dependent resource files. % xeyes -geometry 48x48-48+0
The default value is $HOME. Only used if XUSERFILE- % xbiff -update 20
SEARCHPATH is not set. % xlsfonts '*helvetica*'
% xwininfo -root
XKEYSYMDB % xdpyinfo -display joesworkstation:0
This must point to a file containing nonstandard % xhost -joesworkstation
keysym definitions. The default value is % xrefresh
<XRoot>/lib/X11/XKeysymDB, i.e. normally % xwd | xwud
/usr/X11R6/lib/X11/XKeysymDB. % bitmap companylogo.bm 32x32
% xcalc -bg blue -fg magenta
XCMSDB This must point to a color name database file. The % xterm -geometry 80x66-0-0 -name myxterm $*
default value is <XRoot>/lib/X11/Xcms.txt, i.e. % xon filesysmachine xload
normally /usr/X11R6/lib/X11/Xcms.txt.
DIAGNOSTICS
XFT_CONFIG A wide variety of error messages are generated from vari-
This must point to a configuration file for the Xft ous programs. The default error handler in Xlib (also
library. The default value is <XRoot>/lib/X11/Xft- used by many toolkits) uses standard resources to con-
Config, i.e. normally /usr/X11R6/lib/X11/XftConfig. struct diagnostic messages when errors occur. The
defaults for these messages are usually stored in
RESOURCE_NAME <XRoot>/lib/X11/XErrorDB. If this file is not present,
This serves as main identifier for resources error messages will be rather terse and cryptic.
belonging to the program being executed. It
defaults to the basename of pathname of the pro- When the X Toolkit Intrinsics encounter errors converting
gram. resource strings to the appropriate internal format, no
error messages are usually printed. This is convenient
SESSION_MANAGER when it is desirable to have one set of resources across a
Denotes the session manager the application should variety of displays (e.g. color vs. monochrome, lots of
connect. See xsm(1), rstart(1). fonts vs. very few, etc.), although it can pose problems
for trying to determine why an application might be fail-
XF86BIGFONT_DISABLE ing. This behavior can be overridden by the setting the
Setting this variable to a non-empty value disables StringConversionsWarning resource.
the XFree86-Bigfont extension. This extension is a
mechanism to reduce the memory consumption of big To force the X Toolkit Intrinsics to always print string
fonts by use of shared memory. conversion error messages, the following resource should
be placed in the file that gets loaded onto the
XKB_FORCE RESOURCE_MANAGER property using the xrdb program (fre-
XKB_DISABLE quently called .Xresources or .Xres in the user's home
XKB_DEBUG directory):
_XKB_CHARSET
_XKB_LOCALE_CHARSETS *StringConversionWarnings: on
_XKB_OPTIONS_ENABLE
_XKB_LATIN1_LOOKUP To have conversion messages printed for just a particular
_XKB_CONSUME_LOOKUP_MODS application, the appropriate instance name can be placed
_XKB_CONSUME_SHIFT_AND_LOCK before the asterisk:
_XKB_IGNORE_NEW_KEYBOARDS
_XKB_CONTROL_FALLBACK xterm*StringConversionWarnings: on
_XKB_COMP_LED _XKB_COMP_FAIL_BEEP
*0 *
SEE ALSO
XProjectTeam(7x), XStandards(7x), Xsecurity(7x),
appres(1), bdftopcf(1), bitmap(1), editres(1), fsinfo(1),
fslsfonts(1), fstobdf(1), iceauth(1), imake(1), lbx-
proxy(1), makedepend(1), mkfontdir(1), oclock(1), proxym-
ngr(1), rgb(1), resize(1), rstart(1), smproxy(1), twm(1),
x11perf(1), x11perfcomp(1), xauth(1), xclipboard(1),
xclock(1), xcmsdb(1), xconsole(1), xdm(1), xdpyinfo(1),
xfd(1), xfindproxy(1), xfs(1), xfwp(1), xhost(1),
xieperf(1), xinit(1), xkbbell(1), xkbcomp(1), xkbevd(1),
xkbprint(1), xkbvleds(1), xkbwatch(1), xkill(1), xlogo(1),
xlsatoms(1), xlsclients(1), xlsfonts(1), xmag(1), xmh(1),
xmodmap(1), xon(1), xprop(1), xrdb(1), xrefresh(1),
xrx(1), xset(1), xsetroot(1), xsm(1), xstdcmap(1),
xterm(1), xwd(1), xwininfo(1), xwud(1). Xserver(1),
Xdec(1), XmacII(1), Xsun(1), Xnest(1), Xvfb(1),
XFree86(1), XDarwin(1), kbd_mode(1), Xlib - C Language X
Interface, and X Toolkit Intrinsics - C Language Interface

TRADEMARKS
X Window System is a trademark of X Consortium, Inc.

AUTHORS
A cast of thousands, literally. The Release 6.3 distribu-
tion is brought to you by X Consortium, Inc. The names of
all people who made it a reality will be found in the
individual documents and source files. The staff members
at the X Consortium responsible for this release are:
Donna Converse (emeritus), Stephen Gildea (emeritus),
Kaleb Keithley, Matt Landau (emeritus), Ralph Mor (emeri-
tus), Janet O'Halloran, Bob Scheifler, Ralph Swick, Dave
Wiggins (emeritus), and Reed Augliere.

The X Window System standard was originally developed at


the Laboratory for Computer Science at the Massachusetts
Institute of Technology, and all rights thereto were
assigned to the X Consortium on January 1, 1994. X Con-
sortium, Inc. closed its doors on December 31, 1996. All
rights to the X Window System have been assigned to the
Open Software Foundation.

4.2.0 Version X(7x)

Vous aimerez peut-être aussi