156
! "#$%& "#$%& #( #( & #) $ #) $ * + + #$&, #$& - #$&, #$& & #$ #$& . . * (+ (+ (( (( ! (% (% (+/&, (+/& & (. (. 0 +$1 +$1 ! %(/"& 23,, %(/"& ! %+ %+ !’ %$( %$( %$+ 45.$6 %$+ ’ %/"& %/"& + + ’- #.((& #.((&-* #.(+& #.(+& - - +( +( -& ( (-0 $& /7, ,2$& &* " " & / / &’ /#& /#& &- +// +// && #& ,#& $ $ ! /#+ /#+- / / 0 /7, 2,, , , ! ,5 ,5 & ,5 ,5 &* +/ +/ &- $+8&, $+8& &- "( "( &0 "%/& , "%/& 0* "$#( "$#( 0 #+ #+0 #.$&, #.$& 0 1 1 *’ $+ $+ *& $#. $#. *0 //)( .//)( * / / )( ) ( - &, & & +##& , +##& 0 +$+& /7, 3 +$+& * ( ( & , & /.(#)$&, /.(#)$& /# /# & /8 /8 ! /. /. !- /8$ %/% /8$!0 /8/"#(& /7,,2 /8/"#(& * & 0 ++ ++’ +$+/7, 2,, ’! # . # - 8 8 &* .$+ .$+ & .(+( .(+(& ./+((& ./+((& & ./+(+& ./+(+&&’ ) . ) &’ ) ) &- ) . ) && ) ) &0 )# )# 0* ) + 923,, ) + 0 6- 6%&’ 6- 0

Man Des Commandes Linux

  • Upload
    m4kn4sh

  • View
    629

  • Download
    6

Embed Size (px)

Citation preview

Page 1: Man Des Commandes Linux

������������������������

����� �������� ���������������������������������������������������������������������������������������������������������������������������������� �

��������������� �������������������������������������������������������������������������������������������������������������������������������� �

������ �������� ������������������������������������������������������������������������������������������������������������������������������ ��

������ �������� ������������������������������������������������������������������������������������������������������������������������������ ��

��� ����������� ����������������������� �������������������������������������������������������������������������������������������������� �!

��"�#$%���&������������"�#$%���&�������������������������������������������������������������������������������������������������������������������� �'

���#(���������� �����������������������#(���������������������������������������������������������������������������������������������� �&��#)$���������� ����������������������#)$���������������������������������������������������������������������������������������������� �*

��+� ���������� ����������������������+� ������������������������������������������������������������������������������������������������� ��

����� �������� �������������������������������������������������������������������������������������������������������������������������������� ��

� #$�&�������� ����� ,����������������� #$�&�������������������������������������������������������������������������������������������� �-

� #$�&�������� ����� ,����������������� #$�&�������������������������������������������������������������������������������������������� �&

� #$������������� �������������������������� #$������������������������������������������������������������������������������������ �&

�.���� �������� �����������������������.������������������������������������������������������������������������������������������������������ �*

(��+����������� ��������������������(��+�������������������������������������������������������������������������������������������������� ��

((��� �������� �����������������������((������������������������������������������������������������������������������������������������������ �!

(%��� �������� �����������������������(%������������������������������������������������������������������������������������������������������� �'

(�+/��&������� ����� ,���������������(�+/��&����������������������������������������������������������������������������������������� �&

(.��� �������� �����������������������(.������������������������������������������������������������������������������������������������������ �0+$1������������ ���������������������+$1����������������������������������������������������������������������������������������������������� !�

%(�/"�&��������� ���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���������������� +$��+�&���������������������������������������������������������������������������������������� ��*

���� �������� ����������������������� ����������������������������������������������������������������������������������������������������� ���

�(� ����������� ������������������� �(� ��������������������������������������������������������������������������������������������� ���

���&� ������� ����� ,����������������� ���&�������������������������������������������������������������������������������������������� ���

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

/# ������������ ���������������������/# ��������������������������������������������������������������������������������������������������� ��&

/��8����������� ��������������������/��8�������������������������������������������������������������������������������������������������� �!�

/.���� �������� ����������������������/.����������������������������������������������������������������������������������������������������� �!-

/8$�������������%/%�����/8$��������������������������������������������������������������������������������������������������������������������������������� �!0

/8/"�#�(�&��������/7���,�� ,��������2�������/8/"�#�(�&������������������������������������������������������������������������ ��*��������������� ���������������������������������������������������������������������������������������������������������������������������� ��&

�� ��� �������� ������������������������ ��������������������������������������������������������������������������������������������������� ��0

�++������������ ����������������������++��������������������������������������������������������������������������������������������������� �'�

�+�$+�����/7���,���������2,,� ���������������������������������������������������������������������������������������������������������� �'!

�#���� ������������.����������������#������������������������������������������������������������������������������������������������������������ �-�

��8������������ �����������������������8��������������������������������������������������������������������������������������������������� �&*

.$��+����������� �������������������.$��+������������������������������������������������������������������������������������������ �&�

.�(��+(��������������.�(��+(��������������������������������������������������������������������������������������������������������������������� �&�

./+ �((�&������������./+ �((�&������������������������������������������������������������������������������������������������������������������������� �&�

./+ (+��&������������./+ (+��&�������������������������������������������������������������������������������������������������������������������������� �&'

)��� ������������.�����������������)������������������������������������������������������������������������������������������������������������� �&')�������������� ���������������������)���������������������������������������������������������������������������������������������������� �&-

)������������������.�������������)�������������������������������������������������������������������������������������������������������� �&&

)���� �������� �����������������������)����������������������������������������������������������������������������������������������������� �&0

)�#������������ ���������������������)�#������������������������������������������������������������������������������������������������� �0*

) ��+����������� �9�23��,,���������) ��+������������������������������������������������������������������������������������������� �0�

6�-�� �������6%���&'�������6�-������������������������������������������������������������������������������������������������������������������������������ �0�

Page 2: Man Des Commandes Linux

����� ������� ����������������� ���������

NOM at, batch, atq, atrm - Mémoriser, examiner ou supprimer des jobs à exécuter ultérieurement.

SYNOPSIS at [-V] [-q fichier] [-f fichier] [-mldbv] HEURE at -c commande [commande...] atq [-V] [-q fichier] [-v] atrm [-V] commande [commande...] batch [-V] [-q fichier] [-f fichier] [-mv] [HEURE]

DESCRIPTION at et batch lisent, depuis l'entrée standard, ou depuis un fichier, des commandes qu'ils exécuteront ultérieurement, en utilisant /bin/sh.

at lance les commandes indiquées à une heure précise.

atq affiche la liste des commandes en attente d'exécution, sauf si l'appelant est le Super-Util- isateur. Dans ce dernier cas, atq affiche la liste des travaux en attente pour tous les utilisateurs.

atrm efface les travaux en attente.

batch exécute les commandes indiquées lorsque la charge système le permet, c'est à dire lorsque la charge du processeur, obtenue depuis le fichier /proc/loadavg descend en dessous de 1,5 par défaut, ou en dessous d'une valeur mentionnée explicitement durant l'invocation de atrun.

At permet d'indiquer l'heure de lancement de manière assez complexe.

Il accepte des spécifications de la forme HHMM ou HH:MM pour exécuter un travail à une heure donnée de la journée en cours (ou du lendemain si l'heure mentionnée est déjà dépassée). On peut aussi lui fournir l'un des arguments suivants : midnight (minuit), noon (midi), ou teatime (l'heure du thé, soit 16 heures). Il est également possi- ble de fournir un suffixe du type AM (matin), ou PM (après-midi) avec une heure sur un cadran de 12 heures. On peut indiquer le jour de lancement, en précisant une 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 ou JJ.MM.AA. (NDT : C'est sympa de penser aux gens qui notent le jour avant le mois :-)

On peut indiquer une heure de la forme now(maintenant) + nombre d'unités, où les unités peuvent être minutes, hours, days (jours), ou weeks (semaines) et on peut égale- ment demander à at de déclencher le travail le jour même en ajoutant le suffixe today ou le lendemain en ajoutant tomorrow.

Par exemple, pour lancer une commande à 16 heures, 3 jours plus tard, on peut indiquer at 4pm + 3 days, pour lancer le travail à 10 heures du matin le 31 Juillet, il faut invoquer at 10am Jul 31 et pour lancer une commande à 1 heure du matin le lendemain, effectuez at 1am tomorrow.

!

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- mande at - ou batch - invoquée depuis un shell obtenu par su(1) mémorisera l'U-ID en cours. L'apppelant recevra par courrier (mail) les messages écrits sur les flux de sortie standard et d'erreur standard, s'il y en a. Le courrier sera envoyé en utilisant la commande /bin/mail. Si at est invoquée depuis un shell obtenu par su(1), le courier sera envoyé à l'utilisateur courrespondant au login.

Le Super-Utilisateur peut toujours employer ces commandes. Pour les autres utilisateurs, les permissions sont déter- minées par les fichiers /etc/at.allow et /etc/at.deny.

Si le fichier /etc/at.allow existe, seuls les utilisateurs dont les noms sont mentionnés dans ce fichier peuvent utiliser at.

Si /etc/at.allow n'existe pas, at vérifie si /etc/at.deny existe, et tous les utilisateurs non-mentionnés dans ce fichier ont le droit d'invoquer at.

Si aucun de ces deux fichiers n'existe, seul le Super- utilisateur a le droit d'appeler at.

Un fichier /etc/at.deny vide signifie que tous les util- isateurs ont le droit d'appeler ces commandes, c'est la configuration par défaut.

OPTIONS -V Afficher un numéro de version sur la sortie

d'erreur standard.

-q file Utiliser la file d'attente mentionnée. Une file est designée par une simple lettre, dans l'inter- valle a jusqu'à z, et A jusqu'à Z. La file c est la file d'attente par défaut pour at tandis que la file E est celle par défaut pour batch. Plus les files ont une lettre importante, plus les travaux seront exécutés avec une valeur de gentillesse (voir nice(1)) élevée. Si un travail est enreg- istré dans une file avec une lettre majuscule, il sera transmis à batch à l'heure indiquée. Si l'on invoque atq avec un nom de file spécifique, il ne montrera que les travaux en attente dans cette file.

-m Envoyer un courier à l'utilisateur lorsque le tra- vail est terminé, même s'il n'a rien écrit sur ses flux de sortie.

-f fichier Lire la commande à exécuter dans le fichier et non pas sur l'entrée standard.

-l Est un alias pour atq.

-d Est un alias pour atrm.

-b Est un alias pour batch.

-v Pour atq, afficher les travaux terminés mais pas encore effacés de la file. Pour les autres, afficher les heures de lancement programmées.

Page 3: Man Des Commandes Linux

-c Imprimer sur la sortie standard les travaux men- tionnés sur la ligne de commande.

FICHIERS /var/spool/at /var/spool/at/spool /proc/loadavg /etc/utmp /etc/at.allow /etc/at.deny

VOIR AUSSI cron(1), nice(1), sh(1), umask(2), atrun(8)

BOGUES Sous Linux, batch est tributaire d'un système de fichiers de type proc monté sur le répertoire /proc.

Si le fichier /etc/utmp n'est pas disponible, ou est endommagé, ou si l'utilisateur n'est pas connecté lorsque at est invoquée, le courrier est envoyé a l'U-ID corre- spondant à la variable d'environnement LOGNAME. Si celle- ci est indéfinie ou vide, l'U-ID courant est utilisé par défaut.

At et batch, tels qu'ils sont implementés actuellement, ne sont pas fiables lorsqu'il y a une situation de manque de ressources systèmes. Si c'est régulièrement le cas sur votre site, vous devriez vous orienter vers un autre système de lancements différes, comme nqs.

AUTEURS At a été écrit principalement par Thomas Koenig, [email protected]. Les routines d'analyse des dates et heures sont de David Parsons, [email protected].

TRADUCTION Christophe Blaess, 1997.

Linux 16 Avril 1997 AT(1)

�������� ������� ����������������� ���������

NOM bzip2, bunzip2 - Compression de fichiers par tri de blocs, v0.9.5. bzcat - Décompresser les fichiers sur stdout. bzip2recover - Récupérer des données de fichiers bzip2 endommagés.

SYNOPSIS bzip2 [ -cdfkqstvzVL123456789 ] [ noms_fichiers ... ] bunzip2 [ -fkvsVL ] [ noms_fichiers ... ] bzcat [ -s ] [ noms_fichiers ... ] bzip2recover nom_fichier

DESCRIPTION bzip2 compresse les fichiers en utilisant l'algorithme de compression de texte par tri de blocs de Burrows-Wheeler,

'

et le codage d'Huffman. La compression est généralement nettement meilleure que celle atteinte par des com- presseurs conventionnels basés sur LZ77/LZ78, et approche les performances de la famille des compresseurs statis- tiques PPM.

Les options de ligne de commandes sont délibérément très similaires à celle de GNU gzip, mais elles ne sont pas identiques.

bzip2 attend une liste de noms de fichiers pour accompag- ner les options de ligne de commandes. Chaque fichier est remplacé par une version compressée de lui-même, avec le nom "nom_original.bz2". Un fichier compressé a les mêmes date de modification, les mêmes permissions, et, quand c'est possible, les mêmes propriétés que celles du fichier original, de sorte que ces caractéristiques peuvent cor- rectement être restaurées au moment de la décompression. Le traitement du nom du fichier est naïf dans le sens qu'il n'y a pas de mécanisme pour préserver les noms, per- missions, propriétés et les dates des fichiers situés dans des systèmes de fichiers où ces concepts manquent, ou qui ont des restrictions strictes en ce qui concerne la longueur des noms de fichiers, comme MS-DOS.

bzip2 et bunzip2, par défaut, n'écraseront pas les fichiers existants. Si vous voulez le contraire, utilisez l'option -f.

Si aucun nom de fichier n'est indiqué, bzip2 compresse de l'entrée standard vers la sortie standard. Dans ce cas, bzip2 n'écrira pas la sortie sur un terminal, puisque cela serait incompréhensible et donc inutile.

bunzip2 (ou bzip2 -d) décompresse tous les fichiers 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é à partir de celui du fichier compressé de la manière suiv- ante :

nom_fichier.bz2 devient nom_du_fichier 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 plaindra de ne pas pouvoir deviner le nom du fichier orig- inal, et utilisera le nom du fichier auquel il ajoutera .out à la fin.

Comme pour la compression, ne pas fournir de nom de fichier provoque la décompression de l'entrée standard vers la sortie standard.

bunzip2 décompressera correctement un fichier qui est la concaténation de deux fichiers compressés ou plus. Le résultat est la concaténation de fichiers non compressés correspondants. Le test d'intégrité (-t) des fichiers compressés concaténés est également supporté.

Vous pouvez aussi compresser ou décompresser des fichiers sur la sortie standard en fournissant l'option -c. De multiples fichiers peuvent être compressés et décompressés de cette façon. Les sorties résultantes sont envoyées

Page 4: Man Des Commandes Linux

-

séquentiellement sur stdout. La compression de multiples fichiers d'une telle façon génère un flux contenant de multiples représentations de fichiers compressés. Un tel flux ne peut être décompressé correctement que par bzip2 version 0.9.0 ou ultérieure. Les versions antérieures de bzip2 s'arrêteront après la décompression du premier fichier du flux.

bzcat (ou bzip2 -dc) décompressent tous les fichiers spécifiés sur la sortie standard.

bzip2 lira les arguments dans les variables d'environ- nement BZIP2 et de BZIP, dans cet ordre, et les traitera avant tout argument lu à partir de la ligne de commandes. Ceci donne une façon pratique de fournir des arguments par défaut.

La compression est toujours effectuée, même si le fichier compressé est légèrement plus volumineux que le fichier original. Les fichiers de moins de 100 octets ont ten- dance à s'agrandir, car le mécanisme de compression com- porte toujours un surplus constant d'à peu près 50 octets. Les données aléatoires (incluant la sortie de la plupart des compresseurs de fichiers) sont codées avec à peu près 8.05 bits par octets, ce qui donne une expansion d'environ 0.5%.

En tant que vérification interne, bzip2 utilise des CRC 32bits pour s'assurer que la version décompressée d'un fichier est identique au fichier original. Ceci permet une protection contre la corruption des données com- pressées, et contre des bogues non détectés de bzip2 (heureusement très improbables). La probabilité qu'une corruption de données passe inaperçue est infime, environ une chance sur 4 milliards pour chaque fichier compressé. Soyez conscients, toutefois, que la vérification se pro- duit pendant la décompression, et qu'elle ne peut donc vous informer que lorsque quelque chose s'est mal passé. Cela ne peut pas vous permettre de récupérer les données non compressées originales. Vous pouvez utiliser bzip2recover pour essayer de récupérer des données de fichiers endommagés.

Valeurs de retour : 0 pour une sortie normale, 1 pour des problèmes d'environnement (fichier non trouvé, options invalides, erreurs d'entrée/sortie, etc.), 2 pour indiquer un fichier compressé corrompu, 3 pour une erreur de con- sistance interne (un bogue, p.ex.) qui a fait paniquer bzip2.

OPTIONS -c --stdout

Compresser ou décompresser sur la sortie standard.

-d --decompress Forcer la décompression. bzip2, bunzip2 et bzcat constituent en fait le même programme, et la décision quant aux actions à entreprendre est déterminée sur la base du nom du fichier utilisé. Cette option annule ce mécanisme, et force bzip2 à décompresser.

-z --compress Le complément de -d : force la compression, quel que soit le nom d'invocation.

&

-t --test Tester l'intégrité des fichiers spécifiés, mais ne pas les décompresser. Ceci effectue en fait une décompression de test, et ne s'occupe pas du résul- tat décompressé.

-f --force Force l'écrasement des fichiers en sortie. Nor- malement, bzip2 n'écrasera pas les fichiers de sor- tie préexistants. Force également bzip2 à briser les liens durs (hard links) de fichiers, ce qu'il ne ferait pas autrement.

-k --keep Garder (ne pas effacer) les fichiers d'entrée durant la compression ou la décompression.

-s --small Réduire l'utilisation de la mémoire pour la com- pression, la décompression et la vérification. Les fichiers sont décompressés et testés en utilisant un algorithme modifié qui requiert uniquement 2.5 octets par bloc d'un octet. Cela signifie que tout fichier peut être décompressé dans 2300Ko de mémoire, même s'il le sera à une vitesse deux fois lente que la vitesse normale.

Durant la compression, -s sélectionne une taille de bloc de 200Ko, ce qui limite l'utilisation de mémoire d'a peu près le même nombre, aux dépens du coefficient de compression. Bref, si votre machine possède peu de mémoire vive (8 Mo ou moins), utilisez -s pour tout ce que vous faites. Voir GESTION DE LA MEMOIRE plus bas.

-q --quiet Supprime les messages d'avertissement non essen- tiels. Les messages se rattachant aux erreurs d'E/S et à d'autres événements critiques ne sont pas supprimés.

-v --verbose Mode volubile -- montre le coefficient de compres- sion pour chaque fichier traité. Des -v supplémen- taires augmentent le niveau de volubilité, en affichant des tas d'informations qui sont princi- palement utiles à des fins de diagnostic.

-L --license -V --version Afficher la version du logiciel, les termes et con- ditions d'utilisation.

-1 to -9 Fixe la taille de bloc à 100, 200, ... 900 k pen- dant la compression. Cette option n'a aucun effet sur la décompression. Voir GESTION DE LA MEMOIRE ci-dessous.

-- Traiter tous les arguments ultérieurs en tant que noms de fichiers, même s'ils débutent par un tiret. Ainsi, vous pouvez traiter des fichiers dont les noms commencent par un tiret, par exemple : bzip2 -- -monfichier.

--repetitive-fast --repetitive-best Ces options sont redondantes dans les versions 0.9.5 et ultérieures. Elles fournissent un

Page 5: Man Des Commandes Linux

0

contrôle assez grossier sur le comportement de l'algorithme de tri dans les versions antérieures, ce qui était parfois utile. Les versions 0.9.5 et ultérieures disposent d'un algorithme amélioré qui rend l'usage de ces options inutile.

GESTION DE LA MEMOIRE bzip2 compresse des fichiers importants par blocs. La taille de bloc affecte à la fois le coefficient de com- pression atteint, et le montant de mémoire nécessaire pour la compression et la décompression. Les options -1 à -9 précisent la taille de bloc utilisée, de 100000 octets à 900000 octets (par défaut) respectivement. Au moment de la décompression, la taille de bloc utilisée pour la com- pression est lue à partir de l'entête du fichier com- pressé, et bunzip2 s'alloue ensuite juste assez de mémoire pour décompresser ce fichier. Puisque les tailles de blocs sont conservées dans les fichiers compressés, il s'ensuit que les options -1 à -9 ne sont pas pertinentes, et qu'elles sont donc ignorées durant la décompression.

Les exigences mémoire de la compression et de la décom- pression, en octets, peuvent être estimées à :

Compression : 400Ko + ( 8 x taille de bloc )

Décompression : 100Ko + ( 4 x taille de bloc ), ou 100Ko + ( 2.5 x taille de bloc )

Des largeurs de blocs plus importantes voient les bénéfices marginaux retirés diminuer rapidement. La plu- part de la compression provient des deux ou trois cents premiers ko de taille de bloc, un fait à retenir quand on utilise bzip2 sur de petites machines. Il est également important de savoir que les exigences mémoire de la décom- pression sont fixées au moment de la compression par le choix d'une taille de bloc.

Pour les fichiers compressés avec la taille de bloc par défaut de 900Ko, bunzip2 aura besoin d'environ 3700 Ko pour la décompression. Pour permettre la décompression de tout fichier sur une machine avec 4 Mo de RAM, bunzip2 possède une option pour décompresser en n'utilisant que la moitié environ de ces 3700 Ko, à savoir à peu près 2300 Ko. Malheureusement, la vitesse de décompression est également réduite de moitié, et donc vous ne devriez utiliser cette option (-s) qu'en cas de nécessité absolue.

En général, essayez d'utiliser la taille de bloc mémoire la plus grande permise, puisque cela maximise la qualité de la compression atteinte. Les vitesses de compression et de décompression ne sont en fait pas affectées par la taille de bloc.

Un autres aspect significatif s'applique aux fichiers qui peuvent tenir dans un seul bloc -- ç.à.d. la plupart des fichiers que vous rencontrez en utilisant une grande taille de bloc. Le montant réel de mémoire utilisée est proportionnel à la taille du fichier, puisque le fichier est plus petit qu'un bloc. Par exemple, compresser un fichier de 20000 octets avec l'option -9 forcera le com- presseur à allouer environ 7600 Ko de mémoire, mais n'en utilisera réellement que 400 Ko + 20000 * 8 = 560 Ko. De même, le décompresseur allouera 3700 Ko mais n'utilisera que 100 Ko + 20000 * 4 = 180 Ko.

�*

Voici une table qui résume l'utilisation maximale de la mémoire pour différentes tailles de blocs, ainsi que la taille compressée totale de 14 fichiers du Calgary Text Compression Corpus totalisant 3141622 octets. Cette table 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 fichiers plus imposants, car le Corpus est dominé par des petits fichiers.

Usage Usage Usage Taille du

Option compr. décompr. décompr. -s Corpus

-1 1200 k 500 k 350 k 914704 -2 2000 k 900 k 600 k 877703 -3 2800 k 1300 k 850 k 860338 -4 3600 k 1700 k 1100 k 846899 -5 4400 k 2100 k 1350 k 845160 -6 5200 k 2500 k 1600 k 838626 -7 6100 k 2900 k 1850 k 834096 -8 6800 k 3300 k 2100 k 828642 -9 7600 k 3700 k 2350 k 828642

RECUPERATION DE DONNEES DE FICHIERS ENDOMMAGES bzip2 compresse les fichiers en blocs d'une longueur d'habituellemnt 900 Ko. Chaque bloc est traité indépen- damment des autres. Si un défaut du support physique ou une erreur de transmission provoque l'endommagement d'un fichier multi-blocs, il peut être possible de récupérer des données à partir des blocs non endommagés du fichier.

La représentation compressée de chaque bloc est délimitée par un motif de 48 bits, ce qui permet de trouver les lim- ites des blocs avec une probabilité raisonnable. Chaque bloc comporte également son propre CRC 32 bits, de sorte que les blocs corrompus peuvent être distingués des autres.

bzip2recover est un simple programme dont le but est de rechercher les blocs dans les fichiers .bz2, et d'écrire chaque bloc détecté dans son propre fichier .bz2. Vous pouvez alors utiliser bzip2 -t pour tester l'intégrité des fichiers résultants, et décompresser ceux qui ne sont pas endommagés.

bzip2recover prend un seul argument, le nom du fichier endommagé, et écrit un certain nombre de fichiers "rec0001file.bz2", "rec0002file.bz2", etc, contenant les blocs extraits. Les noms de fichiers en sortie sont conçus de sorte que l'utilisation de jokers (wildcards) dans des traitements ultérieurs -- par exemple, "bzip2 -dc rec*file.bz2 > données_récupérées" -- liste les fichiers dans le bon ordre.

bzip2recover devrait être utilisé principalement pour traiter les grands fichiers .bz2, puisque ceux-ci contien- nent de nombreux blocs. Il est clairement inutile d'essayer de l'utiliser sur des fichiers endommagés d'un seul bloc, car un seul bloc endommagé ne peut être récupéré. Si vous voulez minimiser toute perte poten- tielle de données à cause d'erreurs de transmission, vous devriez envisager d'utiliser une taille de bloc plus restreinte.

Page 6: Man Des Commandes Linux

��

PERFORMANCES La phase de tri de la compression réunit les chaînes de caractères similaires présentes dans le fichier. A cause de cela, les fichiers contenant de très longues suites de symboles répétés, comme "aabaabaabaab ..." (répétés plusieurs centaines de fois) peuvent être compressés plus lentement que d'habitude. Les versions 0.9.5 et ultérieures se conduisent nettement mieux que les versions 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 antérieures, ce rapport était de 100 pour 1. Vous pouvez 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 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 cache ont donné des améliorations de performances dispro- portionnées. Je suppose que bzip2 se conduira le mieux sur des machines avec de très larges caches.

INCONVÉNIENTS Les messages d'erreurs d'E/S ne sont pas d'une grande utilité. bzip2 essaie vraiment de détecter les erreurs d'E/S et de s'arrêter proprement, mais les détails du problème rencontré peuvent parfois induire en erreur.

Cette page de manuel se rattache à la version 0.9.5 de bzip2. Les données compressées créées par cette version sont entièrement compatibles de façon descendante et 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 peuvent correctement décompresser de multiples fichiers compressés et concaténés. La version 0.1pl2 ne sait pas le faire; elle s'arrêtera après la décompression du pre- mier fichier du flux.

bzip2recover utilise des entiers 32 bits pour représenter les positions des bits dans les fichiers compressés ; de ce fait, il ne peut traiter de fichiers compressés de plus de 512 Mo de long. Ceci pourrait être résolu facilement.

AUTEUR Julian Seward, [email protected].

http://www.muraroa.demon.co.uk

Les idées intégrées à bzip2 sont dues (entre autres) aux personnes suivantes : Michael Burrows et David Wheeler (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 nombreux raffinements), et Alistair Moffat, Radford Neal 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

��

vers les sources de documentation. Christian von Roques m'encouragea à chercher des algorithmes de tri plus rapi- des, pour accélérer la compression. Bela Lubkin m'encour- agea à améliorer la performance de la compression dans le pire des cas. Beaucoup de personnes m'ont envoyé des patchs, aidé pour des problèmes de portabilité, prêté des machines, donné des conseils et ont été généralement utiles.

TRADUCTION Frédéric Delanoy, 2000.

Linux 9 Août 2000 BZIP2(1)

������ ������� ����������������� ���������

NOM cal - Afficher un calendrier.

SYNOPSIS cal [-jy] [[mois] [annee]]

DESCRIPTION Cal affiche un calendrier. Si les arguments sont omis, le mois courant est affiché. Les options sont les suivantes:

-j Affiche les numéros des jours dans l'année (le numéro 1 correspond au 1er Janvier).

-y Affiche le calendrier de l'année courante.

Un paramètre unique indique l'année (1 - 9999) à afficher; noter que l'année doit être complètement spécifiée : ``cal 89'' n'affiche pas le calendrier de 1989. Deux paramètres indiquent le mois (1 - 12) et l'année. S'il n'y a pas de paramètres, le calendrier du mois courant est affiché.

L'année commence le 1er Janvier.

On considère généralement que le passage au calendrier 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 siècle). Les dix jours suivant cette date furent éliminés, et donc le calendrier de ce mois est un peu par- ticulier.

HISTORIQUE La commande cal est apparue dans la version 6 de AT&T UNIX.

TRADUCTION Michel Quercia, 1997.

BSD Expérimental 20 Mai 1997 CAL(1)

Page 7: Man Des Commandes Linux

��

������ ������� ����������������� ���������

NOM cat - Concaténer des fichiers et les afficher sur la sor- tie standard.

SYNOPSIS cat [-benstuvAET] [--number] [--number-nonblank] [--squeeze-blank] [--show-nonprinting] [--show-ends] [--show-tabs] [--show-all] [--help] [--version] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de cat.

cat affiche sur la sortie standard le contenu de chacun des fichiers indiqués (ou le contenu de l'entrée standard si aucun nom de fichier n'est fourni, ou si le nom `-' est indiqué).

OPTIONS -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.

-s, --squeeze-blank Remplacer les lignes blanches consécutives par une seule ligne blanche.

-t Equivalent à -vT.

-u Sans effet - pour compatibilité Unix seulement.

-v, --show-nonprinting Afficher les caractères de contrôles, sauf les sauts de ligne et les tabulations en utilisant la notation `^', et préfixer avec `M-' les caractères ayant leur huitième bit positionné.

-A, --show-all Equivalent à -vET.

-E, --show-ends Afficher un `$' à la fin de chaque ligne.

-T, --show-tabs Afficher le caractère TAB ainsi : `^I'.

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

�!

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 CAT(1)BASH_BUILTINS(1) BASH_BUILTINS(1)

NAME bash, :, ., [, alias, bg, bind, break, builtin, case, cd, command, compgen, complete, continue, declare, dirs, dis- own, echo, enable, eval, exec, exit, export, fc, fg, for, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, type, typeset, ulimit, umask, unalias, unset, until, wait, while - bash built-in commands, see bash(1)

BASH BUILTIN COMMANDSSEE ALSO bash(1), sh(1)

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

�������� ������� ����������������� ���������

NOM chgrp - Changer le groupe propriétaire d'un fichier.

SYNOPSIS chgrp [options] groupe fichier...

Options POSIX : [-R] [--]

Options du draft d'Austin : [-hHLPR]

Description GNU de groupe : [--reference=rfile]

Options GNU (forme courte) : [-cfvR] [--help] [--version] [--]

DESCRIPTION chgrp change l'appartenance de chacun des fichiers indiqués pour qu'ils deviennent propriétés du groupe indiqué.

Le groupe peut être mentionné par son nom ou par un GID numérique.

OPTIONS POSIX -R Modifier récursivement l'appartenance des réper-

toires et de leurs contenus. Continuer la descente même si des erreurs surviennent.

-- Terminer la liste des options.

OPTIONS DU DRAFT D'AUSTIN -h Si un fichier est un lien symbolique, changer le

Page 8: Man Des Commandes Linux

��

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.

-H (half-logical) (Quand elle est fournie conjointement avec -R.) Si un fichier est un lien symbolique vers un réper- toire, changer le groupe du répertoire et des fichiers de la hiérarchie en dessous.

-L (logique) (Quand elle est fournie conjointement avec -R.) Si un fichier rencontré sur la ligne de commande ou durant la traversée de l'arborescence est un lien symbolique vers un répertoire, changer le groupe du répertoire et des fichiers de la hiérarchie en dessous.

-P (physique) (Quand elle est fournie conjointement avec -R.) Si 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 de leurs contenus.

DESCRIPTION GNU DE GROUPE Une extension GNU (nouvelle dans les fileutils 4.0) permet d'utiliser --reference=rfile comme une description de groupe : on considèrera le groupe auquel appartient le fichier rfile.

OPTIONS GNU -c, --changes

Décrire seulement les fichiers dont l'appartenance change effectivement.

-f, --silent, --quiet Ne pas afficher de message d'erreur concernant les fichiers dont le groupe ne peut pas être modifié.

-h, --no-dereference Agir sur un lien symbolique lui-même plutôt que sur l'objet vers lequel il pointe. Disponible unique- ment si l'appel-système lchown est fourni.

-v, --verbose Décrire les modifications d'appartenance.

-R, --recursive Modifier récursivement l'appartenance des réper- toires et de leurs contenus. Continuer la descente même si des erreurs surviennent.

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

puis terminer correctement.

--version Afficher le numéro de version sur la sortie stan- dard, puis terminer correctement.

�'

ENVIRONNEMENT LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa- tions habituelles. Sur un système conforme XSI, NLSPATH a la signification normale.

CONFORMITÉ POSIX 1003.2 ne documente que l'option -R. Toutes les autres options peuvent ne pas être portables.

NOTES Cette page décrit la version de chgrp trouvée dans le paquetage fileutils-4.0, d'autres versions peuvent différer légèrement.

TRADUCTION Christophe Blaess, 1997.

FSF 30 Août 2000 CHGRP(1)

����� !���"� ���������� !���"�

NAME chkconfig - updates and queries runlevel information for system services

SYNOPSIS chkconfig --list [name] chkconfig --add name chkconfig --del name chkconfig [--level levels] name <on|off|reset> chkconfig [--level levels] name

DESCRIPTION chkconfig provides a simple command-line tool for main- taining the /etc/rc[0-6].d directory hierarchy by reliev- ing system administrators of the task of directly manipu- lating the numerous symbolic links in those directories.

This implementation of chkconfig was inspired by the chk- config command present in the IRIX operating system. Rather than maintaining configuration information outside of the /etc/rc[0-6].d hierarchy, however, this version directly manages the symlinks in /etc/rc[0-6].d. This leaves all of the configuration information regarding what services init starts in a single location.

chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service.

When chkconfig is run without any options, it displays usage information. If only a service name is given, it checks to see if the service is configured to be started in the current runlevel. If it is, chkconfig returns true; otherwise it returns false. The --level option may be used

Page 9: Man Des Commandes Linux

�-

to have chkconfig query an alternative runlevel rather than the current one.

If one of on, off, or reset is specified after the service name, chkconfig changes the startup information for the specified service. The on and off flags cause the service to be started or stopped, respectively, in the runlevels being changed. The reset flag resets the startup informa- tion for the service to whatever is specified in the init script in question.

By default, the on and off options affect only runlevels 3, 4, and 5, while reset affects all of the runlevels. The --level option may be used to specify which runlevels are affected.

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.

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.

--add name

This option adds a new service for management by chkconfig. When a new service is added, chkconfig ensures that the service has either a start or a kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appro- priate entry as specified by the default values in the init script.

--del name The service is removed from chkconfig management, and any symbolic links in /etc/rc[0-6].d which per- tain to it are removed.

--list name This option lists all of the services which chkcon- fig knows about, and whether they are stopped or started in each runlevel. If name is specified, information in only display about service name.

RUNLEVEL FILES Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list. The second line contains a description for the service, and may be extended across multiple lines with backslash continuation.

For example, random.init has these three lines: # chkconfig: 2345 20 80

�&

# description: Saves and restores system entropy pool for \ # higher quality random number generation. This says that the random script should be started in lev- els 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80. You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored.

SEE ALSO init(8) ntsysv(8) serviceconf(8)

AUTHOR Erik Troan <[email protected]>

Wed Oct 8 1997 CHKCONFIG(8)

����#���������� ����������������� �����#���

NOM chmod - Modifier les autorisations d'accès à un fichier.

SYNOPSIS chmod [options] mode fichier...

Options POSIX : [-R]

Options GNU (forme courte): [-cfvR] [--help] [--version] [--]

DESCRIPTION chmod modifie les permissions d'accès de chacun des fichiers indiqués, en suivant l'indication de mode, qui peut être une représentation symbolique du changement à effectuer, ou un nombre octal représentant le motif binaire des nouvelles autorisations.

Le format symbolique des changements de mode est `[ugoa...][[+-=][rwxXstugo...]...][,...]'.

Plusieurs opérations symboliques peuvent être séparées par des virgules.

Une combinaison des lettres `ugoa' contrôle la catégorie d'accès à modifier. Il peut s'agir de l'utilisateur possédant le fichier (u), des autres utilisateurs du même groupe que le fichier (g), des utilisateurs n'appartenant pas au groupe du fichier (o), ou de tous les utilisateurs (a). Si aucune catégorie n'est indiquée, l'ensemble (a) est pris par défaut, mais les bits correspondant à des bits à 1 du umask ne sont pas affectés.

L'opérateur `+' autorise un accès, l'opérateur `-' inter- dit un accès, et l'opérateur `=' autorise exclusivement l'accès indiqué.

Les lettres `rwxXstugo' sélectionne le type d'autorisation

Page 10: Man Des Commandes Linux

�0

concernée :

r lecture,

w écriture,

x exécution (ou parcours pour les répertoires),

X exécution, uniquement si le fichier est un réper- toire, ou s'il a déjà une autorisation d'exécution pour une des catégories d'utilisateur (s'il s'agit donc bien d'un fichier exécutable),

s utiliser l'ID du propriétaire ou du groupe pro- priétaire du fichier lors de l'exécution,

t (sticky-bit) conserver le code du programme sur le péripherique de swap après exécution. Non documenté par POSIX, il s'agit du comportement original, mais de nos jours il sert uniquement pour les réper- toires. Il indique que seuls le propriétaire du répertoire, et le propriétaire d'un fichier qui s'y trouve ont le droit de supprimer ce fichier. C'est typiquement utilisé pour les répertoires comme /tmp ayant une autorisation d'écriture générale.

u les permissions dont dispose actuellement le pro- priétaire du fichier,

g les permissions dont disposent actuellement les autres membres du groupe propriétaire du fichier,

o les permissions dont disposent tous les autres utilisateurs.

Une valeur numérique pour le mode est constituée de 1 à 4 chiffres en octal (0 a 7), calculés en additionnant les bits de valeurs 4, 2, et 1. Un bit non mentionné étant considéré comme nul. Le premier chiffre correspond aux attributs Set-UID (4), Set-GID (2), et conservation du code en mémoire [`stickyi bit'] (1). Le second chiffre correspond aux autorisations de lecture (4), écriture (2) 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.

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 rencontre lors des descentes récursives de répertoires.

OPTIONS POSIX -R Modifier récursivement les autorisations des réper- toires et de leurs contenus.

OPTIONS GNU -c, --changes

Ne décrire que les fichiers dont les permissions ont réellement changé.

-f, --silent, --quiet

�*

Ne pas afficher de messages d'erreurs concernant les fichiers dont les autorisations n'ont pas pu être modifiées.

-v, --verbose Décrire les modifications apportées.

-R, --recursive Modifier récursivement les autorisations des réper- toires et de leurs contenus.

--help Afficher un message d'aide, et terminer normale- ment.

--version Afficher le numéro de version et terminer normale- ment.

ENVIRONNEMENT LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa- tions habituelles.

CONFORMITÉ POSIX 1003.2 ne documente que l'option -R. Toutes les autres options peuvent ne pas être portables.

POSIX ne décrit pas l'utilisation du bit `t' (sticky). Le standard ne précise pas non plus si chmod doit préserver la cohérence en effaçant ou en refusant de positionner les bits Set-UID ou Set-GID si tous les bits d'exécution sont effacés.

Nous avons décrit plus haut le comportement du bit `t' sur les répertoires. Chaque système attache une signification personnel à ce bit. En particulier Linux adopte le com- portement de System V (void SVID version 3), en utilisant le bit Set-GID des fichiers sans autorisation d'exécution pour le groupe comme un verrou. Pour plus de détails voyez le fichier /usr/src/linux/Documentation/mandatory.txt.

TRADUCTION Christophe Blaess, 1997.

FSF 29 Novembre 1996 CHMOD(1)

���$ ��� ������� ����������������� ����$ ���

NOM chown - Modifier le propriétaire et le groupe d'un fichier.

SYNOPSIS chown [options] proprietare[:groupe] fichier...

Options POSIX : [-R]

Options GNU (forme courte): [-cfhvR] [--help] [--version] [--]

DESCRIPTION

Page 11: Man Des Commandes Linux

��

([NDT] chown = Change Owner).

chown modifie l'utilisateur et/ou le groupe propriétaire de chacun des fichiers indiqués, en fonction du premier argument rencontré sur la ligne de commande, et qui ne soit pas une option.

Si l'on indique uniquement un nom d'utilisateur (ou un UID numérique), celui-ci devient le propriétaire des fichiers donnés, mais les groupes de ces fichiers ne sont pas mod- ifiés.

Si le nom d'utilisateur est suivi d'un double-point, et d'un nom de groupe (ou d'un GID numérique), les fichiers changent également de groupe.

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é.

Si l'on fournit un nom de groupe, précédé d'un double- point, mais sans préciser de nom d'utilisateur, seul l'appartenance au groupe est modifiée. Dans ce cas, chown a les mêmes effets que chgrp.

OPTIONS POSIX -R Modifier récursivement l'appartenance des réper-

toires et de leurs contenus.

OPTIONS GNU -c, --changes

Ne décrire que les fichiers dont l'appartenance est modifiée.

-f, --silent, --quiet Ne pas afficher de message d'erreur concernant les fichiers dont l'appartenance n'a pas pu être mod- ifiée.

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

-R, --recursive Modifier récursivement l'appartenance des réper- toires et de leurs contenus.

--help Afficher un message d'aide sur la sortie standard, et terminer normalement.

--version Afficher le numéro de version sur la sortie stan- dard, et terminer normalement.

��

ENVIRONNEMENT LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significa- tions habituelles.

CONFORMITÉ POSIX 1003.2 n'autorise pas l'utilisation du point comme séparateur de nom d'utilisateur et de groupe.

TRADUCTION Christophe Blaess, 1997.

FSF 15 Décembre 1998 CHOWN(1)

��%����� ������� ����������������� ���%�����

NOM clear - Effacer l'écran du terminal.

SYNOPSIS clear

DESCRIPTION clear efface votre écran si c'est possible. Il cherche dans l'environnement le type de terminal et ensuite con- sulte la base de données terminfo pour voir comment effacer l'écran.

VOIR AUSSI tput(1), terminfo(5)

TRADUCTION Frédéric Delanoy, 2000.

Linux 23 Août 2000 CLEAR(1)

����� ������� ����������������� ���������

NOM cp - Copier des fichiers.

SYNOPSIS cp [options] fichier chemin cp [options] fichier... répertoire

Options POSIX : [-fipRr]

Options GNU (forme courte) : [-abdfilprsuvxPR] [-S SUF- FIXE] [-V {numbered,existing,simple}] [--sparse=WHEN] [--help] [--version] [--]

Page 12: Man Des Commandes Linux

��

DESCRIPTION cp sert à copier des fichiers (et eventuellement des répertoires). On peut aussi bien copier un fichier donné vers une destination précise que copier un ensemble de fichiers dans un répertoire.

Si le dernier argument correspond à un nom de répertoire, cp copie dans ce répertoire chaque fichier indiqué en con- servant le même nom.

Sinon, s'il n'y a que deux fichiers indiqués, il copie le premier sur le second.

Une erreur se produit si le dernier argument n'est pas un répertoire, et si plus de deux fichiers sont indiqués. Par défaut, on n'effectue pas la copie de répertoires.

Ainsi `cp -r /a /b' copiera /a dans /b/a et /a/x dans /b/a/x au cas où /b existe déjà, mais il copiera /a sur /b et /a/x dans /b/x si /b n'existait pas encore.

Les autorisations d'accès des fichiers et des répertoires créés seront les mêmes que celles des fichiers d'origine masquées avec un ET binaire avec 0777, et modifiées par le umask de l'utilisateur (sauf si l'on invoque l'option -p).

Pendant la copie récursive de répertoires, les nouveaux répertoires verront leur masque temporairement étendu par un OU binaire avec S_IRWXU (0700), afin d'autoriser le processus d'y lire, écrire et vérifier le contenu.

cp ne fait rien lorsque l'on tente de copier un fichier sur lui-même (sauf éventuellement afficher un message d'erreur).

Lorsque la copie se fait sur un fichier existant, celui-ci est ouvert en utilisant `open(chemin, O_WRONLY | O_TRUNC)'. Lorsque la copie a lieu dans un nouveau fichier, on invoque `open(chemin, O_WRONLY | O_CREAT, mode)'. Si l'ouverture d'un fichier existant échoue, et si l'option -f a été invoquée, cp essaye de supprimer, avec unlink(2), le fichier existant, puis de recréer un nouveau fichier.

OPTIONS POSIX Posix défini quatre options et demi :

-f Effacer les fichiers cibles existants (voir ci- dessus).

-i Interroger l'utilisateur avant d'écraser des fichiers réguliers existants. La question est affichée sur stderr, et la réponse lue depuis stdin.

-p Conserver le propriétaire, le groupe, les permis- sions d'accès et les horodatages du fichier origi- nal. Si la conservation du propriétaire ou du groupe est impossible, les bits Set-UID et Set-GID sont effacés. L'horodatage sera quand même légèrement différent entre l'original et la copie car l'opération de copie nécessite un accès en lec- ture au fichier source.

-R Copier récursivement les répertoires, et gérer cor-

�!

rectement les copies des fichiers spéciaux ou des FIFOs.

-r Copier récursivement les répertoires mais la ges- tion des fichiers spéciaux n'est pas définie. En fait l'option -r est autorisée, et même encouragée à se comporter comme l'option -R, toutefois le com- portement (stupide) de la version GNU n'est pas interdit.

Spécificité GNU En général les fichiers sont écrits immédiatement après lecture de l'original, sauf si l'on utilise l'option --sparse décrite plus bas.

Par défaut, cp ne copie pas les répertoires (voir l'option -r).

cp refuse généralement de copier un fichier sur lui-même, avec l'exception suivante : si les options --force et --backup sont indiquées, et si les fichiers origine et copie sont identiques et se rapportent à un fichier régulier, cp effectuera une copie de sauvegarde (voir plus bas). Ceci peut servir à faire une sauvegarde d'un fichier avant de le modifier.

OPTIONS GNU -a, --archive

Préserver autant que possible la structure et les attributs du fichier original lors de la copie. Cette option est équivalente à -dpR.

-b, --backup Effectuer une copie de sauvegarde des fichiers écrasés ou supprimés.

-d, --no-dereference Copier les liens symboliques en tant que tels plutôt que de copier les fichiers vers lesquels ils pointent. Préserver également les liens matériels entre les fichiers sources durant la copie.

-f, --force Effacer les fichiers cibles existants.

-i, --interactive Interroger l'utilisateur avant d'écraser des fichiers réguliers existants.

-l, --link Effectuer des liens matériels plutôt que des copies des fichiers réguliers.

-P, --parents Construire le nom de chaque fichier destination en ajoutant au répertoire cible un slash et le nom du fichier source indiqué. Le dernier argument de cp doit être un répertoire existant. Par exemple, la commande `cp --parents a/b/c rep_existant' copie le fichier a/b/c en rep_existant/a/b/c, tout en créant les sous-répertoires intermédiaires manquants.

-p, --preserve Conserver le propriétaire, le groupe, les permis- sions d'accès et les horodatages du fichier origi- nal.

Page 13: Man Des Commandes Linux

��

-r Copier récursivement les répertoires, les sous- répertoires, et les fichiers réguliers qu'ils con- tiennent. Les fichiers spéciaux et les FIFOs sont considérés comme des fichiers normaux, desquels ont essayera de lire des données pour les écrire dans le fichier destination. Ainsi `cp' risque de blo- quer indéfiniment durant la lecture d'une FIFO ou d'un fichier spécial /dev/tty. Il faut considérer ceci comme un bug. Cela signifie qu'il faut éviter l'option -r, et la remplacer par -R. N'oublions pas que l'ouverture d'un fichier spécial inconnu, par exemple un scanner peut avoir des effets indésirables sur le matériel.

-r Copier récursivement les répertoires, les sous- répertoires, en préservant tous les types de fichiers rencontrés (voir option -r ci-dessus).

--sparse=QUAND [NDT : sparse = clairsemé] Un fichier à trous (sparse file) contient des séquences d'octets nuls n'occupant pas de place sur le disque. L'appel système `read' lit ces données comme des zéros. Non seulement cela permet d'économiser de la place sur le disque, mais on gagne également de la vitesse de lecture. De nombreux fichiers binaires (exécutables par exemple) contiennent des séquences importantes de zéros. Par défaut, cp détecte les trous dans les fichiers en utilisant une heuristique grossière et restituera les trous dans les fichiers de sortie.

L'argument QUAND peut prendre l'une des valeurs suivantes :

auto Le comportement par défaut, le fichier de sortie est troué si des trous sont détectés dans le fichier d'entrée.

always Toujours trouer les fichiers de sortie. Cette option sert lorsque les fichiers d'entrée se trouvent sur un système de fichiers n'acceptant pas les trous, et que les fichiers de sortie se trouveront sur un système les acceptant.

never Ne jamais essayer de faire de trous dans les fichiers de sortie. Si vous trouvez une utilité à cette option, faites nous le savoir...

-s, --symbolic-link Créer des liens symboliques plutôt que des copies des fichiers réguliers. Tous les noms de fichiers sources doivent être absolus (commençant par '/') à moins que les fichiers destinations résident dans le répertoire en cours. Cette option affiche un message d'erreur pour les systèmes de fichiers ne supportant pas les liens symboliques.

-u, --update Ne pas effectuer la copie si le fichier destination existant (autre qu'un répertoire) a une date de modification égale ou plus récente que celle du fichier source.

-v, --verbose

�'

Afficher le nom de chaque fichier avant de le copier.

-x, --one-file-system Ignorer les sous-répertoires se trouvant sur un système de fichiers différent de celui du départ de la copie.

OPTIONS DE SAUVEGARDE GNU Les versions GNU des programmes comme cp, mv, ln, install et patch créeront au besoin une copie de sauvegarde des fichiers à écraser, à modifier ou à détruire. On demande une copie de sauvegarde à l'aide de l'option -b, on indique la nomenclature à adopter avec l'option -V, et si la sauvegarde se fait avec un suffixe, celui-ci est précisé avec l'option -S.

-b, --backup Créer une copie de sauvegarde des fichiers à écraser ou à détruire.

-S SUFFIXE, --suffix=SUFFIXE Ajouter le SUFFIXE indiqué à chaque fichier de sauvegarde créé. Si cette option n'est pas indiquée, on utilisera la valeur de la variable d'environnement SIMPLE_BACKUP_SUFFIX. Si la vari- able SIMPLE_BACKUP_SUFFIX n'existe pas, la valeur par défaut est `~'.

-V METHODE, --version-control=METHODE Préciser la nomenclature des fichiers de sauvegarde La METHODE indiquée peut être `numbered' (`t'), `existing' (`nil'), ou `never' (`simple'). Si cette option n'est pas indiquée, la valeur de la variable d'environnement VERSION_CONTROL est utilisée, et si la variable VERSION_CONTROL n'existe pas, la valeur par défaut est `existing'.

Cette option correspond à la variable `version-con- trol' sous Emacs. Les METHODES valides (les abbréviations non-ambigües sont acceptées) sont :

t, numbered Toujours faire une sauvegarde numérotée.

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.

never, simple Faire toujours une sauvegarde simple.

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

et terminer correctement.

--version Afficher un numéro de version sur la sortie stan- dard, et terminer correctement.

-- Fin de la liste d'options.

ENVIRONMENT Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significations habituelles. Pour la version GNU, les variables SIMPLE_BACKUP_SUFFIX et VERSION_CONTROL con-

Page 14: Man Des Commandes Linux

�-

figurent la nomenclature adoptée pour les sauvegardes de fichiers.

CONFORMITÉ POSIX 1003.2.

TRADUCTION Christophe Blaess, 1997.

FSF 5 Mai 1999 CP(1)

��� �"� ������ ����� &������������� ����� �"�

NOM cron - Démon permettant de lancer des commandes différées (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 '&'.

Cron recherche dans le répertoire /var/spool/cron, des fichiers de crontab ayant des noms existants dans /etc/passwd. Les fichiers trouvés sont chargés en mémoire. Cron recherche également /etc/crontab, qui a un format différent (voir crontab(5)).

Ensuite, cron s'éveille toutes les minutes, examine les crontabs mémorisés, et vérifie chaque commande pour savoir s'il doit la lancer dans la minute à venir. Lors de l'exécution d'une commande, toute sortie est envoyée par mail au propriétaire de la crontab (ou à l'utilisateur dont le nom est mentionné dans la variable d'environnement MAILTO si elle existe).

De plus, cron vérifie chaque minute si la date de modifi- cation de son répertoire de stockage (ainsi que la date de /etc/crontab) a changé. Si c'est le cas, cron examinera les dates de modifications de chaque fichier crontab, et rechargera ceux qui ont été changés. Ainsi, cron n'a pas besoin d'être redémarré après la modification d'un fichier crontab. Notez que la commande crontab(1) met à jour la date de modification du répertoire de stockage si un changement a lieu.

VOIR AUSSI crontab(1), crontab(5)

AUTEUR Paul Vixie <[email protected]>

TRADUCTION Christophe Blaess, 1998.

�&

Linux 12 Décembre 1998 CRON(8)

��� �"� ������ ����� &������������� ����� �"�

NOM cron - Démon permettant de lancer des commandes différées (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 '&'.

Cron recherche dans le répertoire /var/spool/cron, des fichiers de crontab ayant des noms existants dans /etc/passwd. Les fichiers trouvés sont chargés en mémoire. Cron recherche également /etc/crontab, qui a un format différent (voir crontab(5)).

Ensuite, cron s'éveille toutes les minutes, examine les crontabs mémorisés, et vérifie chaque commande pour savoir s'il doit la lancer dans la minute à venir. Lors de l'exécution d'une commande, toute sortie est envoyée par mail au propriétaire de la crontab (ou à l'utilisateur dont le nom est mentionné dans la variable d'environnement MAILTO si elle existe).

De plus, cron vérifie chaque minute si la date de modifi- cation de son répertoire de stockage (ainsi que la date de /etc/crontab) a changé. Si c'est le cas, cron examinera les dates de modifications de chaque fichier crontab, et rechargera ceux qui ont été changés. Ainsi, cron n'a pas besoin d'être redémarré après la modification d'un fichier crontab. Notez que la commande crontab(1) met à jour la date de modification du répertoire de stockage si un changement a lieu.

VOIR AUSSI crontab(1), crontab(5)

AUTEUR Paul Vixie <[email protected]>

TRADUCTION Christophe Blaess, 1998.

Linux 12 Décembre 1998 CRON(8)

��� ������ ������� ����������������� ���������� ������

NOM crontab - Editer son fichier crontab personnel.

Page 15: Man Des Commandes Linux

�0

SYNOPSIS crontab [ -u utilisateur ] fichier crontab [ -u utilisateur ] { -l | -r | -e }

DESCRIPTION Crontab est le programme utilisé pour installer, désin- 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 fichier deny existe, alors vous ne devez pas être men- tionnés dans celui-ci, si vous désirez utiliser cette com- mande. Si aucun de ces deux fichiers n'existe alors, selon la configuration du site, soit le Super-utilisateur uniquement à le droit d'utiliser crontab, soit tous les utilisateurs le peuvent.

Si l'option -u est indiquée, elle permet de préciser le nom de l'utilisateur dont la crontab doit être manipulée. Si cette option n'est pas indiquée, crontab examiner "votre" table, c'est à dire la table de la personne invo- quant la commande.

Notez qu'un appel à su(8) peut induire crontab en erreur. Ainsi si vous avez effectué un su(8) vous devez toujours utiliser l'option -u par précaution.

La première forme de cette commande sert à installer une nouvelle table crontab, en utilisant le fichier indiqué, ou l'entrée standard si le nom de fichier est ``-''.

L'option -l permet d'imprimer la table crontab en cours sur la sortie standard.

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

L'option -e permet d'éditer la table en cours, en util- isant l'éditeur indiqué par les variables d'environnement VISUAL ou EDITOR. Une fois que vous sortez de l'éditeur, la table modifiée sera installée automatiquement.

VOIR AUSSI crontab(5), cron(8)

FICHIERS /etc/cron.allow /etc/cron.deny

STANDARDS La commande crontab est conforme au standard IEEE Std1003.2-1992 (``POSIX''). Cette nouvelle syntaxe diffère des versions précédentes de Vixie Cron, tout autant que de la syntaxe SVR3 classique.

DIAGNOSTIQUE Un gentil message d'aide est affiché si vous invoquez crontab avec des arguments erronés.

AUTEURS Paul Vixie <[email protected]>

�*

TRADUCTION Christophe Blaess, 1997.

Linux 22 Avril 1997 CRONTAB(1)

�'���� ������� ����������������� ����'����

NOM cut - Supprimer une partie de chaque ligne d'un fichier.

SYNOPSIS cut {-b liste_octets, --bytes=liste_octets} [-n] [--help] [--version] [fichier...]

cut {-c character-list, --characters=liste_caractères} [--help] [--version] [fichier...]

cut {-f liste_champs, --fields=liste_champs} [-d sépara- teur] [-s] [--delimiter=séparateur] [--only-delimited] [--help] [--version] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de cut.

cut affiche une partie de chaque ligne de chacun des fichiers mentionnés, ou de l'entrée standard si aucun fichier n'est indiqué. Un nom de fichier `-' correspond également à l'entrée standard.

La partie affichée est sélectionnée par les options présentées ci-dessous.

OPTIONS Les liste_d_octets, liste_de_caractères, et liste_de_champs se présentent sous forme d'un ou plusieurs nombres ou intervalles (deux nombres séparés par un tiret), séparés par des virgules. La numérotation des octets, caractères ou champs commence à 1. Des inter- valles incomplets peuvent être indiqués : `-m' signifiant `1-m'; `n-' signifiant de `n' à la fin de la ligne.

-b, --bytes liste_d_octets Afficher uniquement les octets aux positions indiquées dans la liste_d_octets. Les tabulations et les caractères BackSpaces sont traités comme tous les autres caractères, ils occupent 1 octet.

-c, --characters liste_de_caractères Afficher uniquement les caractères aux positions indiquées dans la liste_de_caractères. Pour l'instant c'est équivalent à -b, mais cette option différera avec l'internationalisation. Les tabula- tions et les caractères BackSpaces sont traités comme tous les autres caractères, ils occupent 1 caractère.

-f, --fields liste_de_champs N'afficher que les champs indiqués dans la liste_de_champs. Les champs sont séparés, par

Page 16: Man Des Commandes Linux

��

défaut, par une Tabulation.

-d, --delimiter séparateur Avec -f, les champs sont délimités par le premier caractère du séparateur à la place de la Tabula- tion.

-n Ne pas couper les caractères multi-octets (sans effet pour le moment).

-s, --only-delimited Avec -f, ne pas afficher les lignes qui ne contien- nent pas le caractère séparateur de champs.

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

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 CUT(1)

#��%���� ������� ����������������� �#��%����

NOM date - Afficher ou configurer la date et l'heure du système.

SYNOPSIS date [-u] [-d chaîne_date] [-s chaîne_date] [--utc] [--universal] [--date=chaîne_date] [--set=chaîne_date] [--help] [--version] [+FORMAT] [MMJJhhmm[[SS]AA][.ss]]

DESCRIPTION Cette page de manuel documente la version GNU de date.

date sans argument affiche la date et l'heure actuelles (avec le format indiqué par la directive `%c' décrite plus-bas).

Si un argument commençant par un `+' est indiqué, la date et l'heure sont affichées avec un format contrôlé par cet argument. La structure de la chaîne précisant le format est semblable à celle utilisée avec la fonction strf- time(3).

Les caractères présents dans cette chaîne sont affichés tels quels, sauf les directives, commençant toutes par '%'.

Ces directives sont les suivantes :

% un caractère % littéral.

n saut de ligne

��

t tabulation horizontale

Champs horaires :

%H heure (00..23)

%I heure (01..12)

%k heure ( 0..23)

%l heure ( 1..12)

%M minute (00..59)

%p notation locale pour AM ou PM.

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

%s secondes écoulées depuis le 01-01-1970 à 00:00:00 T.U (extension non standard)

%S secondes (00..61)

%T heure actuelle, (sur 24 heures) (hh:mm:ss)

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

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

%A nom local du jour de la semaine (Dimanche .. Samedi)

%b abréviation locale du nom du mois (Jan..Dec)

%B nom local du mois (Janvier .. Décembre)

%c date et heure locales (Sat Nov 04 12:02:33 EST 1989)

%d jour du mois (01..31)

%D date (mm/jj/aa)

%h comme %b

%j jour de l'année (001..366)

%m mois (01..12)

%U numéro de semaine dans l'année (00..53). La semaine commence le Dimanche.

%w Jour de la semaine (0..6). Le 0 correspond au Dimanche.

%W numéro de semaine dans l'année (00..53). La semaine commence le Lundi.

%x représentation locale de la date (mm/jj/aa)

Page 17: Man Des Commandes Linux

��

%y deux derniers chiffres de l'année (00..99)

%Y année (1970...)

Par défaut, date complète les champs numériques avec des zéros. La version GNU de date dispose des options non standards suivantes :

- (tiret) ne pas compléter le champ

_ (souligne) remplir le champ avec des espaces

Si l'on fournit un argument ne commençant pas par `+', date le considère comme une heure à utiliser pour config- urer l'horloge système. Cet argument doit être constitué uniquement de chiffres, ayant la signification suivante :

MM mois

JJ jour du mois

hh heure

mm minute

SS Deux premiers chiffres de l'année (facultatif)

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

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 chaîne_date. L'affichage est fait avec le format par défaut, à moins qu'un argument commençant par un `+' ne fournisse un autre format

--help Afficher un message d'aide sur la sortie standard, et terminer normalement.

-s chaîne_date, --set chaîne_date Configurer l'horloge système avec la date et l'heure indiquées par chaîne_date, qui peut con- tenir éventuellement des noms littéraux de mois, de fuseau horaire, `am' ou `pm', etc...

-u, --universal Afficher ou configurer l'heure en utilisant le Temps Universel (heure du méridien de Greenwich) plutôt que le temps local.

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

EXEMPLES Pour afficher la date de l'avant-veille :

date --date '2 days ago'

Pour afficher la date du jour à venir dans 3 mois plus un jour :

�!

date --date '3 months 1 day'

Pour afficher le numéro du jour de Noêl de l'année en cours :

date --date '25 Dec' +%j

Pour afficher la date actuelle dans un format incluant le jour du mois suivi du nom complet du mois :

date '+%d %B'

Il est parfois indésirable que les 9 premiers jours du mois soient complétés par un zéro. l'argument `%d' est responsable de ce complément sur deux chiffres. Par exem- ple `date -d 1-may '+%d %B'' donnera `01 May'.

Pour afficher la même chose sans le zéro de complément, on peut utiliser l'option non standard `-'.

date -d 1-may '+%-d %B'

TRADUCTION Christophe Blaess, 1997.

FSF 22 Décembre 1996 DATE(1L)

##��� ������� ����������������� ����##���

NOM dd - Convertir un fichier en le copiant.

SYNOPSIS dd [--help] [--version] [if=fichier] [of=fichier] [ibs=octets] [obs=octets] [bs=octets] [cbs=octets] [skip=blocs] [seek=blocs] [count=blocs] [conv={ascii,ebcdic,ibm,block,unblock,lcase,ucase,swab,noer- ror,notrunc, sync}]

DESCRIPTION dd copie un fichier (par défaut, depuis l'entrée standard vers la sortie standard) en permettant de sélectionner la taille de bloc, et d'effectuer des conversions.

OPTIONS Tous les nombres peuvent être suivis d'un multiplicateur correspondant à : b=512, c=1, k=1024, w=2, xm=nombre m

if=fichier Lire les données depuis le fichier indiqué plutôt que depuis l'entrée standard.

of=fichier Ecrire les données dans le fichier mentionné, et non pas sur la sortie standard. Si conv=notrunc n'est pas indiqué, le fichier est limité à la taille spécifiée par seek= (0 octets si seek= n'est pas fourni).

Page 18: Man Des Commandes Linux

��

ibs=nombre Lire le nombre indiqué d'octets en une fois.

obs=nombre Ecrire le nombre indiqué d'octets en une fois.

bs=nombre Lire et écrire le nombre indiqué d'octets en une fois. A priorité sur ibs et obs.

cbs=nombre Convertir le nombre indiqué d'octets en une fois.

skip=nombre Ignorer le nombre indiqué de blocs (dont la taille est fournie par ibs) au début de la lecture.

seek=nombre Ignorer le nombre indiqué de blocs (dont la taille est fournie par ibs) au début de l'écriture.

count=nombre 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.

ebcdic Convertir l'ASCII en EBCDIC.

ibm Convertir l'ASCII en EBCDIC IBM.

block Compléter les blocs se terminant par un saut de ligne avec des espaces, jusqu'à atteindre la taille mentionnée par cbs.

unblock Remplacer les espaces en fin de blocs (de taille cbs) par un saut de ligne.

lcase Transformer les majuscules en minuscules.

ucase Transformer les minuscules en majuscules.

swab Echanger par paire les octets lus en entrée. Contrairement à la commande dd d'Unix, la version GNU fonctionne également lorsqu'on copie un nombre impair d'octets. Dans ce cas, le dernier octet est tout simplement copié.

noerror Continuer même après des erreurs de lecture.

notrunc Ne pas limiter la taille du fichier de sor- tie.

sync Compléter chaque bloc lu avec des NULs pour atteindre la taille ibs.

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

�'

et terminer correctement.

--version Afficher un numéro de version sur la sortie stan- dard, et terminer correctement.

-- Fin de la liste d'options.

ENVIRONMENT Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significations habituelles.

CONFORMITÉ POSIX 1003.2.

TRADUCTION Christophe Blaess, 1997.

FSF 15 Décembre 1998 DD(1)

#!��� ������� ����������������� ����#!���

NOM df - Fournit la quantité d'espace occupé des systèmes de fichiers.

SYNOPSIS df [options] [fichier...]

Options POSIX : [-kP]

Options GNU (versions courtes) : [-ahikmPv] [-t type_fs] [-x type_fs] [--print-type] [--no-sync] [--sync] [--help] [--version] [--]

DESCRIPTION df indique les quantités d'espaces disques utilisées et disponibles sur les systèmes de fichiers.

Sans argument, df indiquera les quantités correspondant à tous les systèmes de fichiers montés, quelques soient leurs types. Sinon, df affichera les données correspon- dant aux systèmes contenant chaque fichier fournit en argument.

PRÉCISIONS POSIX Les valeurs sont indiquées en unités de 512 octets par défaut, mais si l'option -k est utilisée, l'unité est 1024 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 régulier, un répertoire, ou une FIFO, le résultat est imprévisible.

PRÉCISIONS GNU Les valeurs sont fournies en unités de 1024 octets par défaut, sauf si la variable d'environnement POSIXLY_COR- RECT existe, auquel cas le comportement POSIX est adopté.

Si un fichier indiqué en argument est un périphérique

Page 19: Man Des Commandes Linux

�-

disque contenant un système de fichiers monté, df affichera l'espace disponible sur ce système de fichiers plutôt que sur celui contenant le noeud du périphérique.

OPTIONS POSIX -k Utiliser des unités de 1024 octets plutôt que les

unités de 512 octets par défaut.

-P Affichage sur six colonnes, précédées de l'en-tête `Filesystem N-blocks Used Available Capacity Mounted on' (avec N=512, ou N=1024 si l'option -k est utilisée).

OPTIONS GNU -a, --all

Inclure dans le listing les systèmes de fichiers ayant une taille de 0 blocs, et qui sont omis par défaut. Il s'agit typiquement de pseudo-systèmes de fichiers particuliers comme les entrées d'un auto- monteur. De même les systèmes de type "ignore" ou "auto" utilisés par certains systèmes d'exploita- tion ne sont inclus qu'avec cette option.

-h, --human-readable Ajouter à chaque valeur une lettre comme M pour Méga-octet, afin d'améliorer la lisiblité.

-i, --inodes Afficher les informations sur l'utilisation des i- noeuds plutôt que les blocs. Un i-noeud (noeud d'index) contient des informations sur un fichier comme son propriétaire, ses dates d'accés et sa position sur le disque.

-k, --kilobytes Afficher les valeurs avec des unités de 1024 octets.

-m, --megabytes Afficher les valeurs avec des unités de 1 048 576 octets (un méga-octet).

--no-sync Ne pas invoquer l'appel système sync avant d'obtenir les informations sur l'utilisation du disque. Ceci peut permettre à df de s'exécuter sensiblement plus vite, mais sur certains systèmes (notamment SunOS) les résultats peuvent être forte- ment dépassés. Il s'agit du comportement par défaut.

-P, --portability 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 ligne exactement. Ceci signifie que si un système 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.

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

�&

-t type, --type=type Limiter la liste aux systèmes de fichiers du type indiqué. On peut fournir plusieurs types de systèmes en utilisant plusieurs options -t. Par défaut, rien n'est omis.

-T, --print-type Afficher le type de chaque système de fichiers. Les types affichés sont indiqués par le système (de manière spécifique, par exemple en lisant /etc/mtab). Voir également mount(8).

-x type, --exclude-type=type Limiter l'affichage aux systèmes n'ayant PAS le type indiqué. Plusieurs types de systèmes de fichiers peuvent être éliminés en utilisant plusieurs options -x. Par défaut, rien n'est omis.

-v Ignoré. Pour compatibilité avec System V. df.

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

et terminer correctement.

--version Afficher un numéro de version sur la sortie stan- dard, et terminer correctement.

-- Fin de la liste d'options.

ENVIRONNEMENT La variable POSIXLY_CORRECT determine le choix des unités. Si elle n'existe pas, et si la variable BLOCKSIZE a une valeur commencant par HUMAN alors, le comportement est celui de l'option -h (à moins qu'il soit surchargé par une option -k ou -m). Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significations habituelles.

CONFORMITÉ POSIX 1003.2

VOIR AUSSI mount(8)

NOTES Cette page décrit la version de df se trouvant dans le package fileutils-3.16. D'autres versions peuvent diffèrer légèrement. Envoyez les corrections concernant cette page de manuel (en anglais) à [email protected], [email protected], et [email protected], et (en francais) à [email protected]. Signalez les bugs dans le program à [email protected].

TRADUCTION Christophe Blaess, 1998.

FSF 5 Mai 1999 DF(1)

#�%(��"� ������ ����� &������������� �#�%(��"�

Page 20: Man Des Commandes Linux

�0

NOM dmesg - Afficher et contrôler le tampon des messages du noyau.

SYNOPSIS dmesg [ -c ] [ -n nivaeu ] [ -s taille ]

DESCRIPTION dmesg est utilisé pour examiner ou contrôler le tampon des messages du noyau.

Le programme aide les utilisateurs à afficher les messages du démarrage de la machine. Au lieu de copier ces messages à la main, il suffit de faire

dmesg > boot.messages et envoyer par courrier électronique le fichier boot.mes- sages à quelqu'un capable d'identifier un éventuel problème.

OPTIONS -c Efface le tampon des messages du noyau après les

avoir affichés.

-s taille utilise un tampon de la taille indiquée au lieu d'utiliser la taille courante. Par défaut, 8196 octets sont utilisés par le démon syslog du noyau dans les versions 2.0.33 et 2.1.103. Si vous utiliser un tampon plus large que celui par défaut, cette option vous permet de voir le tampon tout entier.

-n niveau règle le niveau des messages à afficher sur la con- sole. Par exemple, -n 1 supprime l'affichage de tous les messages, exceptés les messages graves. Tous les niveaux d'affichage des messages sont enregistrés dans /proc/kmsg, ainsi syslogd(8) peut être toujours utilisé pour contrôler exactement où les messages du noyau apparaissent. Quand l'option -n est utilisée, dmesg n'affichera ou n'effacera pas le tampon des messages du noyau.

Quans les deux options sont utilisées, seule la dernière option sur la ligne de commande est prise en compte.

VOIR AUSSI. syslogd(8)

AUTEUR Theodore Ts'o ([email protected])

TRADUCTION Thierry Vignaud <[email protected]>, 1999.

Linux 19 Mars 1999 DMESG(8)

#'��� ������� ����������������� ����#'���

!*

NOM du - Statistiques sur l'utilisation du disque.

SYNOPSIS du [options] [fichier...]

Options POSIX : [-askx]

Options GNU (forme courte): [-abchklmsxDLS] [--help] [--version] [--]

DESCRIPTION du affiche la quantité d'espace disque utilisée par chacun des arguments, et pour chaque sous-répertoire des réper- toires indiqués en argument. Toutes les mesures contien- nent l'ensemble de la hiérarchie des sous-répertoires dans le système de fichiers. Sans argument, du mesure l'espace occupé par le répertoire courant et ses descendants.

L'espace est mesure en blocs d'un Ko par défaut, à moins que la variable d'environnement POSIXLY_CORRECT soit con- figurée, auquel cas les blocs représentent 512 octets.

OPTIONS POSIX -a Afficher les statistiques pour tous les fichiers,

pas seulement les répertoires.

-k Afficher la taille en kilo-octets

-s Afficher seulement le total pour chaque argument.

-x Ignorer les répertoires situés sur un système de fichiers différent de celui de l'argument étudié.

OPTIONS GNU -a, --all

Afficher les statistiques pour tous les fichiers, pas seulement les répertoires.

-b, --bytes Afficher les tailles en octets.

-c, --total Afficher un total complet de tous les arguments, après les avoir tous affiché. Ceci permet de connaître l'espace occupé par un répertoire en excluant certains fichiers.

-h, --human Afficher les tailles de manière facile à lire par un humain, en ajoutant un suffixe correspondant à l'unite (K, M, G).

-k, --kilobytes Afficher la taille en kilo-octets. Cette option a priorité sur la variable d'environnement POSIXLY_CORRECT.

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

Page 21: Man Des Commandes Linux

!�

-x, --one-file-system Ignorer les répertoires situés sur un système de fichiers différent de celui de l'argument étudié.

-D, --dereference-args Déréférencer les liens symboliques indiqués en tant qu'argument sur la ligne de commande. Ne pas déréférencer les autres liens symboliques. Ceci permet de mesurer la place disque occupée par des répertoires comme /usr/tmp quand il s'agit de liens symboliques vers un autre répertoire.

-L, --dereference Déréférencer les liens symboliques (prendre en compte l'espace utilisé par le fichier ou le réper- toire pointé par le lien, à la place de l'espace utilisé seulement par le lien).

-S, --separate-dirs Compter la taille de chaque répertoire séparement, sans inclure les tailles des sous-répertoires.

--help Afficher un message d'aide et terminer normalement.

--version Afficher un numéro de version et terminer normale- ment.

BOGUES Sur les systèmes BSD, du affiche des tailles correspondant à 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- UX, les tailles sont doublées pour les fichiers montés par NFS depuis un système BSD. Ceci est dû à un défaut d'HP- UX, qui affecte également la version HP-UX de la commande du.

ENVIRONNEMENT La variable POSIXLY_CORRECT determine le choix des unités. Si elle n'existe pas, et si la variable BLOCKSIZE a une valeur commencant par HUMAN alors, le comportement est celui de l'option -h (à moins qu'il soit surchargé par une option -k ou -m). Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significations habituelles.

CONFORMITÉ POSIX 1003.2

TRADUCTION Christophe Blaess, 1997.

FSF 15 Décembre 1998 DU(1)

% )���� ������� ����������������� ��% )����

NOM env - Exécuter un programme dans un environnement modifié.

!�

SYNOPSIS env [-] [-i] [-u name] [--ignore-environment] [--unset=nom] [--help] [--version] [nom=valeur]... [com- mande [args...]] env

DESCRIPTION Cette page de manuel documente la version GNU de env.

env exécute une commande dans un environnement modifié par les spécifications fournies sur la ligne de commande

Les arguments du type 'nom=valeur' remplissent la variable d'environnement nom avec la valeur indiquée.

valeur peut être vide (`nom='). Remplir une variable avec une valeur vide n'est pas la même chose que l'effacer de l'environnement.

Le premier argument restant correspond au programme à exécuter. Il est recherché en fonction de la variable d'environnement PATH. Tous les arguments ultérieurs sont passés en ligne de commande au programme invoqué.

Si aucune commande n'est fournie après les spécifications d'environnement, ce dernier est affiché. L'effet est le même que de fournir le nom de commande `printenv'.

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

et terminer normalement.

-u, --unset nom Effacer la variable nom de l'environnement, si elle y était présente.

-, -i, --ignore-environment Démarrer avec un environnement vide, et non pas avec l'environnement hérité par env.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

TRADUCTION Christophe Blaess, 1997.

FSF 22 Décembre 1996 ENV(1L)

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

NOM fdisk - Manipuler les tables de partitions pour Linux.

SYNOPSIS fdisk [-u] périphérique

fdisk -l [-u] [périphérique ...]

Page 22: Man Des Commandes Linux

!�

fdisk -s partition ...

fdisk -v

DESCRIPTION Les disques durs peuvent être divisés en un ou plusieurs disques logiques appelés partitions. Cette division est décrite dans la table des partitions trouvée sur le secteur 0 du disque.

Dans le monde BSD, on parle de `tranches de disque' et de `label de disque'.

Linux a besoin d'au moins une partition, pour son système de fichiers racine. Il peut utiliser des fichiers de swap ou des partitions de swap, mais ces dernières sont plus efficaces. C'est pourquoi, en général, on utilise une seconde partition Linux en tant que partition de swap. Sur les matériels compatibles Intel, le BIOS qui démarre le système ne peut souvent accéder qu'aux 1024 premiers cylindres du disque. Pour cette raison, les personnes possédant des disques volumineux créent souvent une troisième partition, de quelques MB de taille, montée en général en /boot, pour conserver l'image du noyau et un petit nombre de fichiers auxiliaires nécessaires au démar- rage, pour être sûr que ce matériel soit accessible par le BIOS. Il peut y avoir des raisons de sécurité, de facilité d'administration et de sauvegarde ou de tests pour utiliser plus que le nombre minimal de partitions.

fdisk (dans la première forme d'invocation) est un pro- gramme dirigé par un menu utilisé pour la création et la manipulation de tables de partitions. Il comprend les tables de partitions de type DOS, et les labels de disque BSD ou SUN.

Le périphérique est en général l'un des suivants : /dev/hda /dev/hdb /dev/sda /dev/sdb

(/dev/hd[a-h] pour les disques IDE, /dev/sd[a-p] pour les disques SCSI, /dev/ed[a-d] pour les disques ESDI, /dev/xd[ab] pour les disques XT). Un nom de périphérique référence le dique entier.

La partition est un nom de périphérique suivi d'un numéro de partition. Par exemple, /dev/hda1 est la première par- tition sur le premier disque dur IDE du système. Les dis- ques IDE peuvent avoir jusqu'à 63 partitions, les disques SCSI jusqu'à 15. Pour de plus amples informations, lisez /usr/src/linux/Documentation/devices.txt.

Un label de disque de type BSD/SUN peut décrire 8 partitions, dont la troisième devrait être un `disque entier'. Ne créez pas de partition qui ait son premier secteur sur le cylindre 0 (comme une partition de swap), car cela détruirait le label du disque.

Un label de disque de type IRIX/SGI peut décrire 15 parti- tions, dont la onzième devrait être une partition entière de `volume', alors que la neuvième devrait être un `entête de volume'. L'entête de volume couvre également la table des partitions, çàd qu'elle débute au bloc zéro et s'étend par défaut sur 5 cylindres. L'espace restant dans l'entête de volume peut être utilisé par des entrées de répertoires d'entête. Aucune partition ne peut empiéter

!!

sur l'entête de volume. Ne modifiez pas son type ni ne créez de système de fichiers dessus, car vous perdriez alors la table des partitions. N'utilisez ce type de label que quand vous travaillez sous Linux sur des machines IRIX/SGI ou quand vous utilisez des disques IRIX/SGI sous Linux.

Une table de partitions de type DOS peut décrire un nombre illimité de partitions. Dans le secteur 0, il y a de la place pour décrire 4 partitions (appelées `primaires'). L'une d'entre elles peut être une partition étendue; c'est une sorte de boîte contenant des partitions logiques, dont les descripteurs sont trouvés dans une liste chaînée de secteurs, chacun précédant les partitions logiques corre- spondantes. Les quatre partitions primaires, présentes ou pas, portent les numéros 1-4. Les partitions logiques sont numérotées à partir de 5.

Dans une table de partitions de type DOS, le décalage de départ et la taille de chaque partition sont conservés de deux façons : comme un nombre absolu de secteurs (en 32 bits), ou comme un triplet Cylindres/Têtes/Secteurs (en 10+8+6 bits). La première manière fonctionne bien - avec des secteurs de 512 bytes, cela marchera jusqu'à 2 TB. La seconde possibilité souffre de deux problèmes différents. Primo, ces champs C/T/S ne peuvent être remplis que lorsque les nombre de têtes et de secteurs par piste sont connus. Secundo, même si l'on connaissait ces nombres, les 24 bits qui sont disponibles ne suffiraient pas. DOS utilise uniquement C/T/S, Windows utilise les deux, Linux ne l'utilise jamais.

Si c'est possible, fdisk déterminera la géométrie du disque automatiquement. Ce n'est pas nécessairement la géométrie physique du disque (en effet, les disques mod- ernes n'ont pas réellement de géométrie physique, et sûrement pas une géométrie décrite dans la forme simpliste Cylindres/Têtes/Secteurs), mais c'est la géométrie de disque utilisée par MS-DOS pour la table des partitions que fdisk peut détecter.

D'habitude, tout se passe bien, et il n'y a aucun problème si Linux est le seul système sur le disque. Néanmoins, si le disque doit être partagé avec d'autres systèmes 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 système d'exploitation. Quand Linux démarre, il regarde la table des partitions, et essaie de déduire quelle (fausse) géométrie est requise pour une bonne coopération avec les autres systèmes.

Chaque fois qu'une table des partitions est écrite, un test de cohérence est effectué sur les entrées de la table des partitions. Ce test vérifie que les début et fin physiques et logiques sont identiques, et que la partition commence et se termine avec une limite de cylindre (sauf pour la première partition).

Certaines versions de MS-DOS créent une première partition qui ne commencent pas sur une limite de cylindre, mais sur le secteur 2 du premier cylindre. Les partitions com- mençant au cylindre 1 ne peuvent débuter sur une limite de cylindre, mais cela ne pourrait causer des problèmes que si vous avez OS/2 sur votre machine.

Un sync() et un ioctl() BLKRRPART (relire la table des partitions à partir du disque) sont exécutés avant la sor-

Page 23: Man Des Commandes Linux

!�

tie quand la table des partitions a été mise à jour. Il y a longtemps, il était nécessaire de redémarrer la machine après l'utilisation de fdisk. Je ne crois pas que cela soit encore le cas - en effet, redémarrer trop rapidement peut causer la perte de données non encore écrites sur disque. Notez qu'à la fois le noyau et le matériel disque peut mettre des données dans des tampons.

AVERTISSEMENT DOS 6.x La commande DOS 6.x FORMAT recherche certaines informa- tions sur le premier secteur de la zône de données de la partition, et suppose que cette information est plus fiable que l'information contenue dans la table des parti- tions. Le FORMAT de DOS suppose que FDISK (de DOS) efface les 512 premiers bytes de la zône de données de la parti- tion chaque fois qu'un changement de taille se produit. FORMAT regardera cette information additionnelle même si l'option /U est donnée -- nous considérons que c'est un bogue dans FORMAT et FDISK de DOS.

Si vous utilisez cfdisk ou fdisk pour modifier la taille d'une entrée de la table des partitions DOS, alors vous 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 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, car une petite faute de frappe peut rendre toutes les données de votre disque inutilisables.

Pour de meilleurs résultats, vous devriez toujours utiliser un programme de partitionnement spécifique au système d'exploitation. Par exemple, vous devriez créer des partitions DOS avec le programme FDISK DOS, et les partitions Linux avec l'un des programmes Linux fdisk ou cfdisk.

OPTIONS -v Afficher le numéro de version de fdisk et se ter-

miner normalement.

-l Lister les tables de partitionspour les périphériques spécifiés et ensuite se terminer. Si aucun périphérique n'est fourni, ceux mentionnés dans /proc/partitions (si ce fichier existe) sont utilisés.

-u Pendant le listing des tables de partitions, donner la taille en secteurs plutôt qu'en cylindres.

-s partition La taille de la partition (en blocs) est affichée sur la sortie standard.

BOGUES Il existe plusieurs programmes *fdisk. Chacun a ses points forts et ses points faibles. Essayez-les dans l'ordre cfdisk, fdisk, sfdisk. (En effet, cfdisk est un

!'

beau programme qui a des exigences strictes sur les tables de partitions qu'il accepte, et qui produit des tables de partitions de haute qualité. A utiliser si vous le pou- vez. fdisk est un programme boggé qui fait des choses assez floues - d'habitude, il arrive à produire des résul- tats raisonnables. Son seul avantage est qu'il permet le 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- teur est quelque peu rebutante, mais il travaille mieux que fdisk et est plus puissant que fdisk et cfdisk. De plus, il peut être utilisé de façon non interactive.)

Le label de disque de type IRIX/SGI n'est pas supporté actuellement par le noyau. De plus, les répertoires d'entête, IRIX/SGI ne sont pas encore entièrement sup- portés.

Il manque l'option `écrire la table des partitions dans un fichier'.

TRADUCTION Frédéric Delanoy, 2000.

Linux 14 Août 2000 FDISK(8)

!��%��� ������� ����������������� ��!��%���

NOM file - Déterminer le type d'un fichier.

SYNOPSIS file [ -bcnsvzL ] [ -f nomfichier ] [ -m fichiersmagiques ] fichier ...

DESCRIPTION Cette page de manuel documente la version 3.27 de la com- 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 magique, et tests de langage. Le premier test qui réussit provoque l'affichage du type du fichier.

Le type affiché contient en général l'un des mots text (le fichier ne contient que des caractères ASCII et peut prob- ablement être lu sur un terminal ASCII ), executable (le fichier contient le résultat de la compilation d'un pro- gramme dans une forme compréhensible par

certains noyaux Unix ou autres), ou data signifiant tout le reste (les données, étant en général `binary', ç.à.d. binaires, ou `non-printable', ç.à.d. non affichables). Les exceptions sont les formats de fichiers bien connus (fichiers cores, archives tar) dont on sait qu'ils conti- ennent des données binaires. Quand vous modifiez le fichier /usr/share/magic ou le programme lui-même, con- servez ces mots-clés . Certains programmes se reposent sur le fait que tous les fichiers accessibles en lecture dans un répertoire doivent être présetné sous le terme ``texte'' par file. Ne faites pas comme à Berkeley, en changeant ``shell commands text'' en ``shell script''.

Page 24: Man Des Commandes Linux

!-

Les tests de systèmes de fichiers sont basés sur l'examen de la sortie de l'appel-système stat(2). Le programme 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 connus appropriés présents sur votre système (sockets, liens symboliques ou tubes nommés (FIFOs) sur les systèmes qui les implémentent) sont reconnus lorsqu'ils sont définis dans le fichier d'entête du système sys/stat.h.

Les tests de nombres magiques sont utilisés pour vérifier des fichiers contenant des données dans des formats fixes particuliers. L'exemple type est un fichier binaire exécutable (programme compilé) a.out, dont le format est défini dans a.out.h, et peut-être aussi dans exec.h dans le répertoire d'inclusion standard. Ces fichiers contien- nent un ``nombre magique'' qui indique au système d'exploitation UNIX que le fichier est un binaire exécutable, et qui donne le type précis parmi ces multi- ples types possibles. Le concept de ``nombre magique'' a été appliqué par extension aux fichiers de données. Tout fichier contenant un identificateur invariable a une place fixe dans le fichier peut d'habitude être décrit de cette façon. L'information sur ces fichiers est lue à partir du fichier magique /usr/share/magic.

Si un argument semble être un fichier ASCII, file essaie de deviner le langage dans lequel il a été ecrit. Les tests de langage recherchent des chaînes de caractères particulières (cf names.h) qui peuvent apparaître n'importe où dans les premiers blocs d'un fichier. Par exemple, le mot-clé .br indique que le fichier est proba- blement un fichier d'entrée troff(1), comme le mot-clé struct indique un programme C. Ces tests sont moins fiables que les deux autres types de tests, et donc ils sont pratiqués en dernier lieu. Les routines de tests de langage testent également quelques types divers (comme les archives tar(1)), et déterminent si un fichier de type inconnu doit être étiqueté `ascii text' (texte ascii) ou `data' (données).

OPTIONS -b Ne pas faire précéder les lignes de sortie par les

noms des fichiers (mode court).

-c Afficher pour vérification l'analyse d'un fichier magique. Cette option est habituellement utilisée en conjonction avec -m pour débogger un nouveau fichier magique avant de l'installer.

-f nomfichier Lire les noms de fichiers à examiner à partir du fichier nomfichier (un par ligne) avant la liste des arguments. Il doit y avoir au moins un nom- fichier ou un argument nom de fichier; pour tester l'entrée standard, utilisez ``-'' comme argument nom de fichier.

-m liste Indiquer une liste de fichiers de rechange con- tenant les nombres magiques. Cela peut être un seul fichier, ou une liste de fichiers séparés par des `:'

-n Forcer le vidage de la sortie standard après la vérification d'un fichier. Ce n'est utile que durant la vérification d'une liste de fichiers. Cette option est prévue pour être utilisée par des

!&

programmes qui veulent recevoir le type du fichier de sortie à travers un tube.

-v Afficher le numéro de version et se terminer nor- malement.

-z Essayer de regarder à l'intérieur des fichiers compressés.

-L suivre les liens symboliques, comme l'option du même nom utilisée par ls(1). (sur les systèmes supportant les liens symboliques).

-s Normalement, file n'essaie de lire et déterminer que le type des fichiers présents comme arguments, et que stat(2) rapporte en tant que fichiers ordi- naires. Ceci peut éviter des problèmes, car la lecture de fichiers spéciaux peut avoir des conséquences bizarres. Fournir l'option -s indique à file de lire également les fichiers arguments les fichiers arguments qui sont des fichiers blocs, ou des fichiers spéciaux de périphériques. C'est utile pour déterminer le type de systèmes de fichiers des données situées dans des partitions de disque brutes, ç.à.d. des fichiers spéciaux bloc. Cette option indique également à file de ne pas accorder d'importance à la taille de fichier indiquée par stat(2) puisque, sur certains systèmes, il indique des tailles nulle pour des partitions de disque brutes.

FICHIERS /usr/share/magic - liste des nombres magiques (par défaut)

ENVIRONNEMENT La variable d'environnement MAGIC peut être utilisée pour donner les noms des fichiers de nombres magiques utilisés par défaut.

VOIR AUSSI magic(4) - description du format du fichier magique. strings(1), od(1), hexdump(1) - outils d'examen de fichiers non-textes.

CONFORMITÉ Ce programme est supposé outrepasser la définition de l'interface System V pour FILE(CMD), pour ce qu'on peut comprendre du langage vague qui y est utilisé. Son com- portement est en grande partie compatible avec le pro- gramme System V du même nom. Cette version connaît cepen- dant plus de nombres magiques, et donc produira des sor- ties différentes (même si plus précises) dans de nombreux cas.

La seule différence importante entre cette version et celle de System V est que cette version traite n'importe quel espace blanc comme un délimiteur, de sorte que les espaces dans les chaînes de caractères de motifs doivent être marqués par un caractère d'échappement. Par exemple, >10 string language impress (données imPRESS) d'un fichier magique existant devrait être changé en >10 string language\ impress (données imPRESS) en plus, dans cette version, si une chaîne de caractères de motif contient un backslash, il doit être marqué par un caractère d'échappement. Par exemple, 0 string \begindata document Andrew Toolkit d'un fichier magique existant devrait être changé en

Page 25: Man Des Commandes Linux

!0

0 string \\begindata document Andrew Toolkit

Les versions 3.2 et ultérieures de SunOS de Sun Microsys- tems incluent une commande file(1) dérivée de celle de System V, mais comprenant quelques extensions. Ma version ne diffère que peu de celle de Sun. Elle inclut l'exten- sion de l'opérateur `&' utilisé, par exemple, dans >16 long&0x7fffffff >0 not stripped

RÉPERTOIRE MAGIQUE Les entrées du fichier magique ont été obtenues à partir de sources variées, principalement via USENET, et ont reçu une contribution de différents auteurs. Christos Zoulas (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.

L'ordre des entrées présentes dans le fichier magique est important. Selon le système que vous utilisez, l'ordre dans lequel elles sont placées peut être incorrect. Si votre ancienne commande file utilise un fichier magique, gardez l'ancien fichier magique pour pouvoir effectuer des comparaisons (renommez-le en /usr/share/magic.orig).

EXEMPLES $ file file.c file /dev/hda file.c: C program text file: ELF 32-bit LSB executable, Intel 80386, version 1,

dynamically linked, not stripped /dev/hda: block special

$ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10} /dev/hda: x86 boot sector /dev/hda1: Linux/i386 ext2 filesystem /dev/hda2: x86 boot sector /dev/hda3: x86 boot sector, extended partition table /dev/hda4: Linux/i386 ext2 filesystem /dev/hda5: Linux/i386 swap file /dev/hda6: Linux/i386 swap file /dev/hda7: Linux/i386 swap file /dev/hda8: Linux/i386 swap file /dev/hda9: empty /dev/hda10: empty

HISTORIQUE Il y a eu une commande file dans chaque UNIX depuis au moins la version de recherche 6 (page de manuel datée de janvier 1975). La version de System V a introduit un changement majeur : la liste externe des types de nombres magiques. Ceci a considérablement ralenti le programme mais l'a rendu beaucoup plus flexible.

Ce programme, basé sur la version System V, a été écrit par Ian Darwin sans jeter un coup d'oeil au code d'une autre personne.

John Gilmore révisa largement le code, l'améliorant par rapport à la première version. Geoff Collyer trouva plusieurs inadéquations, et fournit quelques entrées du fichier magique. Le programme a connu une évolution con- tinue depuis lors.

AUTEUR Ecrit par Ian F. Darwin, adresse UUCP {utzoo | ihnp4}!dar- win!ian, adresse Internet [email protected], adresse postale P.O. Box 603, Station F, Toronto, Ontario, CANADA M4Y 2L8.

�*

Modifié par Rob McMahon, [email protected], en 1989 pour étendre l'opérateur `&' d'un simple `x&y != 0' à un `x&y op z'.

Modifié par Guy Harris, [email protected], en 1993, pour :

remettre en place l'opérateur `&' "ancien style" dans son état original parce que 1) la modification de Rob McMahon modifia l'ancien style d'utilisa- tion, parce que 2) l'opérateur `&' "nouveau style" de SunOS, que supporte cette version de file, traite également `x&y op z', et parce que 3) la modification de Rob n'était pas du tout documentée ;

ajouter des niveaux multiples de `>' ;

ajouter les mots-clés ``beshort'', ``leshort'', etc. pour regarder les nombres dans le fichier dans un ordre d'octets spécifique, plutôt que dans l'ordre natif des octets du programme exécutant file.

Changements par Ian Darwin et par des auteurs variés, incluant Christos Zoulas ([email protected]), 1990-1999.

NOTICE LEGALE Copyright (c) Ian F. Darwin, Toronto, Canada, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993.

Ce logiciel n'est pas sujet et ne peut pas être rendu sujet à n'importe quelle licence de la Compagnie Américaine des Téléphones et Télégraphes (American Tele- phone and Telegraph Company), Sun Microsystems Inc., Digi- tal Equipment Inc., Lotus Development Inc., les régents de l'Université de Californie, le Consortium X ou le MIT, ou encore la Free Software Foundation.

Ce logiciel n'est pas sujet à une restriction d'exporta- tion du Département du Commerce des Etats-Unis, et peut être exporté dans n'importe quel pays ou planète.

L'autorisation est donnée à quiconque d'utiliser ce logi- ciel dans n'importe quel but, et de le modifier et de le distribuer librement, en respectant les restrictions suiv- antes :

1. L'auteur n'est pas responsable des conséquences de l'utilisation de ce logiciel, quelles qu'elles soient, même si elles se produisent à cause de défauts qui y sont présents.

2. L'origine de ce logiciel ne doit pas être mal représentée, que ce soit par revendication explicite ou par omission. Puisque peu d'utilisateurs lisent le code source, les crédits doivent apparaître dans la documenta- tion.

3. Les versions modifiées doivent être renseignées comme telles, et ne peuvent pas être présentées comme étant le logiciel original. Puisque peu d'utilisateurs lisent le code source, les CREDITS doivent apparaître dans la docu- mentation.

4. Cette notice ne peut être modifiée ou altérée.

Quelques fichiers de support (getopt, strtok) distribués

Page 26: Man Des Commandes Linux

��

avec ce paquetage sont sujets eux mêmes termes que ceux présents ci-dessus.

Quelques simples fichiers de support (strtol, strchr) dis- tibués avec ce paquetage sont dans le domaine public, et sont marqués comme tels.

Les fichiers tar.h et is_tar.c ont été écrits par John Gilmore pour son programme tar du domaine public, et ne sont pas couverts par les restrictions ci-dessus.

BOGUES Il y a sûrement une meilleure façon d'automatiser la con- 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 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.

Le support des fichiers ASCII (principalement pour les langages de programmation) est simpliste, inefficace, et requiert une recompilation pour une mise à jour.

Il devrait avoir une clause ``else'' pour suivre une série de lignes de continuation.

Le fichier magique et les mots-clés devraient avoir le support des expressions régulières. Son utilisation des tabulations ASCII comme un délimiteur de champ est horri- ble et rend difficile l'édition des fichiers.

Il serait souhaitable de permettre les lettres majuscules dans les mots-clés pour différencier, par exemple, les commandes troff(1) des macros des pages de manuel. L'util- isation d'expressions régulières devrait rendre cela facile.

Le programme ne reconnaît pas FORTRAN. Il devrait être capable de le faire en recherchant quelques mots-clés qui apparaîssent indentés par rapport au début de la ligne. Le support des expressions régulières devrait rendre cela facile.

La liste de mots-clés de ascmagic appartient probablement au fichier Magique. Ceci pourrait être fait en utilisant un mot-clé comme `*' pour la valeur de déplacement.

Une autre optimisation pourrait être de réordonner le fichier magique de sorte que l'on puisse passer les tests pour le premier octet, le premier mot, etc., une fois qu'on l'a trouvé. Se plaindre des conflits dans les entrées du fichier magique. Eventuellement créer une règle de sorte que les entrées soient triées sur base du déplacement par rapport au début du fichier plutôt que sur la position à l'intérieur du fichier magique.

Le programme devrait fournir un moyen d'estimer le degré d'exactitude d'une supposition.

��

Ce programme est plus lent que les commandes file de cer- tains vendeurs de Unix.

Cette page de manuel, en particulier cette section, est trop longue.

DISPONIBILITÉ Vous pouvez obtenir la dernière version de l'auteur origi- nal par FTP anonyme sur ftp.astron.com dans le répertoire /pub/file/file-X.YY.tar.gz

TRADUCTION Frédéric Delanoy, 2000.

Linux 5 Septembre 2000 FILE(1)

!� #���� ������� ����������������� �!� #����

NOM find - Rechercher des fichiers dans une hiérarchie de répertoires.

SYNOPSIS find [chemin...] [expression]

DESCRIPTION Cette page de manuel documente la version GNU de find.

find parcourt les arborescences de répertoires commençant en chacun des chemins mentionnés, en évaluant les expres- sions fournies pour chaque fichier rencontré.

L'évaluation de l'expression se fait de gauche à droite, en suivant des règles de précédence décrite dans la sec- tion OPÉRATEURS, jusqu'à ce que le résultat soit connu (par exemple la partie gauche vraie pour un opérateur OU ou fausse pour un opérateur ET).

Le premier argument commençant par `-', `(', `)', `,', ou `!' est considéré comme le début de l'expression, tous les arguments précédents sont des chemins à parcourir.

Tous les arguments ultérieurs sont considérés comme le reste de l'expression régulière.

Si aucun chemin n'est mentionné, le répertoire en cours sert de point de départ.

Si aucune expression n'est fournie, find utilise l'expres- sion `-print' par défaut.

find se termine avec le code de retour 0 si tous les fichiers ont pu être examinés correctement, et supérieur à 0 si une erreur s'est produite.

EXPRESSIONS L'expression est constituée d'options (affectant l'ensem- ble des opérations plutôt que le traitement d'un fichier particulier, et renvoyant toujours vrai), de tests (ren- voyant une valeur vraie ou fausse), et d'actions (ayant

Page 27: Man Des Commandes Linux

��

des effets de bords et renvoyant une valeur vraie ou fausse), tous ces éléments étant séparés par des opérateurs.

Quand un opérateur est manquant, l'opération par défaut -and est appliquée. Si l'expression ne contient pas d'action autre que -prune, find applique l'action -print par défaut sur tous les fichiers pour lesquels l'expres- sion est vraie.

OPTIONS Toutes les options renvoient toujours la valeur vraie. Elles ont toujours un effet global, plutôt que de s'appli- quer uniquement à leur emplacement dans l'expression. Néanmoins, pour améliorer la lisibilité, il est préférable de les placer au début de l'expression.

-daystart Mesurer les temps (avec -amin, -atime, -cmin, -ctime, -mmin, et -mtime) depuis le début de la journée plutot que depuis 24 heures.

-depth Traiter d'abord les sous-répertoires avant le répertoire lui-même.

-follow Déréférencer les liens symboliques pour accéder aux fichiers vers lesquels ils pointent. Ceci implique l'option -noleaf.

-help, --help Afficher un message d'aide sur la sortie standard et terminer normalement.

-maxdepth n Descendre au plus n niveaux (n étant un entier positif ou nul), dans les répertoires parcourus. `-maxdepth 0' signifie que les tests et les actions ne s'appliquent qu'aux arguments de la ligne de commande.

-mindepth n Ne pas appliquer les tests ou les actions à des niveaux de profondeur inférieurs à n. n est un entier positif ou nul. `-mindepth 1' signifie que les tests et les actions s'appliquent à tous les fichiers sauf aux arguments de la ligne de com- mande.

-mount Ne pas parcourir les répertoires situés sur d'autres systèmes de fichiers. Il s'agit d'une alternative à l'option -xdev, assurant la compati- bilité avec d'anciennes versions de find.

-noleaf Ne pas faire d'optimisation en supposant que les répertoires contiennent 2 fois moins de sous-réper- toires que leurs nombres de liens physiques. Cette option est nécéssaires lorsque l'on parcourt des systèmes de fichiers ne suivant pas les conventions Unix sur les liens de répertoires, comme les systèmes MS-DOS, les CD-ROM ou les points de mon- tage de volumes AFS. Chaque répertoire sur un système de fichiers Unix dispose au moins de deux liens physiques, son nom et `.'. De plus chaque sous-répertoire a également un lien `..' vers le répertoire parent. Quand find examine un réper-

�!

toire, il sait qu'il y a 2 fois moins de sous- répertoires que de liens vers le répertoire. Une fois qu'il a rencontré le nombre prévu de sous- répertoires, il est donc sûr que le reste des entrées est constitué de fichiers autres que des sous-répertoires. Ces fichiers sont des feuilles ([NDT] `leaf') dans l'arborescence des répertoires. S'il n'y a que les noms de fichiers à examiner, il n'a plus besoin de vérifier leur nature, et ceci fournit une augmentation notable de la vitesse de traitement.

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

-xdev Ne pas parcourir les répertoires situés sur d'autres systèmes de fichiers.

TESTS Les arguments numériques peuvent être indiqués comme suit:

+n supérieur à n,

-n inférieur à n,

n égal à n.

-amin n dernier accès au fichier il y a n minutes.

-anewer file dernier accès au fichier plus récent que la dernière modification de file. Le comportement de l'option -anewer est modifié par l'option -follow uniquement si celle-ci la précède sur la ligne de commande.

-atime n dernier accès au fichier il y a n*24 heures.

-cmin n dernière modification du statut du fichier il y a n minutes.

-cnewer file dernière modification du statut du fichier plus récente que la dernière modification du fichier file. Le comportement de l'option -cnewer est mod- ifié par l'option -follow uniquement si celle-ci la précède sur la ligne de commande.

-ctime n dernière modification du statut du fichier il y a n*24 heures.

-empty fichier vide. De plus ce fichier doit être régulier ou être un répertoire.

-false toujours faux.

-fstype type fichier se trouvant sur un système de fichiers du type indiqué. Les types de systèmes de fichiers dépendent de la version d'Unix. Une liste non- exhaustive des systèmes acceptés sur certaines ver- sions d'Unix sont : ufs, 4.2, 4.3, nfs, tmp, mfs,

Page 28: Man Des Commandes Linux

��

S51K, S52K. Vous pouvez utiliser -printf avec la directive %F pour examiner les types de vos systèmes de fichiers.

-gid n Fichier de GID numérique valant n.

-group nom_groupe fichier appartenant au groupe nom_groupe (éventuellement ID numérique).

-ilname motif identique à -lname, mais sans différencier les majuscules et les minuscules.

-iname pattern identique à -name, mais sans différencier les majuscules et les minuscules. Par exemple les motifs `fo*' et `F??' correspondent aux noms de fichiers `Foo', `FOO', `foo', `fOo', etc...

-inum n fichier dont le numéro d'i-noeud est n.

-ipath motif identique à -path, mais sans différencier les majuscules et les minuscules.

-iregex motif identique à -regex, mais sans différencier les majuscules et les minuscules.

-links n fichier ayant n liens.

-lname motif fichier répresentant un lien symbolique, dont le contenu correspond au motif indiqué. Lors du développement des méta-caractères, `/' et `.' ne sont pas traités différement des autres caractères (voir l'exemple dans la description de l'option -path).

-mmin n Fichier dont les données ont été modifiées il y a n minutes.

-mtime n Fichier dont les données ont été modifiées il y a n*24 heures.

-name motif Fichier dont le nom de base (sans les répertoires du chemin d'accès), correspond au motif du shell. Les méta-caractères (`*', `?', et `[]') ne sont jamais mis en correspondance avec un point `.' au début du nom. Pour ignorer un répertoire, ainsi que tous ses sous-répertoires, utiliser l'option -prune; vous trouverez un exemple dans la descrip- tion de l'option -path.

-newer fichier Fichier modifié plus récemment que le fichier indiqué. L'option -newer n'est affectée par l'option -follow que si celle-ci la précède sur la ligne de commande.

-nouser

�'

Fichier dont l'U-ID numérique ne correspond à aucun utilisateur.

-nogroup Fichier dont le G-ID numérique ne correspond à aucun groupe d'utilisateurs.

-path motif Fichier dont le nom complet correspond au motif fourni. Lors du développement des méta-caractères, `/' et `.' ne sont pas traités différement des autres caractères, ainsi par exemple :

find . -path './sr*sc' affichera l'élément de répertoire intitulé './src/misc' (s'il en existe un). Pour ignorer une arborescence complète de répertoires, utilisez l'option -prune plutôt que de vérifier chaque fichier de l'arbre. Par exemple, pour ignorer le répertoire `src/emacs' et tous ses sous-réper- toires, tout en affichant le nom de tous les autres fichiers, faites quelque chose comme :

find . -path './src/emacs' -prune -o-print

-perm mode Fichier dont les autorisations d'accès sont fixées exactement au mode indiqué (en notation symbolique ou octale). La notation symbolique utilise le mode 0 comme point de départ.

-perm -mode Fichier ayant au moins toutes les autorisations indiquées dans le mode.

-perm +mode Fichier ayant certaines des autorisations indiquées dans le mode.

-regex motif Nom de fichier correspondant à l'expression régulière motif. Il s'agit d'une correspondance sur le nom de fichier complet, pas d'une recherche. Par exemple, pour mettre en correspondance un fichier nommé `./fubar3', vous pouvez utiliser les expressions régulières `.*bar.' ou `.*b.*3', mais pas `b.*r3'.

-size n[bckw] Fichier utilisant n unités d'espace. Les unités sont des blocs de 512 octets par défaut (ou si un suffixe `b' suit le nombre n), des octets si un suffixe `c' suit n, des kilo-octets si un suffixe `k' est utilisé, ou des mots de 2 octets si un `w' suit le nombre n. La taille ne prend pas en compte les blocs indirects, mais elle comptabilise les blocs des fichiers éparpillés pas encore alloués.

-true Toujours vrai.

-type c Fichier du type c:

b fichier spécial en mode bloc (avec buffer)

c fichier spécial en mode caractère (sans buffer)

Page 29: Man Des Commandes Linux

�-

d répertoire

p tube nommé (FIFO)

f fichier régulier

l liens symbolique

s socket

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

-used n fichier dont le dernier accès date de n jours après la dernière modification de son statut.

-user utilisateur fichier appartenant à l'utilisateur indiqué (U-ID numérique éventuellement)

-xtype c comme -type sauf si le fichier est un lien symbol- ique. Dans ce cas, si l'option -follow n'a pas été fournie, le test est vrai si le fichier destination du lien est de type c; Si l'option -follow a été réclamée, le test est vrai si c vaut `l'. Autrement dit, pour les liens symboliques, -xtype vérifie le type des fichiers que l'option -type ne vérifie pas.

ACTIONS -exec commande ;

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

-fls fichier vrai; comme -ls mais écrit dans le fichier comme le fait -fprint.

-fprint fichier vrai; écrit le nom complet dans le fichier. Si fichier n'existe pas au démarrage de find, il est créé. S'il existe, il est écrasé. Les noms de fichiers ``/dev/stdout'' et ``/dev/stderr'' sont traités de manière spécifique, ils correspondent respectivement à la sortie standard, et à la sortie des erreurs.

-fprint0 fichier vrai; comme -print0 mais écrit dans le fichier comme le fait -fprint.

-fprintf fichier format vrai; comme -printf mais écrit dans le fichier comme le fait -fprint.

�&

-ok commande ; comme -exec mais interroge d'abord l'utilisateur (en utilisant l'entrée standard). Si la réponse ne commence pas par `y' ou `Y', la commande n'est pas exécutée, et le test devient faux.

-print vrai; affiche le nom complet du fichier sur la sor- tie standard, suivi d'un saut de ligne.

-print0 vrai; affiche le nom complet du fichier sur la sor- tie standard, suivi d'un caractère nul. Ceci permet aux fichiers dont le nom contient un saut de ligne, d'être correctement interprétés par les programmes utilisant les données en sortie de find.

-printf format vrai; affiche le format indiqué sur la sortie stan- dard, en interprétant les séquences d'échappement `\' et les directives`%'. La largeur et la précision des champs peuvent être spécifiés comme dans la fonction printf(3) du langage C. Con- trairement à -print, -printf n'ajoute pas de saut de ligne à la fin de la chaîne. Les séquences d'échappement et les directives % sont les suiv- antes :

\a Sonnerie.

\b Effacement Arrière (Backspace)

\c Arrêter immédiatement l'impression du format et vider le flux de sortie.

\f Saut de page

\n Saut de ligne

\r Retour Chariot

\t Tabulation horizontale

\v Tabulation Verticale

\\ Un caractère `Backslash' littéral (`\').

Un `\' suivi de n'importe quel autre caractère est traité comme un caractère ordinaire; ils sont donc affichés tous les deux.

%% Un caractère pourcentage littéral (%)

%a Date du dernier accès au fichier, dans le format renvoyé par la fonction C ctime(3).

%Ak Date du dernier accès au fichier, dans le format spécifié par k, qui doit être soit un `@', soit une directive pour la fonction C strftime(3). Les valeurs possibles pour k sont indiquées ci-dessous, certaines d'entre-elles ne sont pas disponibles sur tous les systèmes, à cause des différences entre les fonctions strftime(3) existantes.

@ secondes écoulées depuis le 1er Jan- vier 1970 à 00h 00 GMT.

Page 30: Man Des Commandes Linux

�0

Champs horaires :

H heure (00..23)

I heure (01..12)

k heure ( 0..23)

l heure ( 1..12)

M minute (00..59)

p AM, ou PM, avec la désignation locale

r heure, sur un cadran de 12 heures (hh:mm:ss [AP]M)

S secondes (00..61)

T heure, sur un cadran de 24 heures (hh:mm:ss)

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

Z fuseau horaire (par exemple MET), ou rien si le fuseau horaire est indéterminé.

Champs de date :

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

A nom local entier du jour de la semaine, de longueur variable (Dimanche .. Samedi)

b abréviation locale du mois (Jan..Dec)

B nom local entier du mois, de longueur variable (Janvier .. Décem- bre)

c date et heure locales (Sam Nov 04 12:02:33 EST 1989)

d quantième du mois (01..31)

D date (mm/jj/aa)

h comme b

j jour de l'année (001..366)

m mois (01..12)

U numéro de la semaine dans l'année, les semaines commençant le Dimanche (00..53)

w jour de la semaine (0..6), 0 corre- spond à Dimanche

'*

W numéro de la semaine dans l'année, les semaines commençant le Lundi (00..53)

x représentation locale de la date (mm/jj/aa)

y les deux dernier chiffres de l'année (00..99)

Y année (1970...)

%b Taille du fichier en nombre de blocs de 512 octets (arrondi par excès).

%c Date de dernière modification du statut du fichier, dans le format renvoyé par la fonc- tion C ctime(3).

%Ck Date de dernière modification du statut du fichier, dans le format spécifié par k, comme pour la directive %A.

%d Profondeur du fichier dans l'arborescence des répertoires, 0 signifiant que le fichier est un argument de la ligne de commande.

%f Nom du fichier, sans nom de répertoire.

%F Type de système de fichiers sur lequel se trouve le fichier. Cette valeur peut être utilisée pour l'option -fstype.

%g Nom du groupe propriétaire du fichier, ou G- ID numérique si le groupe n'a pas de nom.

%G G-ID numérique du fichier.

%h Répertoires en tête du nom de fichier, (tout sauf le dernier nom).

%H Argument de la ligne de commande à partir duquel le fichier a été trouvé.

%i Numero d'i-noeud du fichier (en décimal).

%k Taille du fichier, en nombre de blocs de 1 Kilo-Octet, arrondi par excès.

%l Destination du lien symbolique (vide si le fichier n'est pas un lien symbolique).

%m Bits d'autorisation d'accès au fichier (en octal).

%n Nombre de liens physiques sur le fichier.

%p Nom du fichier.

%P Nom du fichier, ainsi que le nom de l'argu- ment de ligne de commande à partir duquel le fichier a été trouvé.

%s Taille du fichier en octets.

%t Date de dernière modification du fichier, dans le format renvoyé par la fonction C

Page 31: Man Des Commandes Linux

'�

ctime(3).

%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.

Un caractère `%' suivi de tout autre caractère est éliminé (mais le second caractère est affiché).

-prune vrai si l'option -depth n'est pas fournie; ne pas descendre dans l'arborescence du répertoire en cours. faux si l'option -depth est fournie, et sans effet.

-ls vrai, affiche le nom du fichier en cours dans le 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- tionnée, auquel cas la taille est calculée en blocs de 512 octets.

OPERATEURS Dans l'ordre de précédence décroissante :

( expr ) Force la précédence.

! expr Vrai si expr est fausse.

-not expr Comme ! expr.

expr1 expr2 ET (implicite); expr2 n'est pas évaluée si expr1 est fausse.

expr1 -a expr2 Comme expr1 expr2.

expr1 -and expr2 Comme expr1 expr2.

expr1 -o expr2 OU; expr2 n'est pas évaluée si expr1 est vraie.

expr1 -or expr2 Comme expr1 -o expr2.

expr1 , expr2 Liste; expr1 et expr2 sont toujours évaluées toutes les deux. La valeur de expr1 est ignorée; la valeur de la liste est celle de expr2.

VOIR AUSSI locate(1L), locatedb(5L), updatedb(1L), xargs(1L) Finding Files (en-ligne dans Info, ou en version imprimée)

TRADUCTION Christophe Blaess, 1997.

'�

FSF 15 Janvier 1997 FIND(1L)

!� �%�������������� ����,���-��' �. !� �%����

NOM finger - Rechercher des informations sur un utilisateur.

SYNOPSIS finger [-lmsp] [user ...] [user@host ...]

DESCRIPTION finger affiche des informations sur les utilisateurs.

Options:

-s Finger affiche le nom de login, le nom réel, le terminal et l'autorisation d'écriture (``*'' signi- fie que l'écriture sur le terminal est interdite), le temps d'inactivité, la date de login, l'adresse et le numéro de téléphone de travail.

La date de login est affichée sous la forme mois, jour, heure, minutes, à moins qu'elle ne remonte à plus de six mois, auquel cas l'année est affichée à la place de l'heure et des minutes.

Si le terminal, le temps d'inactivité ou la date de login sont inconnus ou indisponibles, ils sont rem- placés par des astérisques.

-l produit un affichage multi-lignes contenant toutes les informations de l'option -s avec en plus le répertoire de démarrage de l'utilisateur, son numéro de téléphone personnel, l'état de sa boîte aux lettres, et le contenu des fichiers ".plan", ".project" et ".forward" de son répertoire de démarrage.

Les numéros de téléphone à onze chiffres sont affichés sous la forme ``+N-NNN-NNN-NNNN''. Les numéros à dix ou sept chiffres sont affichés comme des numéros à onze chiffres tronqués. Les numéros à cinq chiffres sont affichés sous la forme ``xN- NNNN''. Les numéros à quatre chiffres sont affichés sous la forme ``xNNNN''.

Si l'écriture sur le terminal est interdite, le texte ``(messages off)'' est ajouté à la ligne con- tenant le numéro du terminal. Avec l'option -l, chaque utilisateur est affiché séparément; si un même utilisateur est connecté plusieurs fois, tous les terminaux associés sont affichés en bloc.

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 a consulté sa boîte aux lettres depuis la dernière arrivée de courrier, ou ``New mail received ...'', `` Unread since ...'' s'il est arrivé du courrier depuis la dernière consultation.

Page 32: Man Des Commandes Linux

'�

-p supprime l'affichage des fichiers ".plan" et ".pro- ject".

-m désactive la recherche automatique des noms d'utilisateur. User est généralement un nom de login; cependant la recherche s'effectue aussi sur le nom réel si l'on ne spécifie pas l'option -m. La recherche s'effectue sans differencier les majuscules et les minuscules.

Sans options, finger utilise le style d'affichage corre- spondant à -l s'il y a des opérandes, et -s sinon. Noter que dans les deux formats certains champs peuvent manquer si l'information correspondante n'est pas disponible.

Sans argument, finger affiche les informations concernant tous les utilisateurs actuellement connectés.

Finger peut être utilisé pour chercher des utilisateurs sur une machine distante. Ces utilisateurs sont spécifiés sous la forme user@host ou @host, le format d'affichage par défaut est -l dans le premier cas et -s dans le sec- ond. L'option -l est la seule qui peut être transmise à une machine distante.

VOIR AUSSI chfn(1), passwd(1), w(1), who(1).

HISTORIQUE La commande finger est apparue dans BSD 3.0.

TRADUCTION Michel Quercia, 1997.

BSD Expérimental 24 Mai 1997 FINGER(1)

!(���"� ��!(���"�

NAME fsck - check and repair a Linux file system

SYNOPSIS fsck [ -sACVRTNP ] [ -t fstype ] filesys [ ... ] [--] [ fsck-options ]

DESCRIPTION fsck is used to check and optionally repair a one or more Linux file systems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). The fsck program will try to run filesystems on different physical disk drives in parallel to reduce total amount time to check all of the filesystems.

The exit code returned by fsck is the sum of the following conditions:

'!

0 - No errors 1 - File system errors corrected 2 - System should be rebooted 4 - File system errors left uncorrected 8 - Operational error 16 - Usage or syntax error 128 - Shared library error

The exit code returned when all file systems are checked using the -A option is the bit-wise OR of the exit codes for each file system that is checked.

In actuality, fsck is simply a front-end for the various file system checkers (fsck.fstype) available under Linux. The file system-specific checker is searched for in /sbin first, then in /etc/fs and /etc, and finally in the direc- tories listed in the PATH environment variable. Please see the file system-specific checker manual pages for fur- ther details.

OPTIONS -s Serialize fsck operations. This is a good idea if

you checking multiple filesystems and the checkers are in an interactive mode. (Note: e2fsck(8) runs in an interactive mode by default. To make e2fsck(8) run in a non-interactive mode, you must either specify the -p or -a option, if you wish for errors to be corrected automatically, or the -n option if you do not.)

-t fslist 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 options specifiers. All of the filesystems in this 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 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 negation operator) contain fs-option in their options field of the /etc/fstab file will be checked.

For compatibility with Mandrake distributions whose boot scripts depend upon an unauthorized UI change to the fsck program, if a filesystem type of loop is found in fslist, it is treated as if opts=loop were specified as an argument to the -t option.

Normally, the filesystem type is deduced by search- ing for filesys in the /etc/fstab file and using the corresponding entry. If the type can not be deduced, and there is only a single filesystem given as an argument to the -t option, fsck will use the specified filesystem type. If this type is not available, then the default file system type (currently ext2) is used.

Page 33: Man Des Commandes Linux

'�

-A Walk through the /etc/fstab file and try to check all file systems in one run. This option is typi- cally used from the /etc/rc system initalization file, instead of multiple commands for checking a single file system.

The root filesystem will be checked first unless the -P option is specified (see below). After that, filesystems will be checked in the order specified by the fs_passno (the sixth) field in the /etc/fstab file. Filesystems with a fs_passno value of 0 are skipped and are not checked at all. Filesystems with a fs_passno value of greater than zero will be checked in order, with filesystems with filesystems with the lowest fs_passno number being checked first. If there are multiple filesystems with the same pass number, fsck will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk.

Hence, a very common configuration in /etc/fstab files is to set the root filesystem to have a fs_passno value of 1 and to set all filesystems to have a fs_passno value of 2. This will allow fsck to automatically run filesystem checkers in paral- lel if it is advantageous to do so. System admin- istrators might choose not to use this configura- tion if they need to avoid multiple filesystem checks running in parallel for some reason --- for example, if the machine in question is short on memory so that excessive paging is a concern.

-C Display completion/progress bars for those filesys- tems checkers (currently only for ext2) which sup- port them. Fsck will manage the filesystem check- ers so that only one of them will display a progress bar at a time.

-N Don't execute, just show what would be done.

-P When the -A flag is set, check the root filesystem in parallel with the other filesystems. This is not the safest thing in the world to do, since if the root filesystem is in doubt things like the e2fsck(8) executable might be corrupted! This option is mainly provided for those sysadmins who don't want to repartition the root filesystem to be small and compact (which is really the right solu- tion).

-R When checking all file systems with the -A flag, skip the root file system (in case it's already mounted read-write).

-T Don't show the title on startup.

-V Produce verbose output, including all file system- specific commands that are executed.

fsck-options Options which which are not understood by fsck are passed to the filesystem-specific checker. These arguments must not take arguments, as there is no way for fsck to be able to properly guess which arguments take options and which don't.

''

Options and arguments which follow the -- are treated as file system-specific options to be passed to the file system-specific checker.

Please note that fsck is not designed to pass arbi- trarily complicated options to filesystem-specific checkers. If you're doing something complicated, please just execute the filesystem-specific checker directly. If you pass fsck some horribly compli- cated option and arguments, and it doesn't do what you expect, don't bother reporting it as a bug. You're almost certainly doing something that you shouldn't be doing with fsck.

Currently, standardized file system-specific options are somewhat in flux. Although not guaranteed, the following options are supported by most file system checkers:

-a Automatically repair the file system without any questions (use this option with caution). Note that e2fsck(8) supports -a for backwards compati- bility only. This option is mapped to e2fsck's -p option which is safe to use, unlike the -a option that most file system checkers support.

-r Interactively repair the filesystem (ask for con- firmations). Note: It is generally a bad idea to use this option if multiple fsck's are being run in parallel. Also note that this is e2fsck's default behavior; it supports this option for backwards compatibility reasons only.

AUTHOR Theodore Ts'o ([email protected])

FILES /etc/fstab.

ENVIRONMENT VARIABLES The fsck program's behavior is affected by the following environment variables:

FSCK_FORCE_ALL_PARALLEL If this environment variable is set, fsck will attempt to run all of the specified filesystems in parallel, regardless of whether the filesystems appear to be on the same device. (This is useful for RAID systems or high-end storage systems such as those sold by companies such as IBM or EMC.)

FSCK_MAX_INST This environment variable will limit the maximum number of file system checkers that can be running at one time. This allows configurations which have a large number of disks to avoid fsck starting too many file system checkers at once, which might overload CPU and memory resources available on the system. If this value is zero, then an unlimited number of processes can be spawned. This is cur- rently the default, but future versions of fsck may attempt to automatically determine how many file system checks can be run based on gathering accounting data from the operating system.

PATH The PATH environment variable is used to find file system checkers. A set of system directories are searched first: /sbin, /sbin/fs.d, /sbin/fs,

Page 34: Man Des Commandes Linux

'-

/etc/fs, and /etc. Then the set of directories found in the PATH environment are searched.

FSTAB_FILE This environment variable allows the system admin- istrator to override the standard location of the /etc/fstab file. It is also use for developers who are testing fsck.

SEE ALSO fstab(5), mkfs(8), fsck.minix(8), fsck.ext2(8) or e2fsck(8), fsck.xiafs(8).

E2fsprogs version 1.27 March 2002 FSCK(8)

��%���� ������� ����������������� ����%����

NOM grep, egrep, fgrep - Afficher les lignes correspondant à un motif donné.

SYNOPSIS grep [ -[[AB] ]num ] [ -[CEFGVBchilnsvwx] ] [ -e ] motif | -ffichier ] [ fichiers... ]

DESCRIPTION Grep Recherche dans les fichiers d'entrée indiqués les lignes correspondant à un certain motif.

Si aucun fichier n'est fourni, ou si le nom `-' est men- tionné, la lecture se fait depuis l'entrée standard.

Par défaut, grep affiche les lignes correspondant au motif.

Il existe trois variantes principales de grep, controlées par les options suivantes.

-G Interprète le motif comme une expression régulière simple (voir plus bas). C'est le comportement par défaut.

-E Interprète le motif comme une expression régulière étendue (voir plus bas).

-F Interprète le motif comme une liste de chaînes figées, séparées par des Sauts de Lignes (NewLine). La correspondance est faite avec n'importe laquelle de ces chaînes.

De plus, il existe deux variantes du programme : egrep et fgrep. Egrep est similaire (sans être identique) à grep -E, et est compatible avec les versions UNIX his- toriques de egrep. Fgrep est identique à grep -F.

Toutes les variantes de grep acceptent les options suiv- antes : -num Les correspondances seront affichées avec num

lignes supplémentaires avant et après. Néanmoins, grep n'affichera jamais une ligne plus d'une fois.

'&

-A num Afficher num lignes supplémentaires après la ligne correspondante.

-B num Afficher num lignes supplémentaires avant la ligne correspondante.

-C est équivalent à -2. -V Afficher le numéro de version de grep sur la sortie

d'erreur standard. Ce numéro de version devra être inclus dans tous les rapports de bugs (voir plus bas).

-b Avant chaque ligne, afficher son décalage (en octet) au sein du fichier d'entrée.

-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- 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 les caractères accentués...)

-L Ne pas afficher les résultats normaux. A la place, indiquer le nom des fichiers pour lesquels aucun résultat n'aurait été affiché.

-l Ne pas afficher les résultats normaux. A la place, indiquer le nom des fichiers pour lesquels des résultats auraient été affiches.

-n Ajouter à chaque ligne de sortie un préfixe con- tenant son numéro dans le fichier d'entrée.

-q Silence. Ne pas afficher les résultats normaux. -s Ne pas afficher les messages d'erreurs concernant

les fichiers inexistants ou illisibles. -v Inverser la mise en correspondance, pour sélection-

ner les lignes ne correspondant pas au motif. -w Ne sélectionner que les lignes contenant une corre-

spondance formant un mot complet. La sous-chaîne correspondante doit donc être soit au début de la ligne, soit précédée d'un caractère n'appartenant pas à un mot. De même elle doit se trouver soit à la fin de la ligne, soit être suivie par un car- actère n'appartenant pas à un mot. Les caractères composants les mots sont les lettres, les chiffres et le souligné (`_'). ([NDT] Bien entendu les minuscules accentuées ne sont pas des lettres ! elles servent donc à séparer les mots...)

-x Ne sélectionner que les correspondances qui occu- pent une ligne entière.

EXPRESSIONS RÉGULIÈRES Une expression régulière est un motif qui permet de décrire un ensemble de chaînes. Les expressions régulières sont construites comme des opérations arithmétiques, en utilisant des opérateurs divers pour combiner des expres- sions plus petites.

Grep comprend deux versions différentes pour la syntaxe des expressions régulières : ``simple'' et ``étendue.'' Dans la version GNU de grep, il n'y a pas de différence dans les fonctionnalités disponibles en utilisant l'une ou l'autre des syntaxes. Dans d'autres implémentations, les expressions régulières simples sont moins puissantes. La

Page 35: Man Des Commandes Linux

'0

description ci-dessous correspond aux expressions éten- dues, les différences avec les expressions simples étant résumées ensuite.

Les briques élémentaires sont les expressions régulières correspondant à un simple caractère. La plupart des car- actères, y compris toutes les lettres et les chiffres, sont des expressions régulières se correspondant à eux- mêmes. Tout méta-caractère ayant une signification spéciale doit être protégé en le faisant précéder d'un BackSlash.

Une liste de caractères, encadrée par [ et ] peut être mise en correspondance avec n'importe quel caractère unique appartenant à la liste. Si le premier caractère de la liste est l'accent circonflexe ^ alors la mise en cor- respondance se fait avec n'importe quel caractère absent de la liste. Par exemple, l'expression régulière [0123456789] convient pour n'importe quel chifre unique.

Un intervalle de caractères ASCII peut être indiqué en donnant le premier et le dernier caractère séparés par un tiret.

Finalement il existe certaines classes de caractères prédéfinies. Leurs noms sont assez explicites : [:alnum:], [:alpha:], [:cntrl:], [:digit:] (chiffres), [:graph:], [:lower:] (minuscules), [:print:] (affich- ables), [:punct:], [:space:], [:upper:] (majuscules), et [:xdigit:] (chiffres héxadécimaux). par exemple, [[:alnum:]] correspond à [0-9A-Za-z], à la différence que le dernier dépend de l'encodage ASCII, alors que le pre- mier est plus portable. Remarquez que les crochets dans les noms de classes font partie intégrante du nom symbol- ique, et qu'ils doivent donc être inclus en plus des cro- chets encadrant la liste. La plupart des méta-caractères perdent leurs significations spéciales au sein des listes. Pour inclure un ] littéral, mettez-le en premier dans la liste. De même, pour inclure un ^ littéral, placez-le n'importe ou sauf au début de la liste. Enfin, pour inclure un - placez-le en dernier.

Le point . correspond à n'importe quel caractère unique. Le symbole \w est un synonyme de [[:alnum:]] et \W un syn- onyme de [^[:alnum]].

L'accent circonflexe ^ et le symbole dollar $ sont des méta-caratères correspondant respectivement à une chaîne vide au début et en fin de ligne. Les symboles \< et \> correspondent respectivement à une chaîne vide en début et 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 ne se trouvant pas à une extrémité de mot.

Une expression régulière correspondant à un caractère unique peut être suivie par l'un des opérateurs de répétition suivants : ? 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. + 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.

-*

{,m} L'élément précédent est facultatif et doit être mis en correspondance m fois au plus.

{n,m} L'élément précédent doit être mis en correspondance au moins n fois, mais au plus m fois.

Deux expressions régulières peuvent être juxtaposées, l'expression en résultant correspondra à toute chaîne formée par la juxtaposition de deux sous-chaînes corre- spondant respectivement aux deux sous-expression.

Deux expressions régulières peuvent être reliées par l'opérateur infixe |; l'expression résultante correspondra à toute chaîne correspondant à l'une ou l'autre des deux sous-expressions.

Les répétitions ont priorité sur les juxtapositions, qui à leur tour ont priorité sur les alternatives. Une sous- expression peut être entourée par des parenthèses pour modifier ces règles de précédence.

La référence inverse \n, ou n est un chiffre, correspond à la sous-chaîne déjà mise en correspondance avec la nième sous-expression régulière entre parenthèses.

Dans les expressions régulières simples, les méta-car- actères ?, +, {, |, (, et ) perdent leurs significations spéciales, il faut utiliser à la place leurs versions avec BackSlash \?, \+, \{, \|, \(, et \).

Dans egrep le méta-caractère { perd sa signification spéciale, il faut utiliser \{ à la place.

DIAGNOSTIQUE Normalement, le code de retour est 0 si des correspon- dances ont été trouvées, et 1 si aucune correspondance n'a été faite. L'option -v inverse le sens du code de retour. Le code de retour correspond à des erreurs de syntaxe dans le motif, des fichiers d'entrée inaccessibles, ou d'autres erreurs système.

BOGUES Envoyez les rapports de bug ([NDT] en anglais !) à bug- [email protected]. Assurez-vous d'inclure le mot ``grep'' quelque part dans le champ ``Subject:''.

Dans les constructions {m,n} de grandes valeurs de répétition peuvent pousser grep à utiliser beaucoup de mémoire. De plus, certaines autres expressions régulières obscures peuvent prendre un temps exponentiellement long, et mener à un manque de mémoire.

Les références inverses sont très lentes et peuvent néces- siter un temps exponentiellement long.

TRADUCTION Christophe Blaess, 1997.

FSF 15 Janvier 1997 GREP(1)

���'��##�"� ���������'��##�"�

Page 36: Man Des Commandes Linux

-�

NAME groupadd - Create a new group

SYNOPSIS groupadd [-g gid [-o]] [-r] [-f] group

DESCRIPTION The groupadd command creates a new group account using the values specified on the command line and the default val- ues from the system. The new group will be entered into the system files as needed. The options which apply to the groupadd command are

-g gid The numerical value of the group's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than 500 and greater than every other group. Values between 0 and 499 are typically reserved for system accounts.

-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, the group won't be altered (or added again). This option also modifies the way -g option works. When you request a gid that it is not unique and you don't specify the -o option too, the group cre- ation will fall back to the standard behavior (adding a group as if neither -g or -o options were specified). This is an option added by Red Hat.

FILES /etc/group - group account information /etc/gshadow - secure group account information

SEE ALSO chfn(1), chsh(1), useradd(8), userdel(8), usermod(8), passwd(1), groupdel(8), groupmod(8)

AUTHOR Julianne Frances Haugh ([email protected])

GROUPADD(8)

���'�#%��"� ���������'�#%��"�

NAME groupdel - Delete a group

SYNOPSIS groupdel group

-�

DESCRIPTION The groupdel command modifies the system account files, deleting all entries that refer to group. The named group must exist.

You must manually check all filesystems to insure that no files remain with the named group as the file group ID.

CAVEATS You may not remove the primary group of any existing user. You must remove the user before you remove the group.

FILES /etc/group - group information /etc/gshadow - secure group information

SEE ALSO chfn(1), chsh(1), useradd(8), userdel(8), usermod(8), passwd(1), groupadd(8), groupmod(8)

AUTHOR Julianne Frances Haugh ([email protected])

������� ������� ����������������� ���������

NOM gzip, gunzip, zcat - Compresser ou décompresser des fichiers.

SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffixe] [ nom ... ] gunzip [ -acfhlLnNrtvV ] [-S suffixe] [ nom ... ] zcat [ -fhLV ] [ nom ... ]

DESCRIPTION gzip réduit la taille des fichiers nommés en utilisant le codage Lempel-Ziv (LZ77). Quand c'est possible, chaque fichier est remplacé par un autre fichier portant l'exten- sion .gz, en gardant les mêmes modes de permissions, et les mêmes date de dernier accès et de modification. (L'extension par défaut est -gz pour VMS, z pour MSDOS, 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 standard est compressée sur la sortie standard. gzip 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 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 pas de limites en ce qui concerne la longueur des noms de fichiers.

Par défaut, gzip garde le nom du fichier original et son horodatage dans le fichier compressé. Ceux-ci sont utilisés durant la décompression du fichier avec l'option

Page 37: Man Des Commandes Linux

-�

-N. C'est utile quand le nom du fichier compressé a été tronqué ou quand l'horodate n'a pas été préservée lors d'un transfert de fichier.

Les fichiers compressés peuvent être restaurés dans leur forme originale en utilisant gzip -d ou gunzip ou bien encore zcat. Si le nom original sauvé dans le fichier compressé ne convient pas à son système de fichiers, un nouveau nom est construit à partir de l'original pour le rendre conforme.

gunzip prend une liste de fichiers sur la ligne de comman- des et remplace chaque fichier dont le nom se termine par .gz, -gz, .z, -z, _z or .Z, et qui commence par le nombre magique correct, par un fichier décompressé sans l'exten- sion originale. gunzip reconnaît également les extensions spéciales .tgz et .taz comme des raccourcis pour .tar.gz et .tar.Z respectivement. Pendant la compression, gzip utilise l'extension .tgz si nécessaire au lieu de tronquer un fichier d'extension .tar .

gunzip peut actuellement décompresser les fichiers créés par gzip, zip, compress, compress -H ou pack. La détec- tion du format d'entrée se fait automatiquement. Quand il utilise les deux premiers formats, gunzip vérifie un CRC 32 bit. Pour pack, gunzip vérifie la longueur du fichier décompressé. Le format compress standard n'a pas été prévu pour permettre des contrôles de cohérence. Néanmoins, gun- zip est quelquefois capable de détecter un fichier .Z défectueux. Si vous obtenez une erreur durant la décom- pression d'un fichier .Z, ne supposez pas que le fichier .Z est correct uniquement parce que l'uncompress standard ne se plaint pas. Cela signifie en général que l'uncom- press standard ne vérifie pas son entrée, et génère une sortie "dégradée" sans s'en offusquer. Le format -H du compress de SCO (méthode de compression LZH) n'inclut pas de CRC mais permet tout de même quelques tests de cohérence.

Les fichiers créés par zip ne peuvent être décompressés par gzip que s'ils n'ont qu'un seul membre compressé avec la méthode de "dégonflement". Cette caractéristique n'est prévue que pour faciliter la conversion de fichiers .tar.zip au format .tar.gz. Pour extraire des fichiers zip contenant plusieurs membres, utilisez unzip au lieu de gunzip.

zcat est identique à gunzip -c. (Sur certains systèmes, zcat peut être installé en tant que gzcat pour préserver le lien original vers compress.) zcat décompresse ou bien une liste de fichiers obtenue à partir de la ligne de com- mandes, ou bien son entrée standard, et décompresse les données sur la sortie standard. zcat décompressera les fichiers ayant le nombre magique correct qu'ils aient un suffixe .gz ou non.

gzip utilise l'algorithme de Lempel-Ziv utilisé par zip et PKZIP. Le pourcentage de compression obtenu dépend de la taille de l'entrée, et de la distributions des sous-chaînes de caractères communes. Typiquement, des fichiers textes du type code source en anglais seront com- pressés à hauteur de 60-70%. La compression est en général nettement meilleure que celle obtenue par LZW (utilisé par compress), le codage de Huffman (utilisé dans pack), ou le codage de Huffman adaptatif (compact).

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

-!

compressé est légèrement plus grand que l'original. L'expansion dans le pire des cas est de quelques octets pour l'entête du fichier gzip, plus 5 octets tous les blocs de 32Ko, ou une expansion de 0.015% pour les grands fichiers. Notez que le nombre de blocs de disque réelle- ment utilisé n'augmente presque jamais. gzip préserve les modes, permissions et horodates des fichiers pendant la compression ou la décompression.

OPTIONS -a --ascii

Mode texte ascii : convertit les fins de lignes en utilisant les conventions locales. Cette option n'est supportée que sur les systèmes non Unix. Pour MSDOS, CR LF est converti en LF pendant la compres- sion, et LF est converti en CR LF pendant la décom- pression.

-c --stdout --to-stdout Ecrire la sortie sur la sortie standard ; garder les fichiers originaux non modifiés. S'il y a de multiples fichiers, la sortie consiste en une séquence de membres compressés indépendamment. Pour obtenir une meilleure compression, gzip concatène tous les fichiers d'entrées avant de les com- presser.

-d --decompress --uncompress Décompresser.

-f --force Forcer la compression ou la décompression même si le fichier est cible de plusieurs liens durs, ou si le fichier correspondant existe, ou encore si les données compressées sont lues ou écrites à partir d'un terminal. Si les données d'entrée ne sont pas dans un format reconnu par gzip, et si l'option --stdout est également fournie, copier les données en entrée sans modification sur la sortie standard : laisser zcat se comporter comme cat. Si -f n'est pas donné, et quand il ne tourne pas en arrière-plan, gzip interroge l'utilisateur pour vérifier si un fichier existant doit être écrasé ou non.

-h --help Afficher un écran d'aide et se terminer.

-l --list Pour chaque fichier compressé, afficher les champs suivants :

compressed size : taille du fichier compressé uncompressed size : taille du fichier décom-

pressé ratio : coefficient de compression (0.0% si

inconnu) uncompressed_name: nom du fichier décompressé

La taille du fichier compressé vaut -1 pour les fichiers n'étant pas au format gzip, comme les fichiers compressés .Z. Pour obtenir la taille décompressée pour de tels fichiers, vous pouvez utiliser :

zcat fichier.Z | wc -c

Page 38: Man Des Commandes Linux

-�

En combinaison avec l'option --verbose, les champs suivants sont également affichés :

method: méthode de compression crc: CRC 32-bit des données décompressées date & time: horodate du fichier décompressé

Les méthodes de compression actuellement supportées sont deflate, compress, lzh (SCO compress -H) et pack. La valeur du CRC affichée est de ffffffff pour les fichiers n'étant pas au format gzip

Avec --name, le nom décompressé, la date et heure sont celles stockées dans le fichier compressé (s'il y en a).

Avec --verbose, les totaux de taille et de coeffi- cient de compression pour tous les fichiers sont également affichés, à moins que certaines tailles ne soient inconnues. Avec --quiet, les lignes de titres et de totaux ne sont pas affichées.

-L --license Afficher la license d'utilisation de gzip et se terminer.

-n --no-name Pendant la compression, ne pas sauver les noms et horodates des fichiers originaux par défaut. (Le nom original est toujours sauvé si le nom du fichier a dû être tronqué.) Pendant la décompres- sion, ne pas restaurer le nom du fichier original s'il est présent (uniquement supprimer le suffixe gzip du nom du fichier compressé), et ne pas restaurer l'horodate originale si elle est présente (prendre celle du fichier compressé). Cette option est activée par défaut durant la décompression.

-N --name Pendant la compression, toujours sauver les noms et horodates des fichiers originaux; c'est le com- portement par défaut. Pendant la décompression, restaurer le nom du fichier original et son horo- date s'ils sont présents. Cette option est utile sur les systèmes ayant une limite sur la longueur des noms de fichiers ou quand l'horodate a été per- due lors d'un transfert de fichier.

-q --quiet Supprimer tous les avertissements.

-r --recursive Parcourir la structure du répertoire récursivement. Si l'un des noms de fichiers spécifiés sur la ligne de commandes est un répertoire, gzip descendra dans ce répertoire et compressera tous les fichiers qu'il y trouve (ou les décompressera dans le cas de gunzip ).

-S .suf --suffix .suf Utiliser le suffixe .suf au lieu de .gz. N'importe quel suffixe peut être donné, mais les suffixes différents de .z et .gz devraient être évités pour empêcher une confusion lors du transfert de fichiers sur d'autres systèmes. Un suffixe vide force gunzip à essayer de décompresser tous les

-'

fichiers donnés quelque soit leur suffixe, comme dans

gunzip -S "" * (*.* pour MSDOS)

Des versions précédentes de gzip utilisaient le suffixe .z. Ceci a été changé pour éviter un con- flit avec pack (1).

-t --test Tester. Vérifier l'intégrité du fichier compressé.

-v --verbose Mode volubile. Afficher le nom et le pourcentage de réduction pour chaque fichier compressé ou décom- pressé.

-V --version Version. Afficher le numéro de version et les options de compilation puis se terminer.

-# --fast --best Réguler la vitesse de compression en utilisant le chiffre # spécifié, où -1 ou --fast indique la méthode de compression la plus rapide (la moins bonne compression), et -9 ou --best indique la méthode de compression la plus lente (la meilleure compression). Le niveau de compression par défaut -6 (càd biaisé en faveur d'une forte compression au lieu de la vitesse d'exécution.

UTILISATION AVANCÉE De multiple fichiers compressés peuvent être concaténés. Dans ce cas gunzip extraiera tous les membres ensemble. Par exemple,

gzip -c file1 > foo.gz gzip -c file2 >> foo.gz

Alors gunzip -c foo

est équivalent à

cat file1 file2

Dans le cas où un membre d'un fichier .gz est endommagé, les autres membres peuvent toujours être récupérés (si le membre endommagé est supprimé). Néanmoins, vous pouvez obtenir une meilleur compression en compressant tous les membres ensemble :

cat file1 file2 | gzip > foo.gz

compresse mieux que

gzip -c file1 file2 > foo.gz

Si vous voulez recompresser des fichiers concaténés pour obtenir une meilleure compression, faites

gzip -cd old.gz | gzip > new.gz

Si un fichier compressé est constitué de plusieurs mem- bres, la taille décompressée et le CRC rapportés par l'option --list s'appliquent uniquement au dernier membre. Si vous avez besoin de la taille décompressée de tous les

Page 39: Man Des Commandes Linux

--

membres, vous pouvez utiliser

gzip -cd file.gz | wc -c

Si vous voulez créer un fichier archive contenant de mul- tiples membres de sorte que les membres puissent être ensuite extraits indépendamment, utilisez un archiveur comme tar ou zip. GNU tar supporte l'option -z pour invo- quer gzip de façon transparente. gzip est conçu comme un complément à tar, pas comme son remplaçant.

ENVIRONNEMENT La variable d'environnement GZIP peut contenir un ensemble d'options par défaut pour gzip. Ces options sont interprétées en premier lieu et peuvent être surchargées explicitement par les paramètres explicites présents sur la ligne de commandes. Par exemple,

pour sh: GZIP="-8v --name"; export GZIP pou csh: setenv GZIP "-8v --name" pour MSDOS: set GZIP=-8v --name

Sur Vax/VMS, le nom de la variable d'environnement est- GZIP_OPT, pour éviter un conflit avec l'ensemble de sym- boles utilisés lors de l'invocation du programme.

VOIR AUSSI compact(1). compress(1), gzexe(1), pack(1), unzip(1), zcmp(1), zforce(1), zip(1), zmore(1), znew(1),

DIAGNOSTIQUES La valeur de sortie vaut normalement 0; si une erreur se produit, la valeur de sortie sera de 1. Si un avertisse- ment se produit, la valeur de sortie sera de 2.

Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...] Les options invalides sont indiquées sur la ligne de commandes.

fichier: not in gzip format Le fichier spécifié à gunzip n'a pas été com- pressé.

fichier: Corrupt input. Use zcat to recover some data. Le fichier compressé a été endommagé. Les données se situant jusqu'au point d'échec peuvent être récupérées en utilisant

zcat file > recover fichier: compressed with xx bits, can only handle yy bits

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 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, ce qui signifie en général que le fichier d'entrée a été corrompu.

xx.x% Pourcentage du fichier d'entrée sauvé par la com- pression. (Pertinent uniquement pour -v et -l.)

-- not a regular file or directory: ignored Qaund l'entrée n'est pas un fichier régulier ou un

-&

répertoire (çàd un lien symbolique, un socket, une FIFO ou un fichier spécial de périphérique), elle n'est pas altérée.

-- has xx other links: unchanged Le fichier d'entrée est "visé" par un ou des liens durs; il est laissé inchangé. Voyez ln(1) pour plus d'information. Utilisez l'option -f pour forcer la compression de fichiers liés plus d'une fois.

INCONVÉNIENTS Pendant l'écriture de données compressées sur une bande magnétique, il est généralement nécessaire d'ajouter des zéros à la sortie jusqu'à arriver à une limite de bloc (padding). Quand les données sont lues et que le bloc entier est envoyé à gunzip pour la décompression, gunzip 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. Vous devez utiliser l'option --quiet pour supprimr cet avertissement. Cette option peut être placée dans la variable d'environnement GZIP comme suit :

pour sh: GZIP="-q" tar -xfz --block-compress /dev/rst0 pour csh: (setenv GZIP -q; tar -xfz --block-compr

/dev/rst0

Dans l'exemple ci-dessus, gzip est invoqué explicitement par l'option -z du tar GNU. Assurez-vous que la même taille de bloc (option -b de tar) est utilisée pour la lecture et l'écriture de données compressées sur des ban- des. (Cet exemple suppose que vous utilisez la version GNU de tar.)

BOGUES L'option --list rapporte des tailles incorrectes si elles excèdent 2 GB. L'option --liste rapporte des tailles de -1 et un CRC de ffffffff si le fichier compressé est situé sur un medium à accès non aléatoire (séquentiel par exem- ple).

Dans quelques rares cas, l'option --best donne une moins bonne compression que le niveau de compression par défaut (-6). Sur certains fichiers hautement redondants, compress compresse mieux que gzip.

TRADUCTION Frédéric Delanoy, 2000.

Linux 29 Août 2000 GZIP(1)

�%�#��� ������� ����������������� ���%�#���

NOM head - Afficher le début d'un fichier.

SYNOPSIS head [-c N[bkm]] [-n N] [-qv] [--bytes=N[bkm]] [--lines=N] [--quiet] [--silent] [--verbose] [--help] [--version] [fichier...]

Page 40: Man Des Commandes Linux

-0

head [-Nbcklmqv] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de head.

head affiche la première partie (10 lignes par défaut) de chacun des fichiers mentionnés. La lecture se fait sur l'entrée standard si aucun fichier n'est indiqué, ou si le nom `-' est fourni.

Si plusieurs fichiers sont fournis, un en-tête est affiché avant chacun d'eux, mentionnant le nom du fichier entre `==>' et `<=='.

OPTIONS head accepte deux formats d'options : le nouveau où les nombres sont des arguments suivant les options indiquées par des lettres et l'ancien dans lequel les nombres précèdent les lettres d'option.

-c N, --bytes N Afficher les N premiers octets. N est un entier non nul, suivi éventuellement d'une lettre indiquant une unité différente de l'octet.

b Bloc de 512 octets.

k Bloc de 1 Ko.

m Bloc de 1 Mo.

-n N, --lines N Afficher les N premières lignes.

-q, --quiet, --silent Ne pas afficher les en-têtes mentionnant les noms de fichiers.

-v, --verbose Toujours afficher les en-têtes mentionnant les noms de fichiers.

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

TRADUCTION Christophe Blaess, 1997.

FSF 12 Janvier 1997 HEAD(1)

�#���� ������� ����������������� ����#����

NOM id - Afficher les UIDs et GIDs effectifs et réels.

&*

SYNOPSIS id [-gnruG] [--group] [--name] [--real] [--user] [--groups] [--help] [--version] [utilisateur]

DESCRIPTION Cette page de manuel documente la version GNU de id.

id affiche des informations concernant l'utilisateur indiqué, ou le processus appelant si aucun utilisateur n'est mentionné.

Par défaut, il affiche l'U-ID réel, le G-ID réel, l'U-ID 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 supplémentaires. Chaque valeur est affichée précédée d'un libellé l'identifiant, et suivie entre parenthèses des noms de groupe ou d'utilisateur.

Les options permettent à id de n'afficher qu'une partie de ces informations.

OPTIONS -g, --group

Afficher uniquement le Group-ID.

-G, --groups Afficher uniquement les groupes supplémentaires.

--help Afficher un message d'aide sur la sortie standard et terminer normalement.

-n, --name Afficher les noms de groupe ou d'utilisateur à la place du numéro d'ID. Nécéssite -u, -g, ou -G.

-r, --real Afficher les U-ID et G-ID réels plutot que ceux effectifs. Nécéssite -u, -g, ou -G.

-u, --user N'afficher que l'User-ID.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 ID(1L)

� ���"� �����������(/���&�� &�������*����������� ���"�

NAME init, telinit - process control initialization

SYNOPSIS /sbin/init [ -a ] [ -s ] [ -b ] [ -z xxx ] [ 0123456Ss ] /sbin/telinit [ -t sec ] [ 0123456sSQqabcUu ]

Page 41: Man Des Commandes Linux

&�

DESCRIPTION Init Init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab (see inittab(5)). This file usually has entries which cause init to spawn gettys on each line that users can log in. It also controls autonomous processes required by any particular system.

RUNLEVELS A runlevel is a software configuration of the system which allows only a selected group of processes to exist. The processes spawned by init for each of these runlevels are defined in the /etc/inittab file. Init can be in one of eight runlevels: 0-6 and S or s. The runlevel is changed by having a privileged user run telinit, which sends appropriate signals to init, telling it which runlevel to change to.

Runlevels 0, 1, and 6 are reserved. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to get the system down into single user mode. Runlevel S is not really meant to be used directly, but more for the scripts that are executed when entering runlevel 1. For more information on this, see the manpages for shutdown(8) and inittab(5).

Runlevels 7-9 are also valid, though not really docu- mented. This is because "traditional" Unix variants don't use them. In case you're curious, runlevels S and s are in fact the same. Internally they are aliases for the same runlevel.

BOOTING After init is invoked as the last step of the kernel boot sequence, it looks for the file /etc/inittab to see if there is an entry of the type initdefault (see init- tab(5)). The initdefault entry determines the initial run- level of the system. If there is no such entry (or no /etc/inittab at all), a runlevel must be entered at the system console.

Runlevel S or s bring the system to single user mode and do not require an /etc/inittab file. In single user mode, a root shell is opened on /dev/console.

When entering single user mode, init reads the console's ioctl(2) states from /etc/ioctl.save. If this file does not exist, init initializes the line at 9600 baud and with CLOCAL settings. When init leaves single user mode, it stores the console's ioctl settings in this file so it can re-use them for the next single-user session.

When entering a multi-user mode for the first time, init performs the boot and bootwait entries to allow file sys- tems to be mounted before users can log in. Then all entries matching the runlevel are processed.

When starting a new process, init first checks whether the file /etc/initscript exists. If it does, it uses this script to start the process.

Each time a child terminates, init records the fact and the reason it died in /var/run/utmp and /var/log/wtmp,

&�

provided that these files exist.

CHANGING RUNLEVELS After it has spawned all of the processes specified, init waits for one of its descendant processes to die, a power- fail signal, or until it is signaled by telinit to change the system's runlevel. When one of the above three condi- tions occurs, it re-examines the /etc/inittab file. New 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 telinit Q or q command can wake up init to re-examine the /etc/inittab file.

If init is not in single user mode and receives a power- fail signal (SIGPWR), it reads the file /etc/powerstatus. It then starts a command based on the contents of this file:

F(AIL) Power is failing, UPS is providing the power. Exe- cute the powerwait and powerfail entries.

O(K) The power has been restored, execute the powerokwait entries.

L(OW) The power is failing and the UPS has a low battery. Execute the powerfailnow entries.

If /etc/powerstatus doesn't exist or contains anything else then the letters F, O or L, init will behave as if it has read the letter F.

Usage of SIGPWR and /etc/powerstatus is discouraged. Some- 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.

When init is requested to change the runlevel, it sends the warning signal SIGTERM to all processes that are unde- fined in the new runlevel. It then waits 5 seconds before forcibly terminating these processes via the SIGKILL sig- nal. Note that init assumes that all these processes (and their descendants) remain in the same process group which init originally created for them. If any process changes its process group affiliation it will not receive these signals. Such processes need to be terminated separately.

TELINIT /sbin/telinit is linked to /sbin/init. It takes a one- character argument and signals init to perform the appro- priate action. The following arguments serve as direc- tives to telinit:

0,1,2,3,4,5 or 6 tell init to switch to the specified run level.

a,b,c tell init to process only those /etc/inittab file entries having runlevel a,b or c.

Q or q tell init to re-examine the /etc/inittab file.

S or s tell init to switch to single user mode.

U or u tell init to re-execute itself (preserving the state). No re-examining of /etc/inittab file hap- pens. Run level should be one of Ss12345, otherwise request would be silently ignored.

Page 42: Man Des Commandes Linux

&�

telinit can also tell init how long it should wait between sending processes the SIGTERM and SIGKILL signals. The default is 5 seconds, but this can be changed with the -t sec option.

telinit can be invoked only by users with appropriate privileges.

The init binary checks if it is init or telinit by looking at its process id; the real init's process id is always 1. From this it follows that instead of calling telinit one can also just use init instead as a shortcut.

ENVIRONMENT Init sets the following environment variables for all its children:

PATH /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin

INIT_VERSION As the name says. Useful to determine if a script runs directly from init.

RUNLEVEL The current system runlevel.

PREVLEVEL The previous runlevel (useful after a runlevel switch).

CONSOLE The system console. This is really inherited from the kernel; however if it is not set init will set it to /dev/console by default.

BOOTFLAGS It is possible to pass a number of flags to init from the boot monitor (eg. LILO). Init accepts the following flags:

-s, S, single Single user mode boot. In this mode /etc/inittab is examined and the bootup rc scripts are usually run before the single user mode shell is started.

1-5 Runlevel to boot into.

-b, emergency Boot directly into a single user shell without run- ning any other startup scripts.

-a, auto The LILO boot loader adds the word "auto" to the com- mand line if it booted the kernel with the default command line (without user intervention). If this is found init sets the "AUTOBOOT" environment variable to "yes". Note that you cannot use this for any secu- rity measures - of course the user could specify "auto" or -a on the command line manually.

-z xxx The argument to -z is ignored. You can use this to expand the command line a bit, so that it takes some

&!

more space on the stack. Init can then manipulate the command line so that ps(1) shows the current run- level.

INTERFACE Init listens on a fifo in /dev, /dev/initctl, for mes- sages. Telinit uses this to communicate with init. The interface is not very well documented or finished. Those interested should study the initreq.h file in the src/ subdirectory of the init source code tar archive.

SIGNALS Init reacts to several signals:

SIGHUP Init looks for /etc/initrunlvl and /var/log/initrun- lvl. If one of these files exist and contain an ASCII runlevel, init switches to the new runlevel. This is for backwards compatibility only! . In the normal case (the files don't exist) init behaves like telinit q was executed.

SIGUSR1 On receipt of this signals, init closes and re-opens its control fifo, /dev/initctl. Useful for bootscripts when /dev is remounted.

SIGINT Normally the kernel sends this signal to init when CTRL-ALT-DEL is pressed. It activates the ctrlaltdel action.

SIGWINCH The kernel sends this signal when the KeyboardSignal key is hit. It activates the kbrequest action.

CONFORMING TO Init is compatible with the System V init. It works closely together with the scripts in the directories /etc/init.d and /etc/rc{runlevel}.d. If your system uses this convention, there should be a README file in the directory /etc/init.d explaining how these scripts work.

FILES /etc/inittab /etc/initscript /dev/console /etc/ioctl.save /var/run/utmp /var/log/wtmp /dev/initctl

WARNINGS Init assumes that processes and descendants of processes remain in the same process group which was originally cre- ated for them. If the processes change their group, init can't kill them and you may end up with two processes reading from one terminal line.

DIAGNOSTICS If init finds that it is continuously respawning an entry more than 10 times in 2 minutes, it will assume that there is an error in the command string, generate an error mes- sage on the system console, and refuse to respawn this

Page 43: Man Des Commandes Linux

&�

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- tab file or the program for the entry is removed.

AUTHOR Miquel van Smoorenburg ([email protected]), initial man- ual page by Michael Haardt ([email protected] 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 kill - Envoyer un signal à un processus.

SYNOPSIS kill [ -s signal | -p ] [ -a ] pid ... kill -l [ signal ]

DESCRIPTION kill envoie le signal indiqué aux processus mentionnés. Si on ne précise pas de signal, TERM est envoyé. Ce dernier tuera les processus qui ne l'interceptent pas.

Si l'on désire tuer des processus qui interceptent TERM, il peut être necessaire d'envoyer le signal KILL (9), qui ne peut pas être intercepté.

La plupart des shells modernes ont une commande kill intégrée.

OPTIONS pid ...

Indique la liste des PID auxquels kill doit envoyer un signal. Chaque pid peut être un Id de proces- sus, ou un nom de processus.

-s Indique le signal à envoyer. Celui-ci peut être spécifié par son nom ou par son numéro.

-p Indique que kill doit simplement fournir l'Id du processus dont le nom est fourni, sans lui envoyer de signal.

-l Affiche une liste des noms de signaux connus. Ceux- ci sont fournis dans /usr/include/linux/signal.h

VOIR AUSSI bash(1), tcsh(1), kill(2), sigvec(2)

AUTEUR Inspiré de BSD 4.4. La possibilité de traduire le nom du processus en PID a été ajoutée par Salvatore Valente <sva- [email protected]>.

&'

TRADUCTION Christophe Blaess, 1997.

Linux 8 Juin 1997 KILL(1)

��(���� ������� ����������������� ����(����

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...]

DESCRIPTION Last parcourt le fichier /var/log/wtmp (ou le fichier indiqué par l'option -f) pour présenter une liste de toutes les connexions et déconnexions des utilisateurs, depuis la création du fichier.

Des noms d'utilisateurs ou de terminaux peuvent être spécifiés, afin que last ne montre que les connex- ions/déconnexions correspondant à ces arguments. Le nom des terminaux peuvent être abrégés, ainsi last 0 est équivalent à last tty0.

Quand last reçoit un signal SIGINT (engendré par la touche d'interruption, généralement Controle-C) ou un signal SIGQUIT (déclenché par la touche Quit, généralement Cont- role-\), il indiquera le point où il est arrivé dans le fichier, et dans le cas de SIGINT, last se terminera.

Le pseudo-utilisateur reboot est enregistré à chaque redémarrage du système, ainsi last reboot affichera une liste de toutes les réinitialisations depuis la création du fichier de journalisation.

Lastb se comporte comme last, mais il utilise le fichier /var/log/btmp qui journalise toutes les tentatives infructueuses de connexion.

OPTIONS -num Cet argument indique à last le nombre de lignes

d'enregistrement à afficher.

-n num est équivalent à -num.

-R Cet argument empêche l'affichage du champ hostname.

-a Demande à last d'afficher le nom d'hôte en dernière colonne. Principalement utile en combinaison avec l'option suivante.

-d Pour les connexions non-locales, Linux journalise le nom d'hôte ainsi que son adresse IP. Avec cette

Page 44: Man Des Commandes Linux

&-

option, l'adresse IP est à nouveau reconvertie en nom d'hôte.

-x Afficher également les arrêts du système et les modifications de niveau d'exécution (run level).

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

AUTEUR Miquel van Smoorenburg, [email protected]

VOIR AUSSI shutdown(8), login(1), init(8).

TRADUCTION Christophe Blaess, 1997.

Linux 9 Juin 1997 LAST(1)

��(�����"� ���������(�����"�

NAME lastlog - examine lastlog file

SYNOPSIS lastlog [-u login-name] [-t days]

DESCRIPTION lastlog formats and prints the contents of the last login log, /var/log/lastlog. The login-name, port, and last 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 record for login-name only to be printed. Entering -t days will cause only the lastlogins more recent than days to be printed. The -t flag overrides the use of -u.

If the user has never logged in the message "**Never logged in**" will be displayed instead of the port and time.

FILES /var/log/lastlog - lastlog logging file

CAVEATS Large gaps in uid numbers will cause the lastlog program to run longer with no output to the screen (i.e. if mmdf=800 and last uid=170, program will appear to hang as it processes uid 171-799).

AUTHORS

&&

Julianne Frances Haugh ([email protected]) Phillip Street

LASTLOG(8)

�%((��� ���%((���

NAME less - opposite of more

SYNOPSIS less -? less --help less -V less --version less [-[+]aBcCdeEfgGiImMnNqQrsSuUVwX]

[-b bufs] [-h lines] [-j line] [-k keyfile] [-{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 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 (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.)

Commands are based on both more and vi. Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated.

COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v".

h or H Help: display a summary of these commands. If you forget all the other commands, remember this one.

SPACE or ^V or f or ^F Scroll forward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. Warn- ing: some systems use ^V as a special literaliza- tion character.

z Like SPACE, but if N is specified, it becomes the new window size.

ESC-SPACE

Page 45: Man Des Commandes Linux

&0

Like SPACE, but scrolls a full screenful, even if it reaches end-of-file in the process.

RETURN or ^N or e or ^E or j or ^J Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size.

d or ^D Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands.

b or ^B or ESC-v Scroll backward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed.

w Like ESC-v, but if N is specified, it becomes the new window size.

y or ^Y or ^P or k or ^K Scroll backward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character.

u or ^U Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands.

ESC-) or RIGHTARROW Scroll horizontally right N characters, default half the screen width (see the -# option). While the text is scrolled, it acts as though the -S option (chop lines) were in effect. Note that if you wish to enter a number N, you must use ESC-), not RIGHTARROW, because the arrow is taken to be a line editing command (see the LINE EDITING sec- tion).

ESC-( or LEFTARROW Scroll horizontally left N characters, default half the screen width (see the -# option).

r or ^R or ^L Repaint the screen.

R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed.

F Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.)

g or < or ESC-< Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.)

G or > or ESC-> Go to line N in the file, default the end of the file. (Warning: this may be slow if N is large, or

0*

if N is not specified and standard input, rather than a file, is being read.)

p or % Go to a position N percent into the file. N should be between 0 and 100.

{ If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line.

} If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line.

( Like {, but applies to parentheses rather than curly brackets.

) Like }, but applies to parentheses rather than curly brackets.

[ Like {, but applies to square brackets rather than curly brackets.

] Like }, but applies to square brackets rather than curly brackets.

ESC-^F Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively. For example, "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line.

ESC-^B Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively. For example, "ESC ^B < >" could be used to go backward to the < which matches the > in the bottom displayed line.

m Followed by any lowercase letter, marks the current position with that letter.

' (Single quote.) Followed by any lowercase letter, returns to the position which was previously marked with that letter. Followed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a ^ or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the ' command can be used to switch between input files.

^X^X Same as single quote.

/pattern Search forward in the file for the N-th line con- taining the pattern. N defaults to 1. The pattern is a regular expression, as recognized by ed. The search starts at the second line displayed (but see the -a and -j options, which change this).

Page 46: Man Des Commandes Linux

0�

Certain characters are special if entered at the beginning of the pattern; they modify the type of search rather than become part of the pattern:

^N or ! Search for lines which do NOT match the pattern.

^E or * Search multiple files. That is, if the search reaches the END of the current file without finding a match, the search contin- ues in the next file in the command line list.

^F or @ Begin the search at the first line of the FIRST file in the command line list, regard- less of what is currently displayed on the screen or the settings of the -a or -j options.

^K Highlight any text which matches the pattern on the current screen, but don't move to the first match (KEEP current position).

^R Don't interpret regular expression metachar- acters; that is, do a simple textual compar- ison.

?pattern Search backward in the file for the N-th line con- taining the pattern. The search starts at the line immediately before the top line displayed.

Certain characters are special as in the / command:

^N or ! Search for lines which do NOT match the pat- tern.

^E or * Search multiple files. That is, if the search reaches the beginning of the current file without finding a match, the search continues in the previous file in the com- mand line list.

^F or @ Begin the search at the last line of the last file in the command line list, regard- less of what is currently displayed on the screen or the settings of the -a or -j options.

^K As in forward searches.

^R As in forward searches.

ESC-/pattern Same as "/*".

ESC-?pattern Same as "?*".

n Repeat previous search, for N-th line containing

0�

the last pattern. If the previous search was modi- fied by ^N, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by ^E, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by ^R, the search is done without using regular expressions. There is no effect if the previous search was modified by ^F or ^K.

N Repeat previous search, but in the reverse direc- tion.

ESC-n Repeat previous search, but crossing file bound- aries. The effect is as if the previous search were modified by *.

ESC-N Repeat previous search, but in the reverse direc- tion and crossing file boundaries.

ESC-u Undo search highlighting. Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the -G option; in that case search commands do not turn highlighting back on.)

:e [filename] Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the pre- viously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Simi- larly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the -" option).

^X^V or E Same as :e. Warning: some systems use ^V as a spe- cial literalization character. On such systems, you may not be able to use ^V.

:n Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined.

:p Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined.

:x Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined.

Page 47: Man Des Commandes Linux

0�

:d Remove the current file from the list of files.

= or ^G or :f 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 possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line.

- Followed by one of the command line option letters (see OPTIONS below), this will change the setting of that option and print a message describing the new setting. If a ^P (CONTROL-P) is entered imme- diately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as -b or -h), or a string value (such as -P or -t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and nothing is changed.

-- Like the - command, but takes a long option name (see OPTIONS below) rather than a single option letter. You must press RETURN after typing the option name. A ^P immediately after the second dash suppresses printing of a message describing the new setting, as in the - command.

-+ Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "-+X" command does the same thing as "-+X" on the command line.) This does not work for string- valued options.

--+ Like the -+ command, but takes a long option name rather than a single option letter.

-! Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options.

--! Like the -! command, but takes a long option name rather than a single option letter.

_ (Underscore.) Followed by one of the command line option letters, this will print a message describ- ing the current setting of that option. The set- ting of the option is not changed.

__ (Double underscore.) Like the _ (underscore) com- mand, but takes a long option name rather than a single option letter. You must press RETURN after typing the option name.

+cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes less to initially display each file starting at the end rather than the beginning.

V Prints the version number of less being run.

q or Q or :q or :Q or ZZ Exits less.

0!

The following four commands may or may not be valid, depending on your particular installation.

v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below.

! shell-command Invokes a shell to run the shell-command given. A percent sign (%) in the command is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. "!!" repeats the last shell command. "!" with no shell command simply invokes a shell. On Unix systems, the shell is taken from the environ- ment variable SHELL, or defaults to "sh". On MS- DOS and OS/2 systems, the shell is the normal com- mand processor.

| <m> shell-command <m> represents any mark letter. Pipes a section of the input file to the given shell command. The section of the file to be piped is between the first line on the current screen and the position marked by the letter. <m> may also be ^ or $ to indicate beginning or end of file respectively. If <m> is . or newline, the current screen is piped.

s filename Save the input to a file. This only works if the input is a pipe, not an ordinary file.

OPTIONS Command line options are described below. Most options may be changed while less is running, via the "-" command.

Most options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. A long option name may be abbrevi- ated as long as the abbreviation is unambiguous. For example, --quit-at-eof may be abbreviated --quit, but not --qui, since both --quit-at-eof and --quiet begin with --qui. Some long option names are in uppercase, such as --QUIT-AT-EOF, as distinct from --quit-at-eof. Such option names need only have their first letter capital- ized; the remainder of the name may be in either case. For example, --Quit-at-eof is equivalent to --QUIT-AT-EOF.

Options are also taken from the environment variable "LESS". For example, to avoid typing "less -options ..." each time less is invoked, you might tell csh:

setenv LESS "-options"

or if you use sh:

LESS="-options"; export LESS

On MS-DOS, you don't need the quotes, but you should replace any percent signs in the options string by double percent signs.

Page 48: Man Des Commandes Linux

0�

The environment variable is parsed before the command line, so command line options override the LESS environment variable. If an option appears in the LESS variable, it can be reset to its default value on the com- mand line by beginning the command line option with "-+".

For options like -P or -D which take a following string, a dollar sign ($) must be used to signal the end of the string. For example, to set two -D options on MS-DOS, you must have a dollar sign between them, like this:

LESS="-Dn9.1$-Ds4.1"

-? or --help This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the ques- tion mark, it may be necessary to quote the ques- tion mark, thus: "-\?".)

-a or --search-skip-screen Causes searches to start after the last line dis- played on the screen, thus skipping all lines dis- played on the screen. By default, searches start at the second line on the screen (or after the last found line; see the -j option).

-bn or --buffers=n Specifies the number of buffers less will use for each file. Buffers are 1K, and by default 10 buffers are used for each file (except if the file is a pipe; see the -B option). The number n speci- fies a different number of buffers to use.

-B or --auto-buffers By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The -B option disables this automatic allocation of buffers for pipes, so that only the number of buffers specified by the -b option are used. Warn- ing: use of -B can result in erroneous display, since only the most recently viewed part of the file is kept in memory; any earlier data is lost.

-c or --clear-screen Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen.

-C or --CLEAR-SCREEN The -C option is like -c, but the screen is cleared before it is repainted.

-d or --dumb The -d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The -d option does not otherwise change the behavior of less on a dumb terminal).

-Dxcolor or --color=xcolor

0'

[MS-DOS only] Sets the color of the text displayed. x is a single character which selects the type of text whose color is being set: n=normal, s=stand- out, d=bold, u=underlined, k=blink. color is a pair of numbers separated by a period. The first number selects the foreground color and the second selects the background color of the text. A single number N is the same as N.0.

-e or --quit-at-eof Causes less to automatically exit the second time it reaches end-of-file. By default, the only way to exit less is via the "q" command.

-E or --QUIT-AT-EOF Causes less to automatically exit the first time it reaches end-of-file.

-f or --force Forces non-regular files to be opened. (A non-reg- ular file is a directory or a device special file.) Also suppresses the warning message when a binary file is opened. By default, less will refuse to open non-regular files.

-F or --quit-if-one-screen Causes less to automatically exit if the entire file can be displayed on the first screen.

-g or --hilite-search Normally, less will highlight ALL strings which match the last search command. The -g option changes this behavior to highlight only the partic- ular string which was found by the last search com- mand. This can cause less to run somewhat faster than the default.

-G or --HILITE-SEARCH The -G option suppresses all highlighting of strings found by search commands.

-hn or ---max-back-scroll=n Specifies a maximum number of lines to scroll back- ward. If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.)

-i or --ignore-case Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any uppercase letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case.

-I or --IGNORE-CASE Like -i, but searches ignore case even if the pat- tern contains uppercase letters.

-jn or --jump-target=n Specifies a line on the screen where the "target" line is to be positioned. A target line is the object of a text search, tag search, jump to a line number, jump to a file percentage, or jump to a marked position. The screen line is specified by a number: the top line on the screen is 1, the next

Page 49: Man Des Commandes Linux

0-

is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is -1, the second to the bottom is -2, and so on. If the -j option is used, searches begin at the line immedi- ately after the target line. For example, if "-j4" is used, the target line is the fourth line on the screen, so searches begin at the fifth line on the screen.

-J or --status-column Displays a status column at the left edge of the screen. The status column is used only if the -w or -W option is in effect.

-kfilename or --lesskey-file=filename Causes less to open and interpret the named file as a lesskey (1) file. Multiple -k options may be specified. If the LESSKEY or LESSKEY_SYSTEM envi- ronment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file.

-m or --long-prompt Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon.

-M or --LONG-PROMPT Causes less to prompt even more verbosely than more.

-n or --line-numbers Suppresses line numbers. The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the -n option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below).

-N or --LINE-NUMBERS Causes a line number to be displayed at the begin- ning of each line in the display.

-ofilename or --log-file=filename Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, less will ask for confirmation before overwriting it.

-Ofilename or --LOG-FILE=filename The -O option is like -o, but it will overwrite an existing file without asking for confirmation.

If no log file has been specified, the -o and -O options can be used from within less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying -o from within less.

-ppattern or --pattern=pattern The -p option on the command line is equivalent to specifying +/pattern; that is, it tells less to

0&

start at the first occurrence of pattern in the file.

-Pprompt or --prompt=prompt Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS environment variable, rather than being typed in with each less command. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. -Ps followed by a string changes the default (short) prompt to that string. -Pm changes the medium (-m) prompt. -PM changes the long (-M) prompt. -Ph changes the prompt for the help screen. -P= changes the message printed by the = command. All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details.

-q or --quiet or --silent Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases.

-Q or --QUIET or --SILENT Causes totally "quiet" operation: the terminal bell is never rung.

-r or --raw-control-chars Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place.

-R or --RAW-CONTROL-CHARS Like -r, but tries to keep track of the screen appearance where possible. This works only if the input consists of normal text and possibly some ANSI "color" escape sequences, which are sequences of the form:

ESC [ ... m

where the "..." is zero or more characters other than "m". For the purpose of keeping track of screen appearance, all control characters and all ANSI color escape sequences are assumed to not move the cursor. You can make less think that charac- ters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence.

-s or --squeeze-blank-lines Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing

Page 50: Man Des Commandes Linux

00

nroff output.

-S or --chop-long-lines Causes lines longer than the screen width to be chopped rather than folded. That is, the remainder of a long line is simply discarded. The default is to fold long lines; that is, display the remainder on the next line.

-ttag or --tag=tag The -t option, followed immediately by a TAG, will edit the file containing that tag. For this to work, there must be a file called "tags" in the current directory, which was previously built by the ctags (1) command. This option may also be specified from within less (using the - command) as a way of examining a new file. The command ":t" is equivalent to specifying -t from within less.

-Ttagsfile or --tag-file=tagsfile Specifies a tags file to be used instead of "tags".

-u or --underline-special Causes backspaces and carriage returns to be treated as printable characters; that is, they are sent to the terminal when they appear in the input.

-U or --UNDERLINE-SPECIAL Causes backspaces, tabs and carriage returns to be treated as control characters; that is, they are handled as specified by the -r option.

By default, if neither -u nor -U is given, backspaces which appear adjacent to an underscore character are treated specially: the underlined text is displayed using the terminal's hardware underlining capability. Also, backspaces which appear between two identical characters are treated specially: the overstruck text is printed using the terminal's hardware boldface capability. Other backspaces are deleted, along with the preceding character. Carriage returns immediately followed by a newline are deleted. other carriage returns are handled as specified by the -r option. Text which is overstruck or underlined can be searched for if neither -u nor -U is in effect.

-V or --version Displays the version number of less.

-w or --hilite-unread Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line immediately following the line previously at the bottom of the screen. Also high- lights the target line after a g or p command. The highlight is removed at the next command which causes movement. The entire line is highlighted, unless the -J option is in effect, in which case only the status column is highlighted.

-W or --HILITE-UNREAD Like -w, but temporarily highlights the first new line after any forward movement command larger than one line.

-xn or --tabs=n

�**

Sets tab stops every n positions. The default for n is 8.

-X or --no-init Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.

-yn or --max-forw-scroll=n Specifies a maximum number of lines to scroll for- ward. If it is necessary to scroll forward more than n lines, the screen is repainted instead. The -c or -C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling.

-[z]n or --window=n Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with more. If the number n is negative, it indi- cates n lines less than the current screen size. For example, if the screen is 24 lines, -z-4 sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automati- cally changes to 36 lines.

-"cc or --quotes=cc Changes the filename quoting character. This may be necessary if you are trying to name a file which contains both spaces and quote characters. Fol- lowed by a single character, this changes the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by double quotes. Followed by two characters, changes the open quote to the first character, and the close quote to the second char- acter. Filenames containing a space should then be preceded by the open quote character and followed by the close quote character. Note that even after the quote characters are changed, this option remains -" (a dash followed by a double quote).

-~ or --tilde Normally lines after end of file are displayed as a single tilde (~). This option causes lines after end of file to be displayed as blank lines.

-# or --shift Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW com- mands. If the number specified is zero, it sets the default number of positions to one half of the screen width.

-- A command line argument of "--" marks the end of option arguments. Any arguments following this are interpreted as filenames. This can be useful when viewing a file whose name begins with a "-" or "+".

+ If a command line option begins with +, the remainder of that option is taken to be an initial command to less. For example, +G tells less to start at the end of the file rather than the begin-

Page 51: Man Des Commandes Linux

�*�

ning, and +/xyz tells it to start at the first occurrence of "xyz" in the file. As a special case, +<number> acts like +<number>g; that is, it starts the display at the specified line number (however, see the caveat under the "g" command above). If the option starts with ++, the initial command applies to every file being viewed, not just the first one. The + command described previ- ously may also be used to set (or change) an ini- tial command for every file.

LINE EDITING When entering command line at the bottom of the screen (for example, a filename for the :e command, or the pat- tern for a search command), certain keys can be used to manipulate the command line. Most commands have an alter- nate form in [ brackets ] which can be used if a key does not exist on a particular keyboard. (The bracketed forms do not work in the MS-DOS version.) Any of these special keys may be entered literally by preceding it with the "literal" character, either ^V or ^A. A backslash itself may also be entered literally by entering two backslashes.

LEFTARROW [ ESC-h ] Move the cursor one space to the left.

RIGHTARROW [ ESC-l ] Move the cursor one space to the right.

^LEFTARROW [ ESC-b or ESC-LEFTARROW ] (That is, CONTROL and LEFTARROW simultaneously.) Move the cursor one word to the left.

^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] (That is, CONTROL and RIGHTARROW simultaneously.) Move the cursor one word to the right.

HOME [ ESC-0 ] Move the cursor to the beginning of the line.

END [ ESC-$ ] Move the cursor to the end of the line.

BACKSPACE Delete the character to the left of the cursor, or cancel the command if the command line is empty.

DELETE or [ ESC-x ] Delete the character under the cursor.

^BACKSPACE [ ESC-BACKSPACE ] (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor.

^DELETE [ ESC-X or ESC-DELETE ] (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor.

UPARROW [ ESC-k ] Retrieve the previous command line.

DOWNARROW [ ESC-j ] Retrieve the next command line.

TAB Complete the partial filename to the left of the cursor. If it matches more than one filename, the

�*�

first match is entered into the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a direc- tory, a "/" is appended to the filename. (On MS- DOS systems, a "\" is appended.) The environment variable LESSSEPARATOR can be used to specify a different character to append to a directory name.

BACKTAB [ ESC-TAB ] Like, TAB, but cycles in the reverse direction thru the matching filenames.

^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit).

^U (Unix) or ESC (MS-DOS) Delete the entire command line, or cancel the com- mand if the command line is empty. If you have changed your line-kill character in Unix to some- thing other than ^U, that character is used instead of ^U.

KEY BINDINGS You may define your own less commands by using the program lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. You may also use lesskey to change the line-editing keys (see LINE EDITING), and to set environment variables. If the environment variable LESSKEY is set, less uses that as the name of the lesskey file. Otherwise, less looks in a standard place for the lesskey file: On Unix systems, less looks for a lesskey file called "$HOME/.less". On MS-DOS and Windows systems, less looks for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified in the PATH environment variable. On OS/2 sys- tems, less looks for a lesskey file called "$HOME/less.ini", and if it is not found, then looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks for a lesskey file called "less.ini" in any directory specified in the PATH environment variable. See the lesskey manual page for more details.

A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide file, key bindings in the local file take precedence over those in the system-wide file. If the environment variable LESSKEY_SYSTEM is set, less uses that as the name of the system-wide lesskey file. Otherwise, less looks in a standard place for the system-wide lesskey file: On Unix systems, the system-wide lesskey file is /usr/local/bin/.sysless. (However, if less was built with a different binary directory than /usr/local/bin, that directory is where the .sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\_sysless. On OS/2 systems, the system- wide lesskey file is c:\sysless.ini.

INPUT PREPROCESSOR You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are

Page 52: Man Des Commandes Linux

�*�

displayed. An input preprocessor is simply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The contents of the replacement file are then displayed in place of the contents of the original file. However, it will appear to the user as if the original file is opened; that is, less will display the original filename as the name of the current file.

An input preprocessor receives one command line argument, the original filename, as entered by the user. It should create the replacement file, and when finished, print the name of the replacement file to its standard output. If the input preprocessor does not output a replacement file- name, less uses the original file, as normal. The input preprocessor is not called when viewing standard input. To set up an input preprocessor, set the LESSOPEN environ- ment variable to a command line which will invoke your input preprocessor. This command line should include one occurrence of the string "%s", which will be replaced by the filename when the input preprocessor command is invoked.

When less closes a file opened in such a way, it will call another program, called the input postprocessor, which may perform any desired clean-up action (such as deleting the 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 file. To set up an input postprocessor, set the LESSCLOSE environment variable to a command line which will invoke your input postprocessor. It may include two occurrences of the string "%s"; the first is replaced with the origi- nal name of the file and the second with the name of the replacement file, which was output by LESSOPEN.

For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let less view them directly:

lessopen.sh: #! /bin/sh case "$1" in *.Z) uncompress -c $1 >/tmp/less.$$ 2>/dev/null

if [ -s /tmp/less.$$ ]; then echo /tmp/less.$$ else rm -f /tmp/less.$$ fi ;;

esac

lessclose.sh: #! /bin/sh rm $2

To use these scripts, put them both where they can be exe- cuted and set LESSOPEN="lessopen.sh %s", and LESS- CLOSE="lessclose.sh %s %s". More complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on.

It is also possible to set up an input preprocessor to pipe the file data directly to less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before starting to view it. An input preprocessor that works this way is called an input

�*!

pipe. An input pipe, instead of writing the name of a replacement file on its standard output, writes the entire contents of the replacement file on its standard output. If the input pipe does not write any characters on its standard output, then there is no replacement file and less uses the original file, as normal. To use an input pipe, make the first character in the LESSOPEN environment variable a vertical bar (|) to signify that the input pre- processor is an input pipe.

For example, on many Unix systems, this script will work like the previous example scripts:

lesspipe.sh: #! /bin/sh case "$1" in *.Z) uncompress -c $1 2>/dev/null

;; esac

To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-".

NATIONAL CHARACTER SETS There are three types of characters in the input file:

normal characters can be displayed directly to the screen.

control characters should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab).

binary characters should not be displayed directly and are not expected to be found in text files.

A "character set" is simply a description of which charac- ters are to be considered normal, control, and binary. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are:

ascii BS, TAB, NL, CR, and formfeed are control charac- ters, all chars with values between 32 and 126 are normal, and all others are binary.

iso8859 Selects an ISO 8859 character set. This is the same as ASCII, except characters between 160 and 255 are treated as normal characters.

latin1 Same as iso8859.

dos Selects a character set appropriate for MS-DOS.

ebcdic Selects an EBCDIC character set.

koi8-r Selects a Russian character set.

next Selects a character set appropriate for NeXT com- puters.

Page 53: Man Des Commandes Linux

�*�

utf-8 Selects the UTF-8 encoding of the ISO 10646 charac- ter set.

If the LESSCHARSET environment variable is not set, the default character set is latin1. However, if the string "UTF-8" is found in the LC_ALL, LC_CTYPE or LANG environ- ment variables, then the default character set is utf-8 instead.

In special cases, it may be desired to tailor less to use a character set other than the ones definable by LESS- CHARSET. In this case, the environment variable LESS- CHARDEF can be used to define a character set. It should be set to a string where each character in the string rep- resents one character in the character set. The character "." is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repeti- tion. For example, "bccc4b." would mean character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal. All characters after the last are taken to be the same as the last, so characters 9 through 255 would be normal. (This is an example, and does not neces- sarily represent any real character set.)

This table shows the value of LESSCHARDEF which is equiva- lent to each of the possible values for LESSCHARSET:

ascii 8bcccbcc18b95.b dos 8bcccbcc12bc5b95.b. ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b

9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. iso8859 8bcccbcc18b95.33b. koi8-r 8bcccbcc18b95.b128. latin1 8bcccbcc18b95.33b. next 8bcccbcc18b95.bb125.bb

If neither LESSCHARSET nor LESSCHARDEF is set, but your system supports the setlocale interface, less will use setlocale to determine the character set. setlocale is controlled by setting the LANG or LC_CTYPE environment variables.

Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible (e.g. ^A for control-A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the character is displayed as a hex number in angle brackets. This format can be changed by setting the LESSBINFMT environment vari- able. LESSBINFMT may begin with a "*" and one character to select the display attribute: "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, and "*n" is normal. If LESSBINFMT does not begin with a "*", normal attribute is assumed. The remainder of LESSBINFMT is a string which may include one printf-style escape sequence (a % followed by x, X, o, d, etc.). For example, if LESS- BINFMT is "*u[%x]", binary characters are displayed in underlined hexadecimal surrounded by brackets. The default if no LESSBINFMT is specified is "*s<%X>".

PROMPTS The -P option allows you to tailor the prompt to your preference. The string given to the -P option replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt mechanism is

�*'

rather complicated to provide flexibility, but the ordi- nary user need not understand the details of constructing personalized prompt strings.

A percent sign followed by a single character is expanded according to what the following character is:

%bX Replaced by the byte offset into the current input file. The b is followed by a single character (shown as X above) which specifies the line whose byte offset is to be used. If the character is a "t", the byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bottom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line, as specified by the -j option.

%B Replaced by the size of the current input file.

%c Replaced by the column number of the text appearing in the first column of the screen.

%dX Replaced by the page number of a line in the input file. The line to be used is determined by the X, as with the %b option.

%D Replaced by the number of pages in the input file, or equivalently, the page number of the last line in the input file.

%E Replaced by the name of the editor (from the VISUAL environment variable, or the EDITOR environment variable if VISUAL is not defined). See the dis- cussion of the LESSEDIT feature below.

%f Replaced by the name of the current input file.

%i Replaced by the index of the current file in the list of input files.

%lX Replaced by the line number of a line in the input file. The line to be used is determined by the X, as with the %b option.

%L Replaced by the line number of the last line in the input file.

%m Replaced by the total number of input files.

%pX Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the X as with the %b option.

%PX Replaced by the percent into the current input file, based on line numbers. The line used is determined by the X as with the %b option.

%s Same as %B.

%t Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear any- where.

%x Replaced by the name of the next input file in the list.

If any item is unknown (for example, the file size if

Page 54: Man Des Commandes Linux

�*-

input is a pipe), a question mark is printed instead.

The format of the prompt string can be changed depending on certain conditions. A question mark followed by a sin- gle character acts like an "IF": depending on the follow- ing character, a condition is evaluated. If the condition is true, any characters following the question mark and condition character, up to a period, are included in the prompt. If the condition is false, such characters are not included. A colon appearing between the question mark and the period can be used to establish an "ELSE": any characters between the colon and the period are included in the string if and only if the IF condition is false. Condition characters (which follow a question mark) may be:

?a True if any characters have been included in the prompt so far.

?bX True if the byte offset of the specified line is known.

?B True if the size of current input file is known.

?c True if the text is horizontally shifted (%c is not zero).

?dX True if the page number of the specified line is known.

?e True if at end-of-file.

?f True if there is an input filename (that is, if input is not a pipe).

?lX True if the line number of the specified line is known.

?L True if the line number of the last line in the file is known.

?m True if there is more than one input file.

?n True if this is the first prompt in a new input file.

?pX True if the percent into the current input file, based on byte offsets, of the specified line is known.

?PX True if the percent into the current input file, based on line numbers, of the specified line is known.

?s Same as "?B".

?x True if there is a next input file (that is, if the current input file is not the last one).

Any characters other than the special ones (question mark, colon, period, percent, and backslash) become literally part of the prompt. Any of the special characters may be included in the prompt literally by preceding it with a backslash.

Some examples:

�*&

?f%f:Standard input.

This prompt prints the filename, if known; otherwise the string "Standard input".

?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...

This prompt would print the filename, if known. The file- name is followed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. Notice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash.

?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t

This prints the filename if this is the first prompt in a 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, the string "(END)" is printed followed by the name of the next file, if there is one. Finally, any trailing spaces are truncated. This is the default prompt. For refer- ence, here are the defaults for the other two prompts (-m and -M respectively). Each is broken into two lines here for readability only.

?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.: ?pB%pB\%:byte %bB?s/%s...%t

?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. : byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t

And here is the default message produced by the = command:

?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. . byte %bB?s/%s. ?e(END) :?pB%pB\%..%t

The prompt expansion features are also used for another purpose: if an environment variable LESSEDIT is defined, it is used as the command to be executed when the v com- mand is invoked. The LESSEDIT string is expanded in the same way as the prompt strings. The default value for LESSEDIT is:

%E ?lm+%lm. %f

Note that this expands to the editor name, followed by a + and the line number, followed by the file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT vari- able can be changed to modify this default.

SECURITY When the environment variable LESSSECURE is set to 1, less runs in a "secure" mode. This means these features are disabled:

! the shell command

| the pipe command

:e the examine command.

v the editing command

s -o log files

Page 55: Man Des Commandes Linux

�*0

-k use of lesskey files

-t use of tags files

metacharacters in filenames, such as *

filename completion (TAB, ^L)

Less can also be compiled to be permanently in "secure" mode.

ENVIRONMENT VARIABLES Environment variables may be specified either in the sys- tem environment as usual, or in a lesskey (1) file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence over variables defined in the system-wide lesskey file.

COLUMNS Sets the number of columns on the screen. Takes precedence over the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.)

EDITOR The name of the editor (used for the v command).

HOME Name of the user's home directory (used to find a lesskey file on Unix systems).

HOMEDRIVE, HOMEPATH Concatenation of the HOMEDRIVE and HOMEPATH envi- ronment variables is the name of the user's home directory if the HOME variable is not set (only in the Windows version).

INIT Name of the user's init directory (used to find a lesskey file on OS/2 systems).

LANG Language for determining the character set.

LC_CTYPE Language for determining the character set.

LESS Options which are passed to less automatically.

LESSANSIENDCHARS Characters which are assumed to end an ANSI color escape sequence (default "m").

LESSBINFMT Format for displaying non-printable, non-control characters.

LESSCHARDEF Defines a character set.

LESSCHARSET Selects a predefined character set.

LESSCLOSE

��*

Command line to invoke the (optional) input-post- processor.

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

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

LESSKEY Name of the default lesskey(1) file.

LESSKEY_SYSTEM Name of the default system-wide lesskey(1) file.

LESSMETACHARS List of characters which are considered "metachar- acters" by the shell.

LESSMETAESCAPE Prefix which less will add before each metacharac- ter in a command sent to the shell. If LESS- METAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell.

LESSOPEN Command line to invoke the (optional) input-prepro- cessor.

LESSSECURE Runs less in "secure" mode. See discussion under SECURITY.

LESSSEPARATOR String to be appended to a directory name in file- name completion.

LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.)

PATH User's search path (used to find a lesskey file on MS-DOS and OS/2 systems).

SHELL The shell used to execute the ! command, as well as to expand filenames.

TERM The type of terminal on which less is being run.

VISUAL The name of the editor (used for the v command).

SEE ALSO lesskey(1)

WARNINGS The = command and prompts (unless changed by -P) report the line numbers of the lines at the top and bottom of the

Page 56: Man Des Commandes Linux

���

screen, but the byte and percent of the line after the one at the bottom of the screen.

If the :e command is used to name more than one file, and one of the named files has been viewed previously, the new files may be entered into the list in an unexpected order.

On certain older terminals (the so-called "magic cookie" terminals), search highlighting will cause an erroneous display. On such terminals, search highlighting is dis- abled by default to avoid possible problems.

In certain cases, when search highlighting is enabled and a search pattern begins with a ^, more text than the matching string may be highlighted. (This problem does not occur when less is compiled to use the POSIX regular expression package.)

On some systems, setlocale claims that ASCII characters 0 thru 31 are control characters rather than binary charac- ters. This causes less to treat some binary files as ordinary, non-binary files. To workaround this problem, set the environment variable LESSCHARSET to "ascii" (or whatever character set is appropriate).

See http://www.flash.net/~marknu/less for the latest list of known bugs in this version of less.

COPYRIGHT Copyright (C) 2000 Mark Nudelman

less is part of the GNU project and is free software. You can redistribute it and/or modify it under the terms of either (1) the GNU General Public License as published by the Free Software Foundation; or (2) the Less License. See the file README in the less distribution for more details regarding redistribution. You should have received a copy of the GNU General Public License along with the source for less; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also have received a copy of the Less License; see the file LICENSE.

less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied war- ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. See the GNU General Public License for more details.

AUTHOR Mark Nudelman <[email protected]> Send bug reports or comments to the above address or to [email protected].

Version 358: 08 Jul 2000 LESS(1)

�����"� ������ ����� &������������� �������"�

���

NOM lilo - Installer le chargeur lilo.

SYNOPSIS Fonction principale :

/sbin/lilo - Installer le chargeur lilo

Autres utilisations :

/sbin/lilo -q - Obtenir la carte des noyaux gérés./sbin/lilo -R - Positionner les attributs par défaut pour

le prochain boot./sbin/lilo -I - Rechercher le chemin d'accès au noyau en

cours d'utilisation./sbin/lilo {-u|-U} - Désinstaller Lilo.

DESCRIPTION lilo installe le chargeur Lilo, qui sera activé au prochain démarrage de la machine. Il dispose de nombreuses options.

-v Augmente la quantité de commentaires. Ajouter un ou plusieurs -v rendra Lilo de plus en plus volubile.

-q Affiche la carte des noyaux actuellement gérés, et qui sont proposés lors du démarrage de la machine. lilo gère une carte, située par défaut dans le fichier /boot/map, contenant les noms et les posi- tions des divers noyaux à proposer lors du démar- rage. Cette option liste les noms des systèmes proposés lors du boot.

-m map-file Utiliser le fichier map-file pour stocker la carte plutôt que celui par défaut.

-C config-file lilo lit les instructions à propos des systèmes à gérer dans un fichier de configuration, par défaut /etc/lilo.conf. Cette option permet d'indiquer un autre fichier de configuration.

-d délai Si vous avez indiqué plusieurs noyaux, en pressant SHIFT durant le démarrage de la machine, Lilo vous 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 configurer le délai désiré (en dixièmes de secon- des).

-D étiquette Utilise le noyau associé à étiquette plutôt que le premier de la liste, en tant que système par défaut.

-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

Page 57: Man Des Commandes Linux

���

de boot ou le fichier carte. A utiliser avec -v pour s'assurer de ce que lilo va faire.

-c Autoriser la compression de la carte. Ceci va per- mettre de grouper les requêtes de lecture sur des secteurs adjacents. Cette option accélère le démarrage (surtout sur disquette).

-f disk-tab Indique un fichier décrivant les paramètres géométriques du disque. Le fichier par défaut est /etc/disktab.

-i boot-sector Indique un fichier à installer en tant que nouveau secteur de boot. Le fichier par défaut est /boot/boot.b.

-l Utilise un adressage linéaire des secteurs, plutôt qu'un adressage secteur/tête/cylindre.

-P {fix|ignore} Corrige (fix) ou ignore les tables de partitions endommagées, c'est à dire les tables dont les adresses linéaires et secteur/tête/cylindre ne cor- respondent pas.

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

-u device-name Désinstallation de lilo, en recopiant le fichier de sauvegarde sur le secteur de boot. Un horodatage du fichier est vérifié.

-U device-name Idem, sans vérification de l'horodatage

-R command line Cette option indique les commandes par défaut lors du prochain redémarrage du systeme. Ensuite Lilo effacera ces commandes, elles ne sont utilisées qu'une seule fois. Ceci est typiquement utilisé dans les scripts de redémarrage, juste avant d'appeler `shutdown -r'.

-I label L'étiquette associée au noyau en cours d'utilisa- tion est stockée après le démarrage dans la vari- able d'environnement BOOT_IMAGE. Cette commande affichera l'étiquette sur stdout.

-V Afficher le numéro de version.

Les lignes de commandes ci-dessus correspondent aux mots

��!

clés du fichier de configuration ainsi :

-b bootdev boot=bootdev -c compact -d dsec delay=dsec -D label default=label -i bootsector install=bootsector -f file disktab=file -l linear -m mapfile map=mapfile -P fix fix-table -P ignore ignore-table -s file backup=file -S file force-backup=file -v verbose=level

VOIR AUSSI lilo.conf(5). La distribution de Lilo contient une documentation très complète.

AUTEUR Werner Almesberger ([email protected]).

TRADUCTION Christophe Blaess, 1997.

Lilo 17 Octobre 1996 LILO(8)

� ��� ������� ����������������� ����� ���

NOM ln - Créer des liens entre fichiers.

SYNOPSIS ln [options] source [dest] ln [options] source... repertoire

Options POSIX : [-f]

Options GNU (forme abrégée): [-bdfinsvF] [-S suffixe] [-V {numbered,existing,simple}] [--help] [--version] [--]

DESCRIPTION Sous Unix, il existe deux types de `liens' entre fichiers, que l'on nomme généralement liens matériels (ou physiques) et liens symboliques (ou logiques).

Un lien matériel est simplement une manière de nommer un fichier. Un fichier peut avoir plusieurs noms. Un fichier n'est effacé réellement que lorsque son dernier nom est supprimé. Le nombre de noms d'un fichier est indiqué par la commande ls(1). Il n'y a pas de notion de nom `origi- nal' : Tous les noms d'un fichier ont exactement la même importance. Tous les noms d'un fichier se trouvent généralement - mais ce n'est pas obligatoire - dans le système de fichiers contenant les données du fichier.

Un lien symbolique est d'un tout autre genre. Il s'agit

Page 58: Man Des Commandes Linux

���

d'un petit fichier spécial, qui contient un chemin d'accés. Ainsi un lien symbolique peut pointer vers un système de fichier différent de celui qui l'accueille. Il peut également pointer, grâce à NFS, vers un système de fichiers appartenant à une autre machine. Enfin, un lien symbolique ne pointe pas nécéssairement vers un fichier existant. Lorsque l'on accède à un lien symbolique (avec les appels systèmes open(2) ou stat(2)), le nom du lien symbolique est remplacé, par le noyau Unix, par une référence au fichier vers lequel le lien pointe. Toute- fois, avec les appels rm(1) et unlink(2) le lien lui-même est supprimé, et non pas le fichier visé. Il existe des appels systèmes spéciaux lstat(2) et readlink(2) qui ren- voient le status du lien symbolique, et le nom du fichier vers lequel il pointe. Pour de nombreux autres appels- systèmes, il existe une frange d'incertitudes et de varia- tions entre les différents systèmes pour savoir si la fonction s'applique au lien symbolique lui-même, ou au fichier cible.

ln crée des liens entre fichiers. Par défaut il s'agit de liens matériels. Si l'on utilise l'option -s, les liens seront symboliques (logiques).

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 ce lien sera le même que celui du fichier visé (il s'agit là d'une extension GNU). Sinon, si le dernier argument indique un répertoire existant, ln créera des liens sur chacun des fichiers source indiqués dans ce répertoire. Les noms seront égaux à ceux des fichiers source visés. (Consultez toutefois l'options --no-dereference plus bas). Si l'on indique seulement deux noms de fichiers, un lien sera créé avec le nom dest pointant vers le fichier source. Il est interdit d'indiquer plus de deux arguments si le dernier nom n'est pas un répertoire.

Par défaut, ln ne supprime pas les fichiers ni les liens symboliques existants. (Ainsi on peut l'utiliser à des fins de verrouillage, il échouera si dest existe déja). On peut toutefois forcer l'écrasement avec l'option -f.

Avec les implémentations existant actuellement, seul le Super-User peut créer un lien matériel sur un répertoire, et encore, c'est souvent totalement impossible. POSIX interdit aux appels-systèmes link(2) et à l'utilitaire ln de créer des liens physique sur un répertoire (mais n'interdit pas les liens matériels entre différents systèmes de fichiers).

OPTIONS POSIX -f Forcer l'écrasement du fichier destination s'il

existe.

OPTIONS GNU -d, -F, --directory

Autoriser le Super-User à créer un lien physique sur un répertoire.

-f, --force Forcer l'écrasement du fichier destination s'il existe.

-i, --interactive Demander confirmation avant de supprimer les fichiers destination.

��'

-n, --no-dereference Lorsque l'on fournit une destination explicite qui se trouve être un répertoire, la considèrer comme un fichier normal. Lorsque la destination est un répertoire réel (et non pas un lien symbolique sur un répertoire), il n'y a pas d'ambiguïté. Le lien est créé dans ce répertoire. Mais lorsque la destination est un lien symbolique vers un répertoire, il y a deux possi- bilités pour traiter la demande. ln peut con- sidérer la destination comme un répertoire normal, et créer le lien dans celui-ci. D'un autre côté, la destination peut également être considérée comme le lien symbolique lui-même à créer. Dans ce cas, ln doit détruire, ou archiver, le lien existant avant de créer le nouveau lien. Le comportement par défaut est de considérer la destination comme un répertoire à part entière.

-s, --symbolic Créer des liens symboliques à la place des liens physiques. Cette option produit souvent des mes- sages d'erreurs sur les systèmes qui ne supportent pas les liens symboliques.

-v, --verbose Afficher le nom de chaque fichier avant de le lier.

OPTIONS DE SAUVEGARDE GNU Les versions GNU des programmes comme cp, mv, ln, install et patch créeront au besoin une copie de sauvegarde des fichiers à écraser, à modifier ou à détruire. On demande une copie de sauvegarde à l'aide de l'option -b, on indique la nomenclature à adopter avec l'option -V, et si la sauvegarde se fait avec un suffixe, celui-ci est précisé avec l'option -S.

-b, --backup Créer une copie de sauvegarde des fichiers à écraser ou à détruire.

-S SUFFIXE, --suffix=SUFFIXE Ajouter le SUFFIXE indiqué à chaque fichier de sauvegarde créé. Si cette option n'est pas indiquée, on utilisera la valeur de la variable d'environnement SIMPLE_BACKUP_SUFFIX. Si la vari- able SIMPLE_BACKUP_SUFFIX n'existe pas, la valeur par défaut est `~'.

-V METHODE, --version-control=METHODE Préciser la nomenclature des fichiers de sauvegarde La METHODE indiquée peut être `numbered' (`t'), `existing' (`nil'), ou `never' (`simple'). Si cette option n'est pas indiquée, la valeur de la variable d'environnement VERSION_CONTROL est utilisée, et si la variable VERSION_CONTROL n'existe pas, la valeur par défaut est `existing'.

Cette option correspond à la variable `version-con- trol' sous Emacs. Les METHODES valides (les abbréviations non-ambigües sont acceptées) sont :

t, numbered Toujours faire une sauvegarde numérotée.

nil, existing Faire une sauvegarde numérotée des fichiers

Page 59: Man Des Commandes Linux

��-

en ayant déjà une précédente, et une sauveg- arde simple pour les autres.

never, simple Faire toujours une sauvegarde simple.

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

et terminer correctement.

--version Afficher un numéro de version sur la sortie stan- dard, et terminer correctement.

-- Fin de la liste d'options.

ENVIRONNEMENT Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont leurs significations habituelles.

CONFORMITÉ POSIX 1003.2. Toutefois, POSIX 1003.2 (1996) ne parle pas des liens symboliques. Ceux-ci ont été introduits par BSD, et n'existent pas dans System V release 3 et antérieurs.

VOIR AUSSI ls(1), rm(1), link(2), lstat(2), open(2), readlink(2), stat(2), unlink(2)

NOTES Cette page décrit la version de ln se trouvant dans le package fileutils-3.16. D'autres versions peuvent diffèrer légèrement. Envoyez les corrections concernant cette page de manuel (en anglais) à [email protected], [email protected], et [email protected], et (en francais) à [email protected]. Signalez les bugs dans le programme à [email protected].

TRADUCTION Christophe Blaess, 1998.

GNU 24 Novembre 1998 LN(1)

(�����%��� �������(�����%���

NAME slocate - Security Enhanced version of the GNU Locate

SYNOPSIS slocate [-qi] [-d <path>] [--database=<path>] <search string>

slocate [-i] [-r <regexp>] [--regexp=<regexp>]

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

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

��&

slocate [-Vh] [--version] [--help]

DESCRIPTION Secure Locate provides a secure way to index and

quickly search for files on your system. It uses incremen- tal encoding just like GNU locate to compress its database to make searching faster, but it will also store file per- missions and ownership so that users will not see files they do not have access to.

This manual page documents the GNU version of slocate. slocate Enables system users to search entire filesystems without displaying unauthorized files.

OPTIONS -u Create slocate database starting at path /.

-U <dir> Create slocate database starting at path <dir>.

-e <dir1,dir2,...> Exclude directories from the slocate database.

-f <fstype1,...> Exclude files on specific file systems from the slocate database.

-c Parse '/etc/updatedb.conf' when updating the slo- cate database.

-l <level> Security level. 0 turns security checks off. This will make searchs faster. 1 turns security checks on. This is the default.

-i Does a case insensitive search.

-q Quiet mode. Error messages are suppressed.

-n <num> Limit the amount of results shown to <num>.

-r <regexp> --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.

-h --help Display this help.

-v --verbose Verbose mode. Display files when creating database.

-V --version Display version.

VERSION Secure Locate v2.6

Page 60: Man Des Commandes Linux

��0

AUTHOR Kevin Lindsay - Copyright (c) 1999, 2000

BUG REPORT Report any bugs to [email protected]

FTP ftp://ftp.geekreview.org/slocate/ ftp://ftp.mkintraweb.com/pub/linux/slocate/

WEB http://www.geekreview.org/slocate/

SLOCATE(1)

�(���� ������� ����������������� ����(����

NOM ls, dir, vdir - Afficher le contenu d'un répertoire.

SYNOPSIS ls [options] [fichier...]

Options POSIX : [-1acdilqrtuCFR]

Options GNU (forme courte) : [-1abcdfgiklmnopqrstuxABCD- FGLNQRSUX] [-w cols] [-T cols] [-I motif] [--full-time] [--format={long,verbose,commas,across,vertical,single-col- umn}] [--sort={none,time,size,extension}] [--time={atime,access,use,ctime,status}] [--color[={none,auto,always}]] [--help] [--version] [--]

DESCRIPTION La commande ls affiche tout d'abord l'ensemble de ses arguments fichiers autres que des répertoires. Puis ls affiche l'ensemble des fichiers contenus dans chaque répertoire indiqué. dir et vdir sont des versions de ls affichant par défaut leurs résultats avec d'autres for- mats.

Si aucun argument (autre qu'une option) n'est fourni, le contenu du répertoire en cours (`.') est affiché. Le con- tenu des répertoires est trié par ordre alphabétique. Avec l'option -d, les répertoires sont considérés comme des fichiers ordinaires, on affiche leurs noms mais pas leurs contenus.

Un fichier dont le nom commence par un point (`.') n'est affiché que si l'option -a est fournie.

Avec ls, les fichiers sont présentés par défaut en colonne et triés verticalement si la sortie standard est un termi- nal, sinon ils sont affichés avec un seul fichier par ligne.

Avec dir, les fichiers sont par défaut listés en colonne et triés verticalement.

��*

Avec vdir, les fichiers sont par défaut présentés suivant un format long.

OPTIONS POSIX -1 Présenter un fichier par ligne.

-a Afficher tous les fichiers des répertoires, y com- pris les fichiers commençant par un `.'.

-c Trier le contenu des répertoires en fonction des dates de changement des statuts de fichiers, plutôt qu'en fonction de la date de modification. S'il s'agit d'un format long, afficher la date de changement de statut plutôt que la date de modifi- cation du fichier.

-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 octets, et l'horodatage (de la dernière modifica- tion, sauf si une autre date est réclamée par les options -c ou -u). Pour les fichiers vieux de plus de 6 mois, ou en avance sur la date de plus d'une heure, l'horodatage contient l'année à la place de l'heure. Les types de fichiers sont indiqués par les caractères suivants : - pour les fichiers ordi- naires, d pour un répertoire (directory), b pour un fichier spécial en mode bloc, c pour un fichier spécial en mode caractère, l pour un lien symbol- ique, p pour une fifo (named pipe), s pour une socket. -q Afficher des points d'interrogation à la place des caractères non-imprimables dans les noms de fichiers.

-r Inverser le tri du contenu des répertoires.

-t Trier le contenu des répertoires en fonction de la date et non pas en ordre alphabétique. Les fichiers les plus récents sont présentés en premier.

-u Trier le contenu des répertoires en fonction de la date de dernier accès au fichier plutôt que selon la date de modification. Si le format d'affichage est large, c'est la date de dernier accès qui est affichée.

-C Présenter les fichiers en colonnes, triés verti- calement.

-F Ajouter un caractère à chaque nom de fichier pour indiquer son type. les fichiers réguliers exécuta- bles sont suivis d'un `*'. Les répertoires sont suivis de `/', les liens symboliques d'un `@', les FIFOs d'un `|'. Les fichiers réguliers non- exécutables ne sont suivis d'aucun caractère.

-R Afficher récursivement le contenu des sous-réper- toires.

Page 61: Man Des Commandes Linux

���

OPTIONS GNU -1, --format=single-column

Présenter un fichier par ligne.

-a, --all Afficher tous les fichiers des répertoires, y com- pris les fichiers commençant par un `.'.

-b, --escape Présenter les caractères non-affichables des noms de fichiers en utilisant des séquences alphabétiques ou octales commençant par un back- slash `\' comme en C.

-c, --time=ctime, --time=status Trier le contenu des répertoires en fonction des dates de changement des statuts de fichiers, plutôt qu'en fonction de la date de modification. S'il s'agit d'un format long, afficher la date de changement de statut plutôt que la date de modifi- cation du fichier.

-d, --directory Afficher les répertoires avec la même présentation que les fichiers, sans lister leur contenu.

-f Ne pas trier le contenu des répertoires, l'afficher dans l'ordre où il se présente sur le disque. L'effet est équivalent aux options -a et -U sans les options -l, -s, ni -t.

--full-time Afficher les dates et heures complètes, sans les abréger.

-g Option sans effet, conservée pour assurer la com- patibilité avec Unix.

-i, --inode Afficher le numéro d'index (i-noeud) de chaque fichier à gauche de son nom.

-k, --kilobytes Si la taille des fichiers est affichée, la mesurer en kilo-octets. Ceci a priorité sur la variable d'environnement POSIXLY_CORRECT.

-l, --format=long, --format=verbose 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 octets, et l'horodatage (de la dernière modifica- tion, sauf si une autre date est réclamée). Pour les fichiers vieux de plus de 6 mois, ou en avance sur la date de plus d'une heure, l'horodatage con- tient l'année à la place de l'heure.

Pour chaque répertoire indiqué, les fichiers sont précédés d'une ligne `total nb_blocs', ou nb_blocs est l'espace disque utilisé par l'ensemble des fichiers du répertoire. Par défaut on utilise des blocs de 1024 octets. Si la variable d'environ- nement POSIXLY_CORRECT est configurée, on utilise des blocs de 512 octets (sauf si l'option -k est fournie). Le calcul de nb_blocs se fait en comptant séparement chaque lien physique. On peut trouver cela dommage.

���

Les autorisations d'accès listées sont similaires aux spécifications de modes, mais ls regroupe plusieurs bits dans le troisième caractère de chaque jeu de permissions.

s si le bit setuid ou setgid et le bit d'exécution correspondant sont tous deux valides.

S si le bit setuid ou setgid est actif mais le bit d'exécution correspondant n'est pas con- figuré.

t Si les bits `Sticky' et `Exécution pas les autres' sont actifs.

T Si le bit `Sticky' est actif mais pas le bit `Exécution par les autres'.

x Si le bit d'éxécution est actif mais aucun de ceux cités ci-dessus.

- Sinon.

-m, --format=commas Afficher sur chaque ligne autant de fichiers que possible, séparés par des virgules.

-n, --numeric-uid-gid Afficher les UID et GID numériques plutôt que les noms.

-o Produire un listing de répertoire sous forme longue mais sans les informations de groupe. C'est équiva- lent à --format=long --no-group. Cette option sert à assurer la compatibilité avec d'autres versions de ls.

-p Ajouter un caractère à chaque nom de fichier pour indiquer son type.

-q, --hide-control-chars Afficher des points d'interrogation à la place des caractères non-imprimables dans les noms de fichiers.

-r, --reverse Inverser le tri du contenu des répertoires.

-s, --size Afficher la taille de chaque fichier, mesurée en bloc de 1 Ko, à gauche du nom. Si la variable d'environnement POSIXLY_CORRECT est configurée, la taille est mesurée en blocs de 512 octets.

-t, --sort=time Trier le contenu des répertoires en fonction de la date et non pas en ordre alphabétique. Les fichiers les plus récents sont présentés en premier.

-u, --time=atime, --time=access, --time=use Trier le contenu des répertoires en fonction de la date de dernier accès au fichier plutôt que selon la date de modification. Si le format d'affichage est large, c'est la date de dernier accès qui est affichée.

Page 62: Man Des Commandes Linux

���

-w, --width cols Supposer que l'écran dispose de cols colonnes en largeur. La valeur par défaut est réclamée si pos- sible au gestionnaire de terminal. Sinon la vari- able d'environnement COLUMNS est utilisée si elle est positionnée. Sinon, la valeur par défaut est 80.

-x, --format=across, --format=horizontal Présenter les fichiers en colonnes, triés horizon- talement.

-A, --almost-all Afficher tous les fichiers du répertoire sauf `.' et `..'.

-B, --ignore-backups Ne pas afficher les fichiers se terminant par `~', à moins qu'ils ne soient mentionnés sur la ligne de commande.

-C, --format=vertical Présenter les fichiers en colonnes, triés verti- calement.

-D, --dired Avec le format long -l, imprimer une ligne supplémentaire après les données principales: //DIRED// DEBUT_1 FIN_1 DEBUT_2 FIN_2 ... Les valeurs DEBUT_n et FIN_n sont des entiers non- signés qui enregistrent la position en octets de chaque noms de fichier dans la sortie. Ceci permet à Emacs de trouver facilement les noms de fichiers, même ceux qui contiennent des caractères inhab- ituels comme espace ou retour-chariot. Si les répertoires sont listés de manière récursive -R, une ligne similaire est affichée après chaque sous- répertoires : //SUBDIRED// DEBUT_1 FIN_1 ...

-F, --classify Ajouter un caractère à chaque nom de fichier pour indiquer son type. les fichiers réguliers exécuta- bles sont suivis d'un `*'. Les répertoires sont suivis de `/', les liens symboliques d'un `@', les FIFOs d'un `|'. Les fichiers réguliers non- exécutables ne sont suivis d'aucun caractère.

-G, --no-group Ne pas afficher les informations de groupe dans le format large.

-I, --ignore motif Ne pas afficher les fichiers dont le nom correspond au motif (suivant l'interprétation du shell), à moins qu'ils ne soient explicitement mentionnés sur la ligne de commande. Comme avec le shell, les noms de fichiers commençant par un point `.' ne sont pas supposés correspondre avec un motif com- mençant par un caractère générique.

-L, --dereference Afficher les informations concernant les fichiers pointés par les liens symboliques et non pas celles concernant les liens eux-mêmes.

��!

-N, --literal Afficher les noms de fichiers sans modification.

-Q, --quote-name Encadrer les noms de fichiers avec des guillemets, et citer les caractères non-imprimables par des séquences semblables à celles utilisées en C.

-R, --recursive Afficher récursivement le contenu des sous-réper- toires.

-S, --sort=size Trier les répertoires en fonction de la taille de fichier et non pas en ordre alphabétique. Les fichiers les plus gros sont affichés en premier.

-T, --tabsize cols Supposer que les tabulations sont espacées de cols colonnes. La valeur par défaut est 8, mais elles peut être modifiée par la variable d'environnement TABSIZE lorsque la variable POSIXLY_CORRECT n'est pas validée. ls utilise des tabulations pour accélérer l'affichage, mais si cols vaut zéro, aucune tabulation ne sera employée.

-U, --sort=none Ne pas trier le contenu des répertoires. Les présenter dans l'ordre des fichiers sur le disque. Cette option n'est pas groupée avec -f car le ls d'Unix possède une option -f incluant également -a et supprimant -l, -s, et -t. Il semble inutile et horrible de regrouper toutes ces fonctionnalités sans lien entre elles en une seule option.

-X, --sort=extension Trier le contenu des répertoires en fonction de l'extension du nom de fichier (les caractères après le dernier `.'). Les fichiers sans extension sont affichés en premier.

--color[=manière] Spécifie comment utiliser les couleurs pour dis- tinguer les types de fichiers. Les couleurs sont définie en utilisant la variable d'environnement LS_COLORS. Pour avoir des précisions sur la con- figuration de cette variable, voir dircolors(1). La manière, si elle est indiquée, peut prendre l'une des valeurs suivantes :

none Ne pas utiliser de couleurs. C'est le com- portement par défaut.

auto N'utiliser de couleurs que si la sortie standard est un terminal.

always Toujours utiliser des couleurs. Indiquer seulement --color sans indiquer de manière est équivalent à --color=always.

--full-time Afficher les temps de manière complète, sans utiliser les heuristiques habituelles d'abrévia- tion. Le format est celui par défaut de date(1). On ne peut pas le modifier, mais on peut au besoin l'extraire avec cut(1) et de passer le résultat à `date -d'.

Page 63: Man Des Commandes Linux

���

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 Makefile qui ne régénère pas correctement les fichiers.

OPTIONS STANDARDS GNU --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.

-- Terminer la liste des options.

ENVIRONNEMENT La variable d'environnement POSIXLY_CORRECT détermine le choix des unités. Si elle n'est pas configurée, alors la variable TABSIZE détermine le nombre de caractères par saut de tabulation. La variable COLUMNS (lorsqu'elle con- tient un entier décimal) déterminer le nombre de colonnes pour la largeur de sortie (option -C). Les variables LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES et LC_TIME ont leurs significations habituelles. La variable TZ indique le fuseau horaire pour les chaînes de caractères représentant des horodatages. La variable LS_COLORS est utilisée pour préciser les couleurs utilisées.

BOGUES Sur les systèmes BSD, l'option -s affiche des tailles cor- respondant à la moitié de la taille réelle pour les fichiers situés sur un système HP-UX monté par NFS. Sur les systèmes HP-UX, les tailles sont doublées pour les fichiers monté par NFS depuis un système BSD. Ceci est dû à un défaut d'HP-UX, qui affecte également la version HP- UX de la commande ls.

CONFORMITÉ POSIX 1003.2

VOIR AUSSI dircolors(1)

NOTES Cette page documente la version de ls du paquetage fileu- tils-3.16. D'autres versions peuvent diverger légèrement.

TRADUCTION Christophe Blaess, 1997.

FSF 02 Janvier 2000 LS(1L)

��'

������� (/���&���������*&&� ������

NAME mail - send and receive mail

SYNOPSIS mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr... mail [-iInNv] -f [name] mail [-iInNv] [-u user]

INTRODUCTION Mail is an intelligent mail processing system, which has a command syntax reminiscent of ed(1) with lines replaced by messages.

-v Verbose mode. The details of delivery are displayed on the user's terminal.

-i Ignore tty interrupt signals. This is particularly useful when using mail on noisy phone lines.

-I Forces mail to run in interactive mode even when input isn't a ter- minal. In particular, the `~' special character when sending mail is only active in interactive mode.

-n Inhibits reading /etc/mail.rc upon startup.

-N Inhibits the initial display of message headers when reading mail or editing a mail folder.

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

-c Send carbon copies to list of users.

-b Send blind carbon copies to list. List should be a comma-separated list of names.

-f Read in the contents of your mbox (or the specified file) for pro- cessing; when you quit, mail writes undeleted messages back to this file.

-u Is equivalent to:

mail -f /var/spool/mail/user

Sending mail 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 the beginning of a line. The section below Replying to or originating mail, describes some features of mail available to help you compose your letter.

Reading mail In normal usage mail is given no arguments and checks your mail out of 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 the commands `+' and `-' moving backwards and forwards, and simple num- bers.

Disposing of mail.

Page 64: Man Des Commandes Linux

��-

After examining a message you can delete `d') the message or reply `r') to it. Deletion causes the mail program to forget about the message. 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- mand. Deleted messages will, however, usually disappear never to be seen again.

Specifying messages Commands such as print and delete can be given a list of message numbers 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 through 5. The special name `*' addresses all messages, and `$' 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 lines of all messages.

Replying to or originating mail. 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 end-of-file, defines the contents of the message. While you are compos- ing a message, mail treats lines beginning with the character `~' spe- 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 indentprefix variable, below). Other escapes will set up subject fields, add and delete recipients to the message and allow you to escape to an editor to revise the message or to a shell to run some commands. (These options are given in the summary below.)

Ending a mail processing session. 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 which case they are discarded. Unexamined messages go back to the post office. (See the -f option above).

Personal and systemwide distribution lists. It is also possible to create a personal distribution lists so that, for instance, you can send mail to ``cohorts'' and have it go to a group of people. Such lists can be defined by placing a line like

alias cohorts bill ozalp jkf mark kridle@ucbcory

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 distribution lists can be created by editing /etc/aliases, see aliases(5) 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 will be able to reply to the recipients. System wide aliases are not expanded when the mail is sent, but any reply returned to the machine will have the system wide alias expanded as all mail goes through sendmail.

Network mail (ARPA, UUCP, Berknet) See mailaddr(7) for a description of network addresses.

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 options are summarized below.)

SUMMARY (Adapted from the `Mail Reference Manual')

Each command is typed on a line by itself, and may take arguments follow- ing the command word. The command need not be typed in its entirety - the first command which matches the typed prefix is used. For commands which take message lists as arguments, if no message list is given, then the next message forward which satisfies the command's requirements is used. If there are no messages forward of the current message, the

��&

search proceeds backwards, and if there are no good messages at all, mail types ``applicable messages'' and aborts the command.

- Print out the preceding message. If given a numeric argument n, goes to the n'th previous message and prints it.

? Prints a brief summary of commands.

! Executes the shell (see sh(1) and csh(1)) command which follows.

Print (P) Like print but also prints out ignored header fields. See also print, ignore and retain.

Reply (R) Reply to originator. Does not reply to other recipients of the original message.

Type (T) Identical to the Print command.

alias (a) With no arguments, prints out all currently-defined aliases. With one argument, prints out that alias. With more than one argument, creates a new alias or changes an old one.

alternates (alt) The alternates command is useful if you have accounts on several machines. It can be used to inform mail that the listed addresses are really you. When you reply to messages, mail will 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 argument, the current set of alternate names is displayed.

chdir (c) Changes the user's working directory to that specified, if given. If no directory is given, then changes to the user's login directory.

copy (co) The copy command does the same thing that save does, except that it does not mark the messages it is used on for deletion when you quit.

delete (d) Takes a list of messages as argument and marks them all as deleted. Deleted messages will not be saved in mbox, nor will they be available for most other commands.

dp (also dt) Deletes the current message and prints the next mes- sage. If there is no next message, mail says ``at EOF''.

edit (e) Takes a list of messages and points the text editor at each one in turn. On return from the editor, the message is read back in.

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 in -f.

file (fi) The same as folder.

folders List the names of the folders in your folder directory.

folder (fo) The folder command switches to a new mail file or folder. With no arguments, it tells you which file you are currently reading. If you give it an argument, it will write out changes (such as deletions) you have made in the current file and read in the new file. Some special conventions are recognized for the name. # means the previous file, % means your system mailbox, %user means user's system mailbox, & means your mbox file, and +folder means a file in your folder directory.

Page 65: Man Des Commandes Linux

��0

from (f) Takes a list of messages and prints their message headers.

headers (h) Lists the current range of headers, which is an 18-message group. If a `+' argument is given, then the next 18-message group is printed, and if a `-' argument is given, the previous 18-message group is printed.

help A synonym for ?

hold (ho, also preserve) Takes a message list and marks each message therein to be saved in the user's system mailbox instead of in mbox. Does not override the delete command.

ignore Add the list of header fields named to the ignored list. Header fields in the ignore list are not printed on your terminal when you print a message. This command is very handy for suppression of certain machine-generated header fields. The Type and Print commands can be used to print a message in its entirety, includ- ing ignored fields. If ignore is executed with no arguments, it lists the current set of ignored fields.

mail (m) Takes as argument login names and distribution group names and sends mail to those people.

mbox Indicate that a list of messages be sent to mbox in your home directory when you quit. This is the default action for messages if you do not have the hold option set.

next (n) like + or CR) Goes to the next message in sequence and types it. With an argument list, types the next matching message.

preserve (pre) A synonym for hold.

print (p) Takes a message list and types out each message on the user's terminal.

quit (q) Terminates the session, saving all undeleted, unsaved mes- sages in the user's mbox file in his login directory, preserving all messages marked with hold or preserve or never referenced in his system mailbox, and removing all other messages from his sys- tem mailbox. If new mail has arrived during the session, the message ``You have new mail'' is given. If given while editing a mailbox file with the -f flag, then the edit file is rewritten. 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- mand.

reply (r) Takes a message list and sends mail to the sender and all recipients of the specified message. The default message must not be deleted.

respond A synonym for reply.

retain Add the list of header fields named to the retained list Only the header fields in the retain list are shown on your terminal when you print a message. All other header fields are suppressed. 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 current set of retained fields.

save (s) Takes a message list and a filename and appends each message in turn to the end of the file. The filename in quotes, followed by the line count and character count is echoed on the user's terminal.

��*

set (se) With no arguments, prints all variable values. Otherwise, sets option. Arguments are of the form option=value (no space before or after =) or option. Quotation marks may be placed around any part of the assignment statement to quote blanks or tabs, i.e. ``set indentprefix="->"''

saveignore Saveignore is to save what ignore is to print and type. Header fields thus marked are filtered out when saving a message by save or when automatically saving to mbox.

saveretain Saveretain is to save what retain is to print and type. Header fields thus marked are the only ones saved with a message when saving by save or when automatically saving to mbox. Saveretain overrides saveignore.

shell (sh) Invokes an interactive version of the shell.

size Takes a message list and prints out the size in characters of each message.

source The source command reads commands from a file.

top Takes a message list and prints the top few lines of each. The number of lines printed is controlled by the variable toplines and defaults to five.

type (t) A synonym for print.

unalias Takes a list of names defined by alias commands and discards the remembered groups of users. The group names no longer have any significance.

undelete (u) Takes a message list and marks each message as not being deleted.

unread (U) Takes a message list and marks each message as not having been read.

unset Takes a list of option names and discards their remembered val- ues; the inverse of set.

visual (v) Takes a message list and invokes the display editor on each message.

write (w) Similar to save, except that only the message body (without) the header) is saved. Extremely useful for such tasks as sending and receiving source program text over the message system.

xit (x) A synonym for exit.

z Mail presents message headers in windowfuls as described under the headers command. You can move mail's attention forward to the next window with the z command. Also, you can move to the previous window by using z-.

Tilde/Escapes

Here is a summary of the tilde escapes, which are used when composing messages to perform special functions. Tilde escapes are only recognized at the beginning of lines. The name ``tilde escape'' is somewhat of a misnomer since the actual escape character can be set by the option escape.

Page 66: Man Des Commandes Linux

���

~!command Execute the indicated shell command, then return to the message.

~bname ... 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).

~cname ... Add the given names to the list of carbon copy recipients.

~d Read the file ``dead.letter'' from your home directory into the message.

~e Invoke the text editor on the message collected so far. After the editing session is finished, you may continue appending text to the message.

~fmessages Read the named messages into the message being sent. If no mes- sages are specified, read in the current message. Message head- ers currently being ignored (by the ignore or retain command) are not included.

~Fmessages Identical to ~f, except all message headers are included.

~h Edit the message header fields by typing each one in turn and allowing the user to append text to the end or modify the field by using the current terminal erase and kill characters.

~mmessages Read the named messages into the message being sent, indented by a tab or by the value of indentprefix. If no messages are speci- fied, read the current message. Message headers currently being ignored (by the ignore or retain command) are not included.

~Mmessages Identical to ~m, except all message headers are included.

~p Print out the message collected so far, prefaced by the message header fields.

~q Abort the message being sent, copying the message to ``dead.letter'' in your home directory if save is set.

~rfilename Read the named file into the message.

~sstring Cause the named string to become the current subject field.

~tname ... Add the given names to the direct recipient list.

~v Invoke an alternate editor (defined by the VISUAL option) on the message collected so far. Usually, the alternate editor will be a screen editor. After you quit the editor, you may resume appending text to the end of your message.

~wfilename Write the message onto the named file.

~|command Pipe the message through the command as a filter. If the command gives no output or terminates abnormally, retain the original text of the message. The command fmt(1) is often used as command

���

to rejustify the message.

~:mail-command Execute the given mail command. Not all commands, however, are allowed.

~~string Insert the string of text in the message prefaced by a single ~. If you have changed the escape character, then you should double that character in order to send it.

Mail Options 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 or not; or string, in which case the actual value is of interest. The binary options include the following:

append Causes messages saved in mbox to be appended to the end rather than prepended. This should always be set (perhaps in /etc/mail.rc).

ask, asksub Causes mail to prompt you for the subject of each message you send. If you respond with simply a newline, no subject field will be sent.

askcc Causes you to be prompted for additional carbon copy recipients at the end of each message. Responding with a newline indicates your satisfaction with the current list.

askbcc Causes you to be prompted for additional blind carbon copy recip- ients at the end of each message. Responding with a newline indicates your satisfaction with the current list.

autoprint Causes the delete command to behave like dp - thus, after delet- ing a message, the next one will be typed automatically.

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- tion useful for debugging mail.

dot The binary option dot causes mail to interpret a period alone on a line as the terminator of a message you are sending.

hold This option is used to hold messages in the system mailbox by default.

ignore Causes interrupt signals from your terminal to be ignored and echoed as @'s.

ignoreeof An option related to dot is ignoreeof which makes mail refuse to accept a control-d as the end of a message. Ignoreeof also applies to mail command mode.

metoo Usually, when a group is expanded that contains the sender, the sender is removed from the expansion. Setting this option causes the sender to be included in the group.

noheader Setting the option noheader is the same as giving the -N flag on the command line.

nosave Normally, when you abort a message with two RUBOUT (erase or delete) mail copies the partial letter to the file ``dead.letter'' in your home directory. Setting the binary

Page 67: Man Des Commandes Linux

���

option nosave prevents this.

Replyall Reverses the sense of reply and Reply commands.

quiet Suppresses the printing of the version when first invoked.

searchheaders If this option is set, then a message-list specifier in the form ``/x:y'' will expand to all messages containing the substring ``y'' in the header field ``x''. The string search is case insensitive.

verbose Setting the option verbose is the same as using the -v flag on the command line. When mail runs in verbose mode, the actual delivery of messages is displayed on the user's terminal.

Option String Values

EDITOR Pathname of the text editor to use in the edit command and ~e escape. If not defined, then a default editor is used.

LISTER Pathname of the directory lister to use in the folders com- mand. Default is /bin/ls.

PAGER Pathname of the program to use in the more command or when crt variable is set. The default paginator more(1) is used 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.

crt The valued option crt is used as a threshold to determine how long a message must be before PAGER is used to read it. If crt is set without a value, then the height of the ter- minal screen stored in the system is used to compute the threshold (see stty(1)).

escape If defined, the first character of this option gives the character to use in the place of ~ to denote escapes.

folder The name of the directory to use for storing folders of messages. If this name begins with a `/', mail considers it to be an absolute pathname; otherwise, the folder direc- tory is found relative to your home directory.

MBOX The name of the mbox file. It can be the name of a folder. The default is ``mbox'' in the user's home directory.

record If defined, gives the pathname of the file used to record all outgoing mail. If not defined, then outgoing mail is not so saved.

indentprefix String used by the ``~m'' tilde escape for indenting mes- sages, in place of the normal tab character (^I). Be sure to quote the value if it contains spaces or tabs.

toplines If defined, gives the number of lines of a message to be printed out with the top command; normally, the first five lines are printed.

ENVIRONMENT

��!

Mail utilizes the HOME, USER, SHELL, DEAD, PAGER, LISTER, EDITOR, VISUAL and MBOX environment variables.

FILES /var/spool/mail/* Post office. ~/mbox User's old mail. ~/.mailrc File giving initial mail commands. Only used if the

owner of the file is the user running this copy of mail.

/tmp/R* Temporary files. /usr/lib/mail.*help Help files. /etc/mail.rc System initialization file.

SEE ALSO fmt(1), newaliases(1), vacation(1), aliases(5), mailaddr(7), sendmail(8) and

The Mail Reference Manual..

HISTORY A mail command appeared in Version 6 AT&T UNIX. This man page is derived from The Mail Reference Manual originally written by Kurt Shoens.

BUGS There are some flags that are not documented here. Most are not useful to the general user.

4th Berkeley Distribution December 30, 1993 4th Berkeley Distribution

&���� ���&����

NAME man - format and display the on-line manual pages manpath - determine user's search path for man pages

SYNOPSIS man [-acdfFhkKtwW] [--path] [-m system] [-p string] [-C config_file] [-M pathlist] [-P pager] [-S section_list] [section] name ...

DESCRIPTION man formats and displays the on-line manual pages. If you specify section, man only looks in that section of the manual. name is normally the name of the manual page, which is typically the name of a command, function, or file. However, if name contains a slash (/) then man interprets it as a file specification, so that you can do man ./foo.5 or even man /cd/foo/bar.1.gz.

See below for a description of where man looks for the manual page files.

OPTIONS -C config_file

Specify the configuration file to use; the default is /usr//etc/man.config. (See man.conf(5).)

-M path Specify the list of directories to search for man pages. Separate the directories with colons. An

Page 68: Man Des Commandes Linux

���

empty list is the same as not specifying -M at all. See SEARCH PATH FOR MANUAL PAGES.

-P pager Specify which pager to use. This option overrides the MANPAGER environment variable, which in turn overrides the PAGER variable. By default, man uses /usr/bin/less -isr.

-S section_list List is a colon separated list of manual sections to search. This option overrides the MANSECT envi- ronment variable.

-a By default, man will exit after displaying the first manual page it finds. Using this option forces man to display all the manual pages that match name, not just the first.

-c Reformat the source man page, even when an up-to- date cat page exists. This can be meaningful if the cat page was formatted for a screen with a dif- ferent number of columns, or if the preformatted page is corrupted.

-d Don't actually display the man pages, but do print gobs of debugging information.

-D Both display and print debugging info.

-f Equivalent to whatis.

-F or --preformat Format only - do not display.

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

-k Equivalent to apropos.

-K Search for the specified string in *all* man pages. Warning: this is probably very slow! It helps to specify a section. (Just to give a rough idea, on my machine this takes about a minute per 500 man pages.)

-m system Specify an alternate set of man pages to search based on the system name given.

-p string Specify the sequence of preprocessors to run before nroff or troff. Not all installations will have a full set of preprocessors. Some of the preproces- sors and the letters used to designate them are: eqn (e), grap (g), pic (p), tbl (t), vgrind (v), refer (r). This option overrides the MANROFFSEQ environment variable.

-t Use /usr/bin/groff -Tps -mandoc to format the man- ual page, passing the output to stdout. The output from /usr/bin/groff -Tps -mandoc may need to be passed through some filter or another before being printed.

-w or --path Don't actually display the man pages, but do print the location(s) of the files that would be format-

��'

ted or displayed. If no argument is given: display (on stdout) the list of directories that is searched by man for man pages. If manpath is a link to man, then "manpath" is equivalent to "man --path".

-W Like -w, but print file names one per line, without additional information. This is useful in shell commands like man -aW man | xargs ls -l

CAT PAGES Man will try to save the formatted man pages, in order to save formatting time the next time these pages are needed. Traditionally, formatted versions of pages in DIR/manX are saved in DIR/catX, but other mappings from man dir to cat dir can be specified in /usr//etc/man.config. No cat pages are saved when the required cat directory does not exist. No cat pages are saved when they are formatted for a line length different from 80. No cat pages are saved when man.conf contains the line NOCACHE.

It is possible to make man suid to a user man. Then, if a cat directory has owner man and mode 0755 (only writable by man), and the cat files have owner man and mode 0644 or 0444 (only writable by man, or not writable at all), no ordinary user can change the cat pages or put other files in the cat directory. If man is not made suid, then a cat directory should have mode 0777 if all users should be able to leave cat pages there.

The option -c forces reformatting a page, even if a recent cat page exists.

SEARCH PATH FOR MANUAL PAGES man uses a sophisticated method of finding manual page files, based on the invocation options and environment variables, the /usr//etc/man.config configuration file, and some built in conventions and heuristics.

First of all, when the name argument to man contains a slash (/), man assumes it is a file specification itself, and there is no searching involved.

But in the normal case where name doesn't contain a slash, man searches a variety of directories for a file that could be a manual page for the topic named.

If you specify the -M pathlist option, pathlist is a colon-separated list of the directories that man searches.

If you don't specify -M but set the MANPATH environment variable, the value of that variable is the list of the directories that man searches.

If you don't specify an explicit path list with -M or MAN- PATH, man develops its own path list based on the contents of the configuration file /usr//etc/man.config. The MAN- PATH statements in the configuration file identify partic- ular directories to include in the search path.

Furthermore, the MANPATH_MAP statements add to the search path depending on your command search path (i.e. your PATH environment variable). For each directory that may be in the command search path, a MANPATH_MAP statement specifies

Page 69: Man Des Commandes Linux

��-

a directory that should be added to the search path for manual page files. man looks at the PATH variable and adds the corresponding directories to the manual page file search path. Thus, with the proper use of MANPATH_MAP, when you issue the command man xyz, you get a manual page for the program that would run if you issued the command xyz.

In addition, for each directory in the command search path (we'll call it a "command directory") for which you do not have a MANPATH_MAP statement, man automatically looks for a manual page directory "nearby" namely as a subdirectory in the command directory itself or in the parent directory of the command directory.

You can disable the automatic "nearby" searches by includ- ing a NOAUTOPATH statement in /usr//etc/man.config.

In each directory in the search path as described above, man searches for a file named topic.section, with an optional suffix on the section number and possibly a com- pression suffix. If it doesn't find such a file, it then looks in any subdirectories named manN or catN where N is the manual section number. If the file is in a catN sub- directory, man assumes it is a formatted manual page file (cat page). Otherwise, man assumes it is unformatted. In either case, if the filename has a known compression suf- fix (like .gz), man assumes it is gzipped.

If you want to see where (or if) man would find the manual page for a particular topic, use the --path (-w) option.

ENVIRONMENT MANPATH

If MANPATH is set, man uses it as the path to search for manual page files. It overrides the configuration file and the automatic search path, but is overridden by the -M invocation option. See SEARCH PATH FOR MANUAL PAGES.

MANPL If MANPL is set, its value is used as the display page length. Otherwise, the entire man page will occupy one (long) page.

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 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 may be displayed over the whole width of your screen.

MANPAGER If MANPAGER is set, its value is used as the name of the program to use to display the man page. If not, then PAGER is used. If that has no value either, /usr/bin/less -isr is used.

��&

LANG If LANG is set, its value defines the name of the subdirectory where man first looks for man pages. Thus, the command `LANG=dk man 1 foo' will cause man to look for the foo man page in .../dk/man1/foo.1, and if it cannot find such a file, then in .../man1/foo.1, where ... is a direc- tory on the search path.

NLSPATH, LC_MESSAGES, LANG The environment variables NLSPATH and LC_MESSAGES (or LANG when the latter does not exist) play a role in locating the message catalog. (But the English messages are compiled in, and for English no catalog is required.) Note that programs like col(1) called by man also use e.g. LC_CTYPE.

PATH PATH helps determine the search path for manual page files. See SEARCH PATH FOR MANUAL PAGES.

SYSTEM SYSTEM is used to get the default alternate system name (for use with the -m option).

SEE ALSO apropos(1), whatis(1), less(1), groff(1), man.config(5).

BUGS The -t option only works if a troff-like program is installed. If you see blinking \255 or <AD> instead of hyphens, put `LESSCHARSET=latin1' in your environment.

TIPS If you add the line

(global-set-key [(f1)] (lambda () (interactive) (manual- entry (current-word))))

to your .emacs file, then hitting F1 will give you the man page for the library call at the current cursor position.

To get a plain text version of a man page, without backspaces and underscores, try

# man foo | col -b > foo.mantxt

September 2, 1995 man(1)

&-��� ����&-���

NAME mc - Visual shell for Unix-like systems.

USAGE mc [-abcCdfhPstuUVx?] [-l log] [dir1 [dir2]] [-v file]

DESCRIPTION The Midnight Commander is a directory browser/file manager for Unix-like operating systems.

Page 70: Man Des Commandes Linux

��0

OPTIONS -a Disables the usage of graphic characters for line

drawing.

-b Forces black and white display.

-c Force color mode, please check the section Colors for more information.

-C arg Used to specify a different color set in the com- mand line. The format of arg is documented in the Colors section.

-d Disables mouse support.

-f Displays the compiled-in search paths for Midnight Commander files.

-k Reset softkeys to their default from the term- cap/terminfo database. Only useful on HP terminals when the function keys don't work.

-l file Save the ftpfs dialog with the server in file.

-P At program end, the Midnight Commander will print the last working directory. This function should not be used directly, instead, it should be used from a special shell function that will automati- cally change the current directory of the shell to the last directory the Midnight Commander was in (thanks to Torben Fjerdingstad and Sergey for con- tributing this function and the code implementing this option). Source the files /usr/lib/mc/bin/mc.sh (bash and zsh users) respec- tively /usr/lib/mc/bin/mc.csh (tcsh users) in order to have this function defined.

-s Turns on the slow terminal mode, in this mode the program will not draw expensive line drawing char- acters and will toggle verbose mode off.

-t Used only if the code was compiled with Slang and terminfo: it makes the Midnight Commander use the value of the TERMCAP variable for the terminal information instead of the information on the sys- tem wide terminal database

-u Disables the use of a concurrent shell (only makes sense if the Midnight Commander has been built with concurrent shell support).

-U Enables the use of the concurrent shell support (only makes sense if the Midnight Commander was built with the subshell support set as an optional feature).

-v file Enters the internal viewer to view the file speci- fied.

-V Displays the version of the program.

-x Forces xterm mode. Used when running on xterm- capable terminals (two screen modes, and able to send mouse escape sequences).

�!*

If specified, the first path name is the directory to show in the selected panel; the second path name is the direc- tory to be shown in the other panel.

Overview The screen of the Midnight Commander is divided into four parts. Almost all of the screen space is taken up by two directory panels. By default, the second bottommost line of the screen is the shell command line, and the bottom line shows the function key labels. The topmost line is the menu bar line. The menu bar line may not be visible, but appears if you click the topmost line with the mouse or press the F9 key.

The Midnight Commander provides a view of two directories at the same time. One of the panels is the current panel (a selection bar is in the current panel). Almost all operations take place on the current panel. Some file operations like Rename and Copy by default use the direc- tory of the unselected panel as a destination (don't worry, they always ask you for confirmation first). For more information, see the sections on the Directory Pan- els, the Left and Right Menus and the File Menu.

You can execute system commands from the Midnight Comman- der by simply typing them. Everything you type will appear on the shell command line, and when you press Enter the Midnight Commander will execute the command line you typed; read the Shell Command Line and Input Line Keys sections to learn more about the command line.

Mouse Support The Midnight Commander comes with mouse support. It is activated whenever you are running on an xterm(1) terminal (it even works if you take a telnet or rlogin connection to another machine from the xterm) or if you are running on a Linux console and have the gpm mouse server running.

When you left click on a file in the directory panels, that file is selected; if you click with the right button, the file is marked (or unmarked, depending on the previous state).

Double-clicking on a file will try to execute the command if it is an executable program; and if the extension file has a program specified for the file's extension, the specified program is executed.

Also, it is possible to execute the commands assigned to the function key labels by clicking on them.

If a mouse button is clicked on the top frame line of the directory panel, it is scrolled one pageful backward. Cor- respondingly, a click on the bottom frame line will cause a scroll of one pageful forward. This frame line method works also in the Help Viewer and the Directory Tree.

The default auto repeat rate for the mouse buttons is 400 milliseconds. This may be changed to other values by edit- ing the ~/.mc/ini file and changing the mouse_repeat_rate parameter.

If you are running the Commander with the mouse support, you can bypass the Commander and get the default mouse behavior (cutting and pasting text) by holding down the

Page 71: Man Des Commandes Linux

�!�

Shift key.

Keys Some commands in the Midnight Commander involve the use of the Control (sometimes labeled CTRL or CTL) and the Meta (sometimes labeled ALT or even Compose) keys. In this man- ual we will use the following abbreviations:

C-<chr> means hold the Control key while typing the char- acter <chr>. Thus C-f would be: hold the Control key and type f.

M-<chr> means hold the Meta or Alt key down while typing <chr>. If there is no Meta or Alt key, type ESC, release it, then type the character <chr>.

All input lines in the Midnight Commander use an approxi- mation to the GNU Emacs editor's key bindings.

There are many sections which tell about the keys. The following are the most important.

The File Menu section documents the keyboard shortcuts for the commands appearing in the File menu. This section includes the function keys. Most of these commands perform some action, usually on the selected file or the tagged files.

The Directory Panels section documents the keys which select a file or tag files as a target for a later action (the action is usually one from the file menu).

The Shell Command Line section list the keys which are 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 command line history.

Input Line Keys are used for editing input lines. This means both the command line and the input lines in the query dialogs.

Miscellaneous Keys Here are some keys which don't fall into any of the other categories:

Enter. If there is some text in the command line (the one at the bottom of the panels), then that command is executed. If there is no text in the command line then if the selection bar is over a directory the Midnight Comman- der does a chdir(2) to the selected directory and reloads the information on the panel; if the selection is an exe- cutable file then it is executed. Finally, if the exten- sion of the selected file name matches one of the exten- sions in the extensions file then the corresponding com- mand is executed.

C-l. Repaint all the information in the Midnight Comman- der.

C-x c. Run the Chmod command on a file or on the tagged files.

C-x o. Run the Chown command on the current file or on the tagged files.

�!�

C-x l. Run the link command.

C-x s. Run the symbolic link command.

C-x i. Set the other panel display mode to information.

C-x q. Set the other panel display mode to quick view.

C-x !. Execute the External panelize command.

C-x h Run the add directory to hotlist command.

M-!, Executes the Filtered view command, described in the view command.

M-?, Executes the Find file command.

M-c, Pops up the quick cd dialog.

C-o, When the program is being run in the Linux or SCO console or under an xterm, it will show you the output of the previous command. When ran on the Linux console, the Midnight Commander uses an external program (cons.saver) to handle saving and restoring of information on the screen.

When the subshell support is compiled in, you can type C-o at any time and you will be taken back to the Midnight Commander main screen, to return to your application just type C-o. If you have an application suspended by using this trick, you won't be able to execute other programs from the Midnight Commander until you terminate the sus- pended application.

Directory Panels This section lists the keys which operate on the directory panels. If you want to know how to change the appearance of the panels take a look at the section on Left and Right Menus.

Tab, C-i. Change the current panel. The old other panel becomes the new current panel and the old current panel becomes the new other panel. The selection bar moves from the old current panel to the new current panel.

Insert, C-t. To tag files you may use the Insert key (the kich1 terminfo sequence) or the C-t (Control-t) sequence. To untag files, just retag a tagged file.

M-g, M-h (or M-r), M-j. Used to select the top file in a panel, the middle file and the bottom one, respectively.

C-s, M-s. Start a filename search in the directory list- ing. When the search is active the keypresses will be added to the search string instead of the command line. If the Show mini-status option is enabled the search string is shown on the mini-status line. When typing, the selec- tion bar will move to the next file starting with the typed letters. The backspace or DEL keys can be used to correct typing mistakes. If C-s is pressed again, the next match is searched for.

M-t Toggle the current display listing to show the next display listing mode. With this it is possible to quickly switch from long listing to regular listing and the user

Page 72: Man Des Commandes Linux

�!�

defined listing mode.

C-\ (control-backslash). Show the directory hotlist and change to the selected directory.

+ (plus). This is used to select (tag) a group of files. The Midnight Commander will prompt for a regular expres- sion describing the group. When Shell Patterns are enabled, the regular expression is much like the regular expressions in the shell (* standing for zero or more characters and ? standing for one character). If Shell Patterns is off, then the tagging of files is done with normal regular expressions (see ed (1)).

If the expression starts or ends with a slash (/), then it will select directories instead of files.

\ (backslash). Use the "\" key to unselect a group of files. This is the opposite of the Plus key.

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

down-key, C-n. Move the selection bar to the next entry in the panel.

home, a1, M-<. Move the selection bar to the first entry in the panel.

end, c1, M->. Move the selection bar to the last entry in the panel.

next-page, C-v. Move the selection bar one page down.

prev-page, M-v. Move the selection bar one page up.

M-o, If the other panel is a listing panel and you are standing on a directory in the current panel, then the other panel contents are set to the contents of the cur- rently selected directory (like Emacs' dired C-o key) oth- erwise the other panel contents are set to the parent dir of the current dir.

C-PageUp, C-PageDown Only when ran on the Linux console: does a chdir to ".." and to the currently selected direc- tory respectively.

M-y Moves to the previous directory in the history, equivalent to depressing the '<' with the mouse.

M-u Moves to the next directory in the history, equivalent to depressing the '>' with the mouse. Displays the direc- tory history, equivalent to depressing the 'v' with the mouse.

Shell Command Line This section lists keys which are useful to avoid exces- sive typing when entering shell commands.

M-Enter. Copy the currently selected file name to the command line.

C-Enter. Same a M-Enter, this one only works on the Linux console.

M-Tab. Does the filename, command, variable, username and

�!!

hostname completion for you.

C-x t, C-x C-t. Copy the tagged files (or if there are no 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.

C-x p, C-x C-p. The first key sequence copies the current path name to the command line, and the second one copies the unselected panel's path name to the command line.

C-q. The quote command can be used to insert characters that are otherwise interpreted by the Midnight Commander (like the '+' symbol)

M-p, M-n. Use these keys to browse through the command history. M-p takes you to the last entry, M-n takes you to the next one.

M-h. Displays the history for the current input line.

General Movement Keys The help viewer, the file viewer and the directory tree use common code to handle moving. Therefore they accept exactly the same keys. Each of them also accepts some keys of its own.

Other parts of the Midnight Commander use some of the same movement keys, so this section may be of use for those parts too.

Up, C-p. Moves one line backward.

Down, C-n. Moves one line forward.

Prev Page, Page Up, M-v. Moves one pageful backward.

Next Page, Page Down, C-v. Moves one pageful forward.

Home, A1. Moves to the beginning.

End, C1. Move to the end.

The help viewer and the file viewer accept the following keys in addition the to ones mentioned above:

b, C-b, C-h, Backspace, Delete. Moves one pageful backward.

Space bar. Moves one pageful forward.

u, d. Moves one half of a page backward or forward.

g, G. Moves to the beginning or to the end.

Input Line Keys The input lines (they are used for the command line and for the query dialogs in the program) accept these keys:

C-a puts the cursor at the beginning of line.

C-e puts the cursor at the end of the line.

C-b, move-left move the cursor one position left.

C-f, move-right move the cursor one position right.

Page 73: Man Des Commandes Linux

�!�

M-f moves one word forward.

M-b moves one word backward.

C-h, backspace delete the previous character.

C-d, Delete delete the character in the point (over the cursor).

C-@ sets the mark for cutting.

C-w copies the text between the cursor and the mark to a kill buffer and removes the text from the input line.

M-w copies the text between the cursor and the mark to a kill buffer.

C-y yanks back the contents of the kill buffer.

C-k kills the text from the cursor to the end of the line.

M-p, M-n Use these keys to browse through the command his- tory. M-p takes you to the last entry, M-n takes you to the next one.

M-C-h, M-Backspace delete one word backward.

M-Tab does the filename, command, variable, username and hostname completion for you.

Menu Bar The menu bar pops up when you press F9 or click the mouse on the top row of the screen. The menu bar has five menus: "Left", "File", "Command", "Options" and "Right".

The Left and Right Menus allow you to modify the appear- ance of the left and right directory panels.

The File Menu lists the actions you can perform on the currently selected file or the tagged files.

The Command Menu lists the actions which are more general and bear no relation to the currently selected file or the tagged files.

The Options Menu lists the actions which allow you to cus- tomize the Midnight Commander.

Left and Right Menus The outlook of the directory panels can be changed from the Left and Right menus.

Listing Mode... The listing mode view is used to display a listing of files, there are four different listing modes available: Full, Brief, Long, and User. The full directory view shows the file name, the size of the file and the modifi- cation time.

The brief view shows only the file name and it has two columns (therefore showing twice as many files as other views). The long view is similar to the output of ls -l

�!'

command. The long view takes the whole screen width.

If you choose the "User" display format, then you have to specify the display format.

The user display format must start with a panel size spec- ifier. This may be "half" or "full", and they specify a half screen panel and a full screen panel respectively.

After the panel size, you may specify the two columns mode on the panel, this is done by adding the number "2" to the user format string.

After this you add the name of the fields with an optional size specifier. This are the available fields you may display:

name, displays the file name.

size, displays the file size.

bsize, is an alternative form of the size format. It dis- plays the size of the files and for directories it just shows SUB-DIR or UP--DIR.

type, displays a one character field type. This character is a superset of what is displayed by ls with the -F flag. An asterisk for executable files, a slash for directories, an at-sign for links, an equal sign for sockets, a hyphen 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).

mtime, file's last modification time.

atime, file's last access time.

ctime, file's creation time.

perm, a string representing the current permission bits of the file.

mode, an octal value with the current permission bits of the file.

nlink, the number of links to the file.

ngid, the GID (numeric).

nuid, the UID (numeric).

owner, the owner of the file.

group, the group of the file.

inode, the inode of the file.

Also you may use these field names for arranging the dis- play:

space, a space in the display format.

mark, An asterisk if the file is tagged, a space if it's not.

|, This character is used to add a vertical line to the

Page 74: Man Des Commandes Linux

�!-

display format.

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 '+', then the size specifies the minimum field size, if the program finds out that there is more space on the screen, it will then expand this field.

For example, the Full display corresponds to this format:

half type,name,|,size,|,mtime

And the Long display corresponds to this format:

full perm,space,nlink,space,owner,space,group,space,size,space, mtime,space,name

This is a nice user display format:

half name,|,size:7,|,type,mode:3

Panels may also be set to the following modes:

Info The info view display information related to the currently selected file and if possible information about the current file system.

Tree The tree view is quite similar to the directory tree feature. See the section about it for more information.

Quick View In this mode, the panel will switch to a reduced viewer that displays the contents of the currently selected file, if you select the panel (with the tab key or the mouse), you will have access to the usual viewer commands.

Sort Order... The eight sort orders are by name, by extension, by modi- fication time, by access time, and by inode information modification time, by size, by inode and unsorted. In the Sort order dialog box you can choose the sort order and you may also specify if you want to sort in reverse order by checking the reverse box.

By default directories are sorted before files but this can be changed from the Options menu (option Mix all files ).

Filter... The filter command allows you to specify a shell pattern (for example *.tar.gz ) which the files must match to be shown. Regardless of the filter pattern, the directories and the links to directories are always shown in the directory panel.

Reread The reread command reload the list of files in the direc- tory. It is useful if other processes have created or removed files. If you have panelized file names in a panel this will reload the directory contents and remove

�!&

the panelized information (See the section External panel- ize for more information).

File Menu The Midnight Commander uses the F1 - F10 keys as keyboard shortcuts for commands appearing in the file menu. The escape sequences for the Fkeys are terminfo capabilities kf1 trough kf10. On terminals without function key sup- port, you can achieve the same functionality by pressing the ESC key and then a number in the range 1 through 9 and 0 (corresponding to F1 to F9 and F10 respectively).

The File menu has the following commands (keyboard short- cuts in parentheses):

Help (F1)

Invokes the built-in hypertext help viewer. Inside the help viewer, you can use the Tab key to select the next link and the Enter key to follow that link. The keys Space and Backspace are used to move forward and backward in a help page. Press F1 again to get the full list of accepted keys.

Menu (F2)

Invoke the user menu. The user menu provides an easy way to provide users with a menu and add extra features to the Midnight Commander.

View (F3, Shift-F3)

View the currently selected file. By default this invokes the Internal File Viewer but if the option "Use internal view" is off, it invokes an external file viewer specified by the PAGER environment variable. If PAGER is undefined, the "view" command is invoked. If you use Shift-F3 instead, the viewer will be invoked without doing any for- matting or preprocessing to the file.

Filtered View (M-!)

this command prompts for a command and it's arguments (the argument defaults to the currently selected file name), the output from such command is shown in the internal file viewer.

Edit (F4)

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.

Copy (F5)

Pop up an input dialog with destination that defaults to the directory in the non-selected panel and copies the currently selected file (or the tagged files, if there is 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 source mask (which will be usually either * or ^\(.*\)$ depending on setting of Use shell patterns) and possible wildcards in the destination see Mask copy/rename.

On some systems, it is possible to do the copy in the

Page 75: Man Des Commandes Linux

�!0

background by clicking on the background button (or press- ing M-b in the dialog box). The Background Jobs is used to control the background process.

Link (C-x l)

Create a hard link to the current file.

SymLink (C-x s)

Create a symbolic link to the current file. To those of 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 filename and the destination filename represent the same file image. For example, if you edit one of these files, all changes you make will appear in both files. Some peo- ple call links aliases or shortcuts.

A hard link appears as a real file. After making it, there is no way of telling which one is the original and which is the link. If you delete either one of them the other one is still intact. It is very difficult to notice that the files represent the same image. Use hard links when you don't even want to know.

A symbolic link is a reference to the name of the original file. If the original file is deleted the symbolic link is useless. It is quite easy to notice that the files repre- sent the same image. The Midnight Commander shows an "@"-sign in front of the file name if it is a symbolic link to somewhere (except to directory, where it shows a tilde (~)). The original file which the link points to is shown on mini-status line if the Show mini-status option is enabled. Use symbolic links when you want to avoid the confusion that can be caused by hard links.

Rename/Move (F6)

Pop up an input dialog that defaults to the directory in the non-selected panel and moves the currently selected file (or the tagged files if there is at least one tagged file) to the directory specified by the user in the input dialog. During the process, you can press C-c or ESC to abort the operation. For more details look at Copy opera- tion above, most of the things are quite similar.

On some systems, it is possible to do the copy in the background by clicking on the background button (or press- ing M-b in the dialog box). The Background Jobs is used to control the background process.

Mkdir (F7)

Pop up an input dialog and creates the directory speci- fied.

Delete (F8)

Delete the currently selected file or the tagged files in the currently selected panel. During the process, you can press C-c or ESC to abort the operation.

Quick cd (M-c) Use the quick cd command if you have full command line and want to cd somewhere.

Select group (+)

��*

This is used to select (tag) a group of files. The Mid- night Commander will prompt for a regular expression describing the group. When Shell Patterns are enabled, the regular expression is much like the filename globbing in the shell (* standing for zero or more characters and ? standing for one character). If Shell Patterns is off, then the tagging of files is done with normal regular expressions (see ed (1)).

To mark directories instead of files, the expression must start or end with a '/'.

Unselect group (\)

Used for unselecting a group of files. This is the oppo- site of the Select group command.

Quit (F10, Shift-F10)

Terminate the Midnight Commander. Shift-F10 is used when you want to quit and you are using the shell wrapper. Shift-F10 will not take you to the last directory you vis- ited with the Midnight Commander, instead it will stay at the directory where you started the Midnight Commander.

Quick cd This command is useful if you have a full command line and want to cd somewhere without having to yank and paste the command line. This command pops up a small dialog, where you enter everything you would enter after cd on the com- mand line and then you press enter. This features all the things that are already in the internal cd command.

Command Menu The Directory tree command shows a tree figure of the directories.

The Find file command allows you to search for a specific file. The "Swap panels" command swaps the contents of the two directory panels.

The "Panels on/off" command shows the output of the last shell command. This works only on xterm and on Linux and SCO console.

The Compare directories (C-x d) command compares the directory panels with each other. You can then use the Copy (F5) command to make the panels identical. There are three compare methods. The quick method compares only file size and file date. The thorough method makes a full byte- by-byte compare. The thorough method is not available if the machine does not support the mmap(2) system call. The size-only compare method just compares the file sizes and does not check the contents or the date times, it just checks the file size.

The Command history command shows a list of typed com- mands. The selected command is copied to the command line. The command history can also be accessed by typing M-p or M-n.

The Directory hotlist (C-\) command makes changing of the current directory to often used directories faster.

The External panelize allows you to execute an external

Page 76: Man Des Commandes Linux

���

program, and make the output of that program the contents of the current panel.

Extension file edit command allows you to specify programs to executed when you try to execute, view, edit and do a bunch of other thing on files with certain extensions (filename endings). The Menu file edit command may be used for editing the user menu (which appears by pressing F2).

Directory Tree The Directory Tree command shows a tree figure of the directories. You can select a directory from the figure and the Midnight Commander will change to that directory.

There are two ways to invoke the tree. The real directory tree command is available from Commands menu. The other way is to select tree view from the Left or Right menu.

To get rid of long delays the Midnight Commander creates the tree figure by scanning only a small subset of all the directories. If the directory which you want to see is missing, move to its parent directory and press C-r (or F2).

You can use the following keys:

General movement keys are accepted.

Enter. In the directory tree, exits the directory tree and changes to this directory in the current panel. In the tree view, changes to this directory in the other panel and stays in tree view mode in the current panel.

C-r, F2 (Rescan). Rescan this directory. Use this when the tree figure is out of date: it is missing subdirecto- ries or shows some subdirectories which don't exist any more.

F3 (Forget). Delete this directory from the tree figure. Use this to remove clutter from the figure. If you want the directory back to the tree figure press F2 in its par- ent directory.

F4 (Static/Dynamic). Toggle between the dynamic naviga- tion mode (default) and the static navigation mode.

In the static navigation mode you can use the Up and Down keys to select a directory. All known directories are shown.

In the dynamic navigation mode you can use the Up and Down keys to select a sibling directory, the Left key to move to the parent directory, and the Right key to move to a child directory. Only the parent, sibling and children directories are shown, others are left out. The tree fig- ure changes dynamically as you traverse.

F5 (Copy). Copy the directory.

F6 (RenMov). Move the directory.

F7 (Mkdir). Make a new directory below this directory.

F8 (Delete). Delete this directory from the file system.

C-s, M-s. Search the next directory matching the search

���

string. If there is no such directory these keys will move one line down.

C-h, Backspace. Delete the last character of the search string.

Any other character. Add the character to the search 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 shown in the mini status line.

The following actions are available only in the directory tree. They aren't supported in the tree view.

F1 (Help). Invoke the help viewer and show this section.

Esc, F10. Exit the directory tree. Do not change the directory.

The mouse is supported. A double-click behaves like Enter. See also the section on mouse support.

Find File The Find File feature first asks for the start directory for the search and the filename to be searched for. By pressing the Tree button you can select the start direc- tory from the directory tree figure.

The contents field accepts regular expressions similar to egrep(1). That means you have to escape characters with a special meaning to egrep with "\", e.g. if you search for "strcmp (" you will have to input "strcmp \(" (without the double quotes).

You can start the search by pressing the Ok button. Dur- ing the search you can stop from the Stop button and con- tinue from the Start button.

You can browse the filelist with the up and down arrow keys. The Chdir button will change to the directory of the currently selected file. The Again button will ask for the parameters for a new search. The Quit button quits the search operation. The Panelize button will place the found files to the current directory panel so that you can do additional operations on them (view, copy, move, delete and so on). After panelizing you can press C-r to return to the normal file listing.

It is possible to have a list of directories that the Find File command should skip during the search (for example, you may want to avoid searches on a CDROM or on a NFS directory that is mounted across a slow link).

Directories to be skipped should be set on the variable find_ignore_dirs in the Misc section of your ~/.mc/ini file.

Directory components should be separated with a colon, here is an example:

[Misc] find_ignore_dirs=/cdrom:/nfs/wuarchive:/afs

You may consider using the External panelize command for some operations. Find file command is for simple queries

Page 77: Man Des Commandes Linux

���

only, while using External panelize you can do as mysteri- ous searches as you would like.

External panelize The External panelize allows you to execute an external program, and make the output of that program the contents of the current panel.

For example, if you want to manipulate in one of the pan- els all the symbolic links in the current directory, you can use external panelization to run the following com- mand:

find . -type l -print Upon command completion, the directory contents of the panel will no longer be the directory listing of the cur- rent directory, but all the files that are symbolic links.

If you want to panelize all of the files that have been downloaded from your ftp server, you can use this awk com- mand to extract the file name from the transfer log files:

awk '$9 ~! /incoming/ { print $9 }' < /usr/adm/xferlog

You may want to save often used panelize commands under a descriptive name, so that you can recall them quickly. You do this by typing the command on the input line and press- ing Add new button. Then you enter a name under which you want the command to be saved. Next time, you just choose that command from the list and do not have to type it again.

Hotlist The Directory hotlist command shows the labels of the directories in the directory hotlist. The Midnight Comman- der will change to the directory corresponding to the selected label. From the hotlist dialog, you can remove already created label/directory pairs and add new one. For 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 label for the directory.

This makes cd to often used directories faster. You may consider using the CDPATH variable as described in inter- nal cd command description.

Extension File Edit This will invoke your editor on the file ~/.mc/ext. The format of this file is as follows (the format has changed with version 3.0):

All lines starting with # or empty lines are thrown away.

Lines starting in the first column should have following format:

keyword/descNL, i.e. everything after keyword/ until new line is desc

keyword can be:

shell

��!

(desc is then any extension (no wildcards), i.e. matches all the files *desc . Example: .tar matches *.tar)

regex

(desc is a regular expression)

type

(file matches this if `file %f` matches regular expression desc (the filename: part from `file %f` is removed))

default

(matches any file no matter what desc is)

Other lines should start with a space or tab and should be of the format:

keyword=commandNL (with no spaces around =), where keyword should be:

Open (if the user presses Enter or doubleclicks it), View (F3), Edit (F4), Drop (user drops some files on it) or any other user defined name (those will be listed in the extension dependent pop-up menu). Icon name is reserved for future use by mc.

command is any one-line shell command, with the simple macro substitution.

Target are evaluated from top to bottom (order is thus important). If some actions are missing, search continues as if this target didn't match (i.e. if a file matches the first and second entry and View action is missing in the first one, then on pressing F3 the View action from the second entry will be used. default should catch all the actions.

Background Jobs This lets you control the state of any background Midnight Commander process (only copy and move files operations can be done in the background). You can stop, restart and kill a background job from here.

Menu File Edit The user menu is a menu of useful actions that can be cus- tomized by the user. When you access the user menu, the file .mc.menu from the current directory is used if it exists, but only if it is owned by user or root and is not world-writable. If no such file found, ~/.mc/menu is tried in the same way, and otherwise mc uses the default system-wide menu /usr/lib/mc/mc.menu.

The format of the menu file is very simple. Lines that start with anything but space or tab are considered entries for the menu (in order to be able to use it like a hot key, the first character should be a letter). All the lines that start with a space or a tab are the commands that will be executed when the entry is selected.

When an option is selected all the command lines of the option are copied to a temporary file in the temporary

Page 78: Man Des Commandes Linux

���

directory (usually /usr/tmp) and then that file is exe- cuted. This allows the user to put normal shell constructs in the menus. Also simple macro substitution takes place before executing the menu code. For more information, see macro substitution.

Here is a sample mc.menu file:

A Dump the currently selected file od -c %f

B Edit a bug report and send it to root vi /tmp/mail.$$ mail -s "Midnight Commander bug" root < /tmp/mail.$$

M Read mail emacs -f rmail

N Read Usenet news emacs -f gnus

H Call the info hypertext browser info

J Copy current directory to other panel recursively tar cf - . | (cd %D && tar xvpf -)

K Make a release of the current subdirectory echo -n "Name of distribution file: " read tar ln -s %d `dirname %d`/$tar cd .. tar cvhf ${tar}.tar $tar

= f *.tar.gz | f *.tgz & t n X Extract the contents of a compressed tar file

tar xzvf %f

Default Conditions

Each menu entry may be preceded by a condition. The condi- tion must start from the first column with a '=' charac- ter. If the condition is true, the menu entry will be the default entry.

Condition syntax: = <sub-cond> or: = <sub-cond> | <sub-cond> ... or: = <sub-cond> & <sub-cond> ...

Sub-condition is one of following:

y <pattern> syntax of current file matching pattern? for edit menu only.

f <pattern> current file matching pattern? F <pattern> other file matching pattern? d <pattern> current directory matching pattern? D <pattern> other directory matching pattern? t <type> current file of type? T <type> other file of type? x <filename> is it executable filename? ! <sub-cond> negate the result of sub-condition

Pattern is a normal shell pattern or a regular expression, according to the shell patterns option. You can override the global value of the shell patterns option by writing "shell_patterns=x" on the first line of the menu file (where "x" is either 0 or 1).

��'

Type is one or more of the following characters:

n not directory r regular file d directory l link c char special b block special f fifo s socket x executable t tagged

For example 'rlf' means either regular file, link or fifo. The 't' type is a little special because it acts on the panel instead of the file. The condition '=t t' is true if there are tagged files in the current panel and false if not.

If the condition starts with '=?' instead of '=' a debug trace will be shown whenever the value of the condition is calculated.

The conditions are calculated from left to right. This means

= f *.tar.gz | f *.tgz & t n is calculated as

( (f *.tar.gz) | (f *.tgz) ) & (t n)

Here is a sample of the use of conditions:

= f *.tar.gz | f *.tgz & t n L List the contents of a compressed tar-archive

gzip -cd %f | tar xvf -

Addition Conditions

If the condition begins with '+' (or '+?') instead of '=' (or '=?') it is an addition condition. If the condition is true the menu entry will be included in the menu. If the condition is false the menu entry will not be included in the menu.

You can combine default and addition conditions by start- ing condition with '+=' or '=+' (or '+=?' or '=+?' if you want debug trace). If you want to use two different condi- tions, one for adding and another for defaulting, you can precede a menu entry with two condition lines, one start- ing with '+' and another starting with '='.

Comments are started with '#'. The additional comment lines must start with '#', space or tab.

Options Menu The Midnight Commander has some options that may be tog- gled on and off in several dialogs which are accessible from this menu. Options are enabled if they have an aster- isk or "x" in front of them.

The Configuration command pops up a dialog from which you can change most of settings of the Midnight Commander.

The Display bits command pops up a dialog from which you may select which characters is your terminal able to dis- play.

Page 79: Man Des Commandes Linux

��-

The Confirmation command pops up a dialog from which you specify which actions you want to confirm.

The Learn keys command pops up a dialog from which you test some keys which are not working on some terminals and you may fix them.

The Virtual FS command pops up a dialog from which you specify some VFS related options.

The Layout command pops up a dialog from which you specify a bunch of options how mc looks like on the screen.

The Save setup command saves the current settings of the Left, Right and Options menus. A small number of other settings is saved, too.

Configuration The options in this dialog are divided into three groups: Panel Options, Pause after run and Other Options.

Panel Options

Show Backup Files. By default the Midnight Commander doesn't show files ending in '~' (like GNU's ls option -B).

Show Hidden Files. By default the Midnight Commander will show all files that start with a dot (like ls -a).

Mark moves down. By default when you mark a file (with either C-t or the Insert key) the selection bar will move down.

Drop down menus. When this option is enabled, when you press the F9 key, the pull down menus will be activated, else, you will only be presented with the menu title, and you will have to select the entry with the arrow keys or the first letter and from there select your option in the menu.

Mix all files. When this option is enabled, all files and directories are shown mixed together. If the option is off, directories (and links to directories) are shown at the beginning of the listing, and other files afterwards.

Fast directory reload. This option is off by default. If you activate the fast reload, the Midnight Commander will use a trick to determine if the directory contents have changed. The trick is to reload the directory only if the i-node of the directory has changed; this means that reloads only happen when files are created or deleted. If what changes is the i-node for a file in the directory (file size changes, mode or owner changes, etc) the dis- play is not updated. In these cases, if you have the option on, you have to rescan the directory manually (with C-r).

Pause after run

After executing your commands, the Midnight Commander can pause, so that you can examine the output of the command. There are three possible settings for this variable:

Never Means that you do not want to see the output

��&

of your command. If you are using the Linux or SCO console or an xterm, you will be able to see the output of the command by typing C-o.

On dumb terminals You will get the pause message on terminals that are not capable of showing the out- put of the last command executed (any terminal that is not an xterm or the Linux console).

Always The program will pause after executing all of your commands.

Other Options

Verbose operation. This toggles whether the file Copy, Rename and Delete operations are verbose (i.e., display a 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 less than 9600 bps.

Compute totals. If this option is enabled, the Midnight Commander computes total byte sizes and total number of files prior to any Copy, Rename and Delete operations. This will provide you with a more accurate progress bar at the expense of some speed. This option has no effect, if Verbose operation is disabled.

Shell Patterns. By default the Select, Unselect and Fil- ter commands will use shell-like regular expressions. The following conversions are performed to achieve this: the '*' is replaced by '.*' (zero or more characters); the '?' is replaced by '.' (exactly one character) and '.' by the literal dot. If the option is disabled, then the regular expressions are the ones described in ed(1).

Auto Save Setup. If this option is enabled, when you exit the Midnight Commander the configurable options of the Midnight Commander are saved in the ~/.mc/ini file.

Auto menus. If this option is enabled, the user menu will be invoked at startup. Useful for building menus for non- unixers.

Use internal editor. If this option is enabled, the built-in file editor is used to edit files. If the option is disabled, the editor specified in the EDITOR environ- ment variable is used. If no editor is specified, vi is used. See the section on the internal file editor.

Use internal viewer. If this option is enabled, the built-in file viewer is used to view files. If the option is disabled, the pager specified in the PAGER environment variable is used. If no pager is specified, the view com- mand is used. See the section on the internal file viewer.

Complete: show all. By default the Midnight Commander pops up all possible completions if the completion is ambiguous if you press M-Tab for the second time, for the first time it just completes as much as possible and in the case of ambiguity beeps. If you want to see all the possible completions already after the first M-Tab press- ing, enable this option.

Rotating dash. If this option is enabled, the Midnight Commander shows a rotating dash in the upper right corner

Page 80: Man Des Commandes Linux

��0

as a work in progress indicator.

Lynx-like motion. If this option is enabled, you may use the arrows keys to automatically chdir if the current selection is a subdirectory and the shell command line is empty. By default, this setting is off.

Advanced chown. If this option is enabled, the Advanced Chown command will be invoked if you run the Chmod

or Chown command.

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 using the cd command. This is the default behavior of bash. When unset, the Midnight Commander follows the real directory structure, so cd .. if you've entered that directory through a link will move you to the current directory's real parent and not to the directory where the link was present.

Safe delete. If this option is enabled, deleting files unintentionally will get more difficult. The default selection in the confirmation dialog changes from the "Yes" to the "No" button and deletion of non empty direc- tories has to be confirmed by entering the word yes . By default this option is disabled.

Display bits This is used to configure the range of visible characters on the screen. This setting may be 7-bits if your terminal/curses supports only seven output bits, ISO-8859-1 displays all the characters in the ISO-8859-1 map and full 8 bits is for those terminals that can dis- play full 8 bit characters.

Confirmation In this menu you configure the confirmation options for file deletion, overwriting, execution by pressing enter and quitting the program.

Learn keys This dialog lets you test if your keys F1-F20, Home, End, etc. work properly on your terminal. They often don't, since many terminal databases are broken.

You can move around with the Tab key, with the vi moving keys ('h' left, 'j' down, 'k' up and 'l' right) and after you press any arrow key once (this will mark it OK), then you can use that key as well.

You test them just by pressing each of them. As soon as you press a key and the key works properly, OK should appear next to the name of that key. Once a key is marked OK it starts to work as usually, e.g. F1 for the first time will just check that F1 works OK, but from that time on it will show help. The same applies to the arrow keys. Tab key should be working always.

If some keys do not work properly, then you won't see OK after the key name after you have pressed that key. You may then want to fix it. You do it by pressing the button of that key (either by mouse or using Tab and Enter). Then a red message will appear and you will be asked to

�'*

type that key. If you want to abort this, press just Esc and wait until the message disappears. Otherwise type the key you're asked to type and also wait until the dialog disappears.

When you finish with all the keys, you may want either to Save your key fixes into your ~/.mc/ini file into the [terminal:TERM] section (where TERM is the name of your current terminal) or to discard them. If all your keys were working properly and you had not to fix any key, then (of course) no saving will occur.

Virtual FS This option gives you control over the settings of the Virtual File System information cache.

The Midnight Commander keeps in memory the information related to some of the virtual file systems to speed up the access to the files in the file system (for example, directory listings fetched from ftp servers).

Moreover in order to access the contents of compressed files (for example, compressed tar files) the Midnight Commander has to create a temporary uncompressed file on your disk.

Since both the information in memory and the temporary files on disk take up resources, you may want to tune the parameters of the cached information to decrease your resource usage or to maximize the speed of access to frequently used file systems.

The Tar file system is quite clever about how it handles tar files: it just loads the directory entries and when it needs to use the information contained in the tar file, it goes and grab it.

In the wild, tar files are usually kept compressed (plain tar files are species in extinction), and because of the nature of those files (the directory entries for the tar 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 as a regular tar file.

Now, since we all love to browse files and tar files all over the disk, it's common that you will leave a tar file and the re-enter it later. Since uncompression is slow, the Midnight Commander will cache the information in mem- ory for a limited amount of time, after you hit the time- out, all of the resources associated with the file system will be freed. The default timeout is set to one minute.

The FTP File System keeps the directory listing it fetches from a ftp server in a cache. The cache expire time is configurable with the ftpfs directory cache timeout option. A low value for this option may slow down every operation on the ftp file System because every operation is accompanied by a query of the ftp server.

Moreover you can define a proxy host for doing ftp trans- fers and configure the Midnight Commander to always use the proxy host. See the section on FTP File System for more information.

Page 81: Man Des Commandes Linux

�'�

Layout The layout dialog gives you a possibility to change the general layout of screen. You can specify whether the menubar, the command prompt, the hintbar and the function keybar are visible. On the Linux or SCO console you can specify how many lines are shown in the output window.

The rest of the screen area is used for the two directory panels. You can specify whether the area is split to the panels in vertical or horizontal direction. The split can be equal or you can specify an unequal split.

By default all contents of the directory panels are dis- played with the same color, but you can specify whether permissions and file types are highlighted with special Colors. If permission highlighting is enabled, the parts of the perm and mode display fields which are valid for the user running Midnight Commander are highlighted with the color defined with the selected keyword. If file type highlighting is enabled, files are colored according to their file type (e.g. directory, core file, executable, ...).

If the Show Mini-Status option is enabled, one line of status information about the currently selected item is showed at the bottom of the panels.

Save Setup 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 the system-wide configuration file, located in /usr/lib/mc/mc.ini. If the system-wide configuration file doesn't exist, MC uses the default settings.

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

If you activate the auto save setup option, MC will always save the current settings when exiting.

There also exist settings which can't be changed from the menus. To change these settings you have to edit the setup file with your favorite editor. See the section on Special Settings for more information.

Executing operating system commands You may execute commands by typing them directly in the Midnight Commander's input line, or by selecting the pro- gram you want to execute with the selection bar in one of the panels and hitting Enter.

If you press Enter over a file that is not executable, the Midnight Commander checks the extension of the selected file against the extensions in the Extensions File. If a match is found then the code associated with that exten- sion is executed. A very simple macro expansion takes place before executing the command.

The cd internal command The cd command is interpreted by the Midnight Commander, it is not passed to the command shell for execution. Thus

�'�

it may not handle all of the nice macro expansion and sub- stitution that your shell does, although it does some of them:

Tilde substitution The (~) will be substituted with your home directory, if you append a username after the tilde, then it will be substituted with the login directory of the the specified user.

For example, ~guest is the home directory for the user guest, while ~/guest is the directory guest in your home directory.

Previous directory You can jump to the directory you were previously by using the special directory name '-' like this: cd -

CDPATH directories If the directory specified to the cd command is not in the current directory, then The Midnight Commander uses the value in the environment variable CDPATH to search for the directory in any of the named directories.

For example you could set your CDPATH variable to ~/src:/usr/src, allowing you to change your directory to 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 /usr/src/linux).

Macro Substitution When accessing a user menu, or executing an extension dependent command, or running a command from the command line input, a simple macro substitution takes place.

The macros are:

%i

The indent of blank space, equal the cursor column position. For edit menu only.

%y

The syntax type of current file. For edit menu only.

%k

The block file name.

%e

The error file name.

%m

The current menu name.

%f

The current file name.

%x

The extension of current file name.

Page 82: Man Des Commandes Linux

�'�

%b

The current file name without extension.

%d

The current directory name.

%F

The current file in the unselected panel.

%D

The directory name of the unselected panel.

%t

The currently tagged files.

%T

The tagged files in the unselected panel.

%u and %U

Similar to the %t and %T macros, but in addition the files are untagged. You can use this macro only once per menu file entry or extension file entry, because next time there will be no tagged files.

%s and %S

The selected files: The tagged files if there are any. Otherwise the current file.

%q

Dropped files. In all places except in the Drop action of the mc.ext file, this will become a null string, in the Drop action it will be replaced with a space separated list of files that were dropped on the file.

%cd

This is a special macro that is used to change the current directory to the directory specified in front of it. This is used primarily as an inter- face to the Virtual File System.

%view

This macro is used to invoke the internal viewer. This macro can be used alone, or with arguments. If you pass any arguments to this macro, they should be enclosed in brackets.

The arguments are: ascii to force the viewer into ascii mode; hex to force the viewer into hex mode; nroff to tell the viewer that it should interpret the bold and underline sequences of nroff; unfor- matted to tell the viewer to not interpret nroff commands for making the text bold or underlined.

%%

�'!

The % character

%{some text}

Prompt for the substitution. An input box is shown and the text inside the braces is used as a prompt. The macro is substituted by the text typed by the user. The user can press ESC or F10 to cancel. This macro doesn't work on the command line yet.

The subshell support The subshell support is a compile time option, that works with the shells: bash, tcsh and zsh.

When the subshell code is activated the Midnight Commander will spawn a concurrent copy of your shell (the one defined in the SHELL variable and if it is not defined, then the one in the /etc/passwd file) and run it in a pseudo terminal, instead of invoking a new shell each time you execute a command, the command will be passed to the subshell as if you had typed it. This also allows you to change the environment variables, use shell functions and define aliases that are valid until you quit the Midnight Commander.

If you are using bash you can specify startup commands for the subshell in your ~/.mc/bashrc file and special key- board maps in the ~/.mc/inputrc file. tcsh users may specify startup commands in the ~/.mc/tcshrc file.

When the subshell code is used, you can suspend applica- tions at any time with the sequence C-o and jump back to the Midnight Commander, if you interrupt an application, you will not be able to run other external commands until you quit the application you interrupted.

An extra added feature of using the subshell is that the prompt displayed by the Midnight Commander is the same prompt that you are currently using in your shell.

The OPTIONS section has more information on how you can control the subshell code.

Controlling Midnight Commander The Midnight Commander defines an environment variable MC_CONTROL_FILE. The commands executed by MC may give instructions to MC by writing to the file specified by this variable. This is only available if you compiled your copy of the Midnight Commander with the WANT_PARSE option.

The following instructions are supported.

clear_tags Clear all tags. tag <filename> Tag specified file. untag <filename> Untag specified file. select <filename> Move pointer to file. change_panel Switch between panels. cd <path> Change directory.

If the first letter of the instruction is in lower case it 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

Page 83: Man Des Commandes Linux

�'�

must be separated by exactly one space, tab or newline. The instructions don't work in the Info, Tree and Quick views. The first error causes the rest to be ignored.

Chmod The Chmod window is used to change the attribute bits in a group of files and directories. It can be invoked with the C-x c key combination.

The Chmod window has two parts - Permissions and File

In the File section are displayed the name of the file or directory and its permissions in octal form, as well as its owner and group.

In the Permissions section there is a set of check buttons which correspond to the file attribute bits. As you change the attribute bits, you can see the octal value change in the File section.

To move between the widgets (buttons and check buttons) use the arrow keys or the Tab key. To change the state of the check buttons or to select a button use Space. You can also use the hotkeys on the buttons to quickly acti- vate that selection (they are the highlit letters on the buttons).

To set the attribute bits, use the Enter key.

When working with a group of files or directories, you just click on the bits you want to set or clear. Once you have selected the bits you want to change, you select one of the action buttons (Set marked or Clear marked).

Finally, to set the attributes exactly to those specified, you can use the [Set all] button, which will act on all the tagged files.

[Marked all] set only marked attributes to all selected files

[Set marked] set marked bits in attributes of all selected files

[Clean marked] clear marked bits in attributes of all selected files

[Set] set the attributes of one file

[Cancel] cancel the Chmod command

Chown The Chown command is used to change the owner/group of a file. The hot key for this command is C-x o.

Advanced Chown The Advanced Chown command is the Chmod and Chown command combined into one window. You can change the permissions and owner/group of files at once.

File Operations When you copy, move or delete files the Midnight Commander shows the file operations dialog. It shows the files cur-

�''

rently being operated on and there are at most three progress bars. The file bar tells how big part of the cur- 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 has been handled so far. If the verbose option is off the file and bytes bars are not shown.

There are two buttons at the bottom of the dialog. Press- ing the Skip button will skip the rest of the current file. Pressing the Abort button will abort the whole oper- ation, the rest of the files are skipped.

There are three other dialogs which you can run into dur- ing the file operations.

The error dialog informs about error conditions and has three choices. Normally you select either the Skip button to skip the file or the Abort button to abort the opera- tion altogether. You can also select the Retry button if you fixed the problem from another terminal.

The replace dialog is shown when you attempt to copy or move a file on the top of an existing file. The dialog shows the dates and sizes of the both files. Press the Yes button to overwrite the file, the No button to skip the file, the alL button to overwrite all the files, the nonE button to never overwrite and the Update button to over- write if the source file is newer than the target file. You can abort the whole operation by pressing the Abort button.

The recursive delete dialog is shown when you try to delete a directory which is not empty. Press the Yes but- ton to delete the directory recursively, the No button to skip the directory, the alL button to delete all the directories and the nonE button to skip all the non-empty directories. You can abort the whole operation by pressing the Abort button. If you selected the Yes or alL button you will be asked for a confirmation. Type "yes" only if you are really sure you want to do the recursive delete.

If you have tagged files and perform an operation on them only the files on which the operation succeeded are untagged. Failed and skipped files are left tagged.

Mask Copy/Rename The copy/move operations lets you translate the names of files in an easy way. To do it, you have to specify the 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 the target mask. If there are tagged files, only the tagged files matching the source mask are renamed.

There are other option which you can set:

Follow links tells whether make the symlinks and hardlinks in the source directory (recursively in subdirectories) new links in the target directory or whether would you like to copy their content.

Dive into subdirs tells what to do if in the target direc- tory exists a directory with the same name as the file/directory being copied. The default action is to copy it's content into that directory, by enabling this you can

Page 84: Man Des Commandes Linux

�'-

copy the source directory into that directory. Perhaps an example will help:

You want to copy content of a directory foo to /bla/foo, which is an already existing directory. Normally (when Dive is not set), mc would copy it exactly into /bla/foo. By enabling this option you will copy the content into /bla/foo/foo, because the directory already exists.

Preserve attributes tells whether to preserve the original 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 respected.

Use shell patterns on

When the shell patterns option is on you can use the '*' and '?' wildcards in the source mask. They work like they do in the shell. In the target mask only the '*' and '\<digit>' wildcards are allowed. The first '*' wildcard in the target mask corresponds to the first wildcard group in the source mask, the second '*' corresponds to the sec- ond group and so on. The '\1' wildcard corresponds to the first wildcard group in the source mask, the '\2' wildcard corresponds to the second group and so on all the way up to '\9'. The '\0' wildcard is the whole filename of the source file.

Two examples:

If the source mask is "*.tar.gz", the destination is "/bla/*.tgz" and the file to be copied is "foo.tar.gz", the copy will be "foo.tgz" in "/bla".

Let's suppose you want to swap basename and extension so that "file.c" will become "c.file" and so on. The source mask for this is "*.*" and the destination is "\2.\1".

Use shell patterns off

When the shell patterns option is off the MC doesn't do automatic grouping anymore. You must use '\(...\)' expres- sions in the source mask to specify meaning for the wild- cards in the target mask. This is more flexible but also requires more typing. Otherwise target masks are similar to the situation when the shell patterns option is on.

Two examples:

If the source mask is "^\(.*\)\.tar\.gz$", the destination is "/bla/*.tgz" and the file to be copied is "foo.tar.gz", the copy will be "/bla/foo.tgz".

Let's suppose you want to swap basename and extension so that "file.c" will become "c.file" and so on. The source mask for this is "^\(.*\)\.\(.*\)$" and the destination is "\2.\1".

Case Conversions

You can also change the case of the filenames. If you use '\u' or uppercase or lowercase correspondingly.

If you use '\U' or '\L' in the target mask the next char- acters will be converted to uppercase or lowercase corre- spondingly up to the next

�'&

The '\u' and '\l' are stronger than '\U' and '\L'.

For example, if the source mask is '*' (shell patterns on) or '^\(.*\)$' (shell patterns off) and the target mask is '\L\u*' the file names will be converted to have initial upper case and otherwise lower case.

You can also use '\' as a quote character. For example, '\\' is a backslash and '\*' is an asterisk.

Internal File Viewer The internal file viewer provides two display modes: ASCII and hex. To toggle between modes, use the F4 key. If you have the GNU gzip program installed, it will be used to automatically decompress the files on demand.

The viewer will try to use the best method provided by your system or the file type to display the information. The internal file viewer will interpret some string sequences to set the bold and underline attributes, thus making a pretty display of your files.

When in hex mode, the search function accepts text in quotes and constant numbers. Text in quotes is matched exactly after removing the quotes. Each number matches one byte. You can mix quoted text with constants like this:

"String" -1 0xBB 012 "more text"

Note that 012 is an octal number. -1 is converted to 0xFF.

Some internal details about the viewer: On systems that provide the mmap(2) system call, the program maps the file instead of loading it; if the system does not provide the mmap(2) system call or the file matches an action that requires a filter, then the viewer will use it's growing buffers, thus loading only those parts of the file that you actually access (this includes compressed files).

Here is a listing of the actions associated with each key that the Midnight Commander handles in the internal file viewer.

F1 Invoke the builtin hypertext help viewer.

F2 Toggle the wrap mode.

F4 Toggle the hex mode.

F5 Goto line. This will prompt you for a line number and will display that line.

F6, /. Regular expression search.

?, Reverse regular expression search.

F7 Normal search / hex mode search.

C-s, F17, n. Start normal search if there was no previous search expression else find next match.

C-r. Start reverse search if there was no previous search expression else find next match.

Page 85: Man Des Commandes Linux

�'0

F8 Toggle Raw/Parsed mode: This will show the file as found on disk or if a processing filter has been specified in the mc.ext file, then the output from the filter. Cur- rent mode is always the other than written on the button label, since on the button is the mode which you enter by that key.

F9 Toggle the format/unformat mode: when format mode is on the viewer will interpret some string sequences to show bold and underline with different colors. Also, on button label is the other mode than current.

F10, Esc. Exit the internal file viewer.

next-page, space, C-v. Scroll one page forward.

prev-page, M-v, C-b, backspace. Scroll one page backward.

down-key Scroll one line forward.

up-key Scroll one line backward.

C-l Refresh the screen.

C-o Switch to the subshell and show the command screen.

! Like C-o, but run a new shell if the subshell is not running.

[n] m Set the mark n.

[n] r Jump to the mark n.

C-f Jump to the next file.

C-b Jump to the previous file.

M-r Toggle the ruler.

It's possible to instruct the file viewer how to display a file, look at the Extension File Edit section

Internal File Editor The internal file editor provides most of the features of common full screen editors. It is invoked using F4 pro- vided the use_internal_edit option is set in the initial- ization file. It has an extensible file size limit of six- teen megabytes and edits binary files flawlessly.

The features it presently supports are: Block 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 search and replace); shift-arrow MSW-MAC text highlighting (for the linux console only); insert-overwrite toggle; and an option to pipe text blocks through shell commands like indent.

The editor is very easy to use and requires no tutoring. To see what keys do what, just consult the appropriate pull-down menu. Other keys are: Shift movement keys do text highlighting. Ctrl-Ins copies to the file cooledit.clip and Shift-Ins pastes from cooledit.clip. Shift-Del cuts to cooledit.clip, and Ctrl-Del deletes highlighted text. The completion key also does a Return with an automatic indent. Mouse highlighting also works,

�-*

and you can override the mouse as usual by holding down the shift key while dragging the mouse to let normal ter- minal mouse highlighting work.

To define a macro, press Ctrl-Rand then type out the key strokes you want to be exe-

cuted. Press Ctrl-Ragain when finished. You can then assign the macro to any

key you like by pressing that key. The macro is executed when you press Ctrl-A and then the assigned key. The macro is also executed if you press Meta, Ctrl, or Esc and the assigned key, provided that the key is not used for any other function. Once defined, the macro commands go into the file .cedit/cooledit.macros

in your home directory. You can delete a macro by delet- ing the appropriate line in this file.

F19 will format the currently highlighted block (plain text or C or C++ code or another). This is controlled by the file /usr/lib/mc/edit.indent.rc which is copied to .cedit/edit.indent.rc in your home directory the first time you use it.

You can use scanf search and replace to search and replace a C format string. First take a look at the sscanf and sprintf man pages to see what a format string is and how it works. An example is as follows: Suppose you want to replace all occurrences of say, an open bracket, three comma separated numbers, and a close bracket, with the word apples, the third number, the word oranges and then the second number, I would fill in the Replace dialog box as follows:

Enter search string (%d,%d,%d)

Enter replace string apples %d oranges %d

Enter replacement argument order 3,2

The last line specifies that the third and then the second number are to be used in place of the first and second.

It is advisable to use this feature with Prompt on replace on, because a match is thought to be found whenever the number of arguments found matches the number given, which is not always a real match. Scanf also treats whitespace as being elastic. Note that the scanf format % is very useful for scanning strings, and whitespace.

The editor also displays non-us characters (160+). When editing binary files, you should set display bits to 7 bits in the options menu to keep the spacing clean.

See also the file README.edit in the source tree for some more info.

Completion Let the Midnight Commander type for you.

Attempt to perform completion on the text before current position. MC attempts completion treating the text as variable (if the text begins with $ ), username (if the text begins with ~ ), hostname (if the text begins with @ ) or command (if you are on the command line in the posi- tion where you might type a command, possible completions

Page 86: Man Des Commandes Linux

�-�

then include shell reserved words and shell builtin com- mands as well) in turn. If none of these produces a match, filename completion is attempted.

Filename, username, variable and hostname completion works on all input lines, command completion is command line specific. If the completion is ambiguous (there are more different possibilities), MC beeps and the following action depends on the setting of the Complete: show all option in the Configuration dialog. If it is enabled, a list of all possibilities pops up next to the current position and you can select with the arrow keys and Enter the correct entry. You can also type the first letters in which the possibilities differ to move to a subset of all possibilities and complete as much as possible. If you press M-Tab again, only the subset will be shown in the listbox, otherwise the first item which matches all the previous characters will be highlighted. As soon as there is no ambiguity, dialog disappears, but you can hide it by canceling keys Esc, F10 and left and right arrow keys. If Complete: show all is disabled, the dialog pops up only if you press M-Tab for the second time, for the first time MC just beeps.

Virtual File System The Midnight Commander is provided with a code layer to access the file system; this code layer is known as the virtual file system switch. The virtual file system switch allows the Midnight Commander to manipulate files not located on the Unix file system.

Currently the Midnight Commander is packaged with some Virtual File Systems (VFS): the local file system, used for accessing the regular Unix file system; the ftpfs, used to manipulate files on remote systems with the FTP protocol; the tarfs, used to manipulate tar and compressed tar files; the undelfs, used to recover deleted files on 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- mander file system), a network based file system.

The VFS switch code will interpret all of the path names used and will forward them to the correct file system, the formats used for each one of the file systems is described later in their own section.

FTP File System The ftpfs allows you to manipulate files on remote machines, to actually use it, you may try to use the panel command FTP link (accessible from the menubar) or you may directly change your current directory to it using the cd command to a path name that looks like this:

/#ftp:[!][user[:pass]@]machine[:port][remote-dir]

The, user, port and remote-dir elements are optional. If you specify the user element, then the Midnight Commander will try to logon on the remote machine as that user, oth- erwise it will use your login name. The optional pass element, if present is the password used for the connec- tion. This use is not recommended (nor keeping this in your hotlist, unless you set the appropriate permissions there, and then, it may not be entirely safe anyways).

�-�

Examples:

/#ftp:ftp.nuclecu.unam.mx/linux/local /#ftp:tsx-11.mit.edu/pub/linux/packages /#ftp:!behind.firewall.edu/pub /#ftp:[email protected]:40/pub /#ftp:miguel:xxx@server/pub

To connect to sites behind a firewall, you will need to use the prefix ftp://! (ie, with a bang character after the double slash) to make the Midnight Commander use a proxy host for doing the ftp transfer. You can define the proxy host in the Virtual File System dialog box.

Another option to set is the Always use ftp proxy option in the Virtual File System dialog box. This will config- ure the program to always use the proxy host. If this variable is set, the program will do two things: consult the /usr/lib/mc/mc.no_proxy file for lines containing host names that are local (if the host name starts with a dot, it is assumed to be a domain) and to assume that any host- names without dots in their names are directly accessible.

If you are using the ftpfs code with a filtering packet router that does not allow you to use the regular mode of opening files, you may want to force the program to use the passive-open mode. To use this, set the ftpfs_use_passive_connections option in the initialization file.

The Midnight Commander keeps the directory listing in a cache. The cache expire time is configurable in the Vir- tual File System dialog box. This has the funny behavior that even if you make changes to a directory, they will not be reflected in the directory listing until you force a cache reload with the C-r key. This is a feature (when you think it's a bug, think about manipulating files on the other side of the Atlantic with ftpfs).

Tar File System The tar file system provides you with read-only access to your tar files and compressed tar files by using the chdir command. To change your directory to a tar file, you change your current directory to the tar file by using the following syntax:

/filename.tar:utar/[dir-inside-tar]

The mc.ext file already provides a shortcut for tar files, this means that usually you just point to a tar file and press return to enter into the tar file, see the Extension File Edit section for details on how this is done.

Examples:

mc-3.0.tar.gz#utar/mc-3.0/vfs /ftp/GCC/gcc-2.7.0.tar#utar

The latter specifies the full path of the tar archive.

FIle transfer over SHell filesystem The fish file system is a network based file system that allows you to manipulate the files in a remote machine as if they were local. To use this, the other side has to either run fish server, or has to have bash-compatible shell.

Page 87: Man Des Commandes Linux

�-�

To connect to a remote machine, you just need to chdir into a special directory which name is in the following format:

/#sh:[user@]machine[:options]/[remote-dir] The, user, options and remote-dir

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 login name.

The options are 'C' - use compression and 'rsh' use rsh instead of ssh. If the remote-dir element is present, your current directory on the remote machine will be set to this one.

Examples:

/#sh:onlyrsh.mx:r/linux/local /#sh:[email protected]:C/private /#sh:[email protected]/private

Network File System The Midnight Commander file system is a network base file system that allows you to manipulate the files in a remote machine as if they were local. To use this, the remote machine must be running the mcserv(8) server program.

To connect to a remote machine, you just need to chdir into a special directory which name is in the following format:

/#mc:[user@]machine[:port][remote-dir]

The, user, port and remote-dir elements are optional. If you specify the user element then the Midnight Commander will try to logon on the remote machine as that user, oth- erwise it will use your login name.

The port element is used when the remote machine running on a special port (see the mcserv(8) manual page for more information about ports); finally, if the remote-dir ele- ment is present, your current directory on the remote machine will be set to this one.

Examples:

/#mc:ftp.nuclecu.unam.mx/linux/local /#mc:[email protected]:11321/private

Undelete File System On Linux systems, if you asked configure to use the ext2fs undelete facilities, you will have the undelete file sys- tem available. Recovery of deleted files is only avail- able on ext2 file systems. The undelete file system is just an interface to the ext2fs library to: retrieve all of the deleted files names on an ext2fs and provides and to extract the selected files into a regular partition.

To use this file system, you have to chdir into the spe- cial file name formed by the "/#undel" prefix and the file name where the actual file system resides.

For example, to recover deleted files on the second parti-

�-!

tion of the first scsi disk on Linux, you would use the following path name:

/#undel:sda2

It may take a while for the undelfs to load the required information before you start browsing files there.

Colors The Midnight Commander will try to detect if your terminal supports color using the terminal database and your termi- nal name. Sometimes it gets confused, so you may force color mode or disable color mode using the -c and -b flag respectively.

If the program is compiled with the Slang screen manager instead of ncurses, it will also check the variable COL- ORTERM, if it is set, it has the same effect as the -c flag.

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 Commander from trying to detect if your terminal supports color. Example: [Colors] color_terminals=linux,xterm color_terminals=terminal-name1,terminal-name2...

The program can be compiled with both ncurses and slang, ncurses does not provide a way to force color mode: ncurses uses just the information in the terminal database.

The Midnight Commander provides a way to change the default colors. Currently the colors are configured using the environment variable MC_COLOR_TABLE or the Colors sec- tion in the initialization file.

In the Colors section, the default color map is loaded from the base_color variable. You can specify an alter- nate color map for a terminal by using the terminal name as the key in this section. Example:

[Colors] base_color= xterm=menu=magenta:marked=,magenta:markselect=,red

The format for the color definition is:

<keyword>=<foregroundcolor>,<backgroundcolor>:<keyword>= ...

The colors are optional, and the keywords are: normal, selected, marked, markselect, errors, input, reverse, gauge; Menu colors are: menu, menusel, menuhot, menuhot- sel; Dialog colors are: dnormal, dfocus, dhotnormal, dhotfocus; Help colors are: helpnormal, helpitalic, help- bold, helplink, helpslink; Viewer color is: viewunderline; Special highlighting colors are: executable, directory, link, device, special, core; Editor colors are: editnor- mal, editbold, editmarked.

input determines the color of input lines used in query dialogs.

gauge determines the color of the filled part of the

Page 88: Man Des Commandes Linux

�-�

progress bar (gauge), which shows how many percent of files were copied etc. in a graphical way.

The dialog boxes use the following colors: dnormal is used for the normal text, dfocus is the color used for the cur- rently selected component, dhotnormal is the color used to differentiate the hotkey color in normal components, whereas the dhotfocus color is used for the highlighted color in the currently selected component.

Menus use the same scheme but uses the menu, menusel, menuhot and menuhotsel tags instead.

Help uses the following colors: helpnormal is used for normal text, helpitalic is used for text which is empha- sized in italic in the manual page, helpbold is used for text which is emphasized in bold in the manual page, helplink is used for not selected hyperlinks and helpslink is used for selected hyperlink.

Special highlight colors determine how files are displayed when file highlighting is enabled (see the section on Lay- out). directory is used for directories or symbolic links to directories; executable for executable files; link is used for symbolic links which are neither stalled nor linked to a directory; stalledlink is used for stalled symbolic links; device - character and block devices; spe- cial is used for special files, such as FIFOs and IPC sockets; core is for core files.

The possible colors are: black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white. And there is a special keyword for transparent background. It is 'default'. The 'default' can only be used for background color. Example: [Colors] base_color=normal=white,default:marked=magenta,default

Special Settings Most of the settings of the Midnight Commander can be changed from the menus. However, there are a small number of settings which can only be changed by editing the setup file.

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

clear_before_exec.

By default the Midnight Commander clears the screen before executing a command. If you would prefer to see the output of the command at the bottom of the screen, edit your ~/mc.ini file and change the value of the field clear_before_exec to 0.

confirm_view_dir.

If you press F3 on a directory, normally MC enters that directory. If this flag is set to 1, then MC will ask for confirmation before changing the directory if you have files tagged.

ftpfs_retry_seconds.

This value is the number of seconds the Midnight Commander will wait before attempting a reconnec-

�-'

tion to an ftp server that has denied the login. If the value is zero, the the program will not retry the login.

ftpfs_use_passive_connections.

This option is by off default. This makes the ftpfs code use the passive open mode for transfer- ring files. This is used by people that are behind a filtering packet router. This option just works if you are not using an ftp proxy.

max_dirt_limit.

Specifies how many screen updates can be skipped at most in the internal file viewer. Normally this value is not significant, because the code automat- ically adjusts the number of updates to skip according to the rate of incoming keypresses. How- ever, on very slow machines or terminals with a fast keyboard auto repeat, a big value can make screen updates too jumpy.

It seems that setting max_dirt_limit to 10 causes the best behavior, and that is the default value.

mouse_move_pages.

Controls whenever scrolling with the mouse is done by pages or line by line on the panels.

mouse_move_pages_viewer.

Controls if scrolling with the mouse is done by pages or line by line on the internal file viewer.

old_esc_mode

By default the Midnight Commander treats the ESC key as a key prefix (old_esc_mode=0), if you set this option (old_esc_mode=1), then the ESC key will act as a prefix key for one second, and if no extra keys have arrived, then the ESC key is interpreted as a cancel key (ESC ESC).

only_leading_plus_minus

set special treatment for '+', '-', '*' in command line (select, unselect, reverse selection) only if command line is empty. No need to quote this char- acters in the middle of the command line. But we can not change selection when command line is not empty. panel_scroll_pages

If set (the default), panel will scroll by half the display when the cursor reaches the end or the beginning of the panel, otherwise it will just scroll a file at a time.

preserve_uidgid

If this option is set (the default), when logged in as root the default will be to preserve the UID and the GID of files. Some users prefer to disable this option, so that's why it's configurable.

Page 89: Man Des Commandes Linux

�--

show_output_starts_shell

This variable only works if you are not using the subshell support. When you use the C-o keystroke to go back to the user screen, if this one is set, you will get a fresh shell. Otherwise, pressing any key will bring you back to the Midnight Comman- der.

torben_fj_mode

If this flag is set, then the home and end keys will work slightly different on the panels, instead 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 below it; else go to the top line unless it is already on the top line, in this case it will go to the first file in the panel.

The end key has a similar behavior: Go down to the middle line, if over it; else go to the bottom line unless you already are at the bottom line, in such case it will move the selection to the last file name in the panel.

use_file_to_guess_type

If this variable is on (the default) it will spawn the file command to match the file types listed on the mc.ext file.

xterm_mode

If this variable is on (default is off) when you browse the file system on a Tree panel, it will automatically reload the other panel with the con- tents of the selected directory.

Terminal databases The Midnight Commander provides a way to fix your system terminal database without requiring root privileges. The Midnight Commander searches in the system initialization file (the mc.lib file located in the Midnight Commander library directory) and in the ~/.mc/ini file for the sec- tion "terminal:your-terminal-name" and then for the sec- tion "terminal:general", each line of the section contains a key symbol that you want to define, followed by an equal sign and the definition for the key. You can use the spe- cial \e form to represent the escape character and the ^x to represent the control-x character.

The possible key symbols are:

f0 to f20 Function keys f0-f20 bs backspace home home key end end key up up arrow key down down arrow key left left arrow key right right arrow key pgdn page down key pgup page up key insert the insert character

�-&

delete the delete character complete to do completion

For example, to define the key insert to be the Escape + [ + O + p, you set this in the ini file:

insert=\e[Op

The complete key symbol represents the escape sequences used to invoke the completion process, this is invoked with M-tab, but you can define other keys to do the same work (on those keyboard with tons of nice and unused keys everywhere).

FILES The program will retrieve all of its information relative to the MCHOME environment variable, if this variable is not set, then it will fall back to the /usr directory.

/usr/lib/mc/mc.hlp

The help file for the program.

/usr/lib/mc/mc.ext

The default system-wide extensions file.

~/.mc/ext

User's own extension, view configuration and edit configuration file. They override the contents of the system wide files if present.

/usr/lib/mc/mc.ini

The default system-wide setup for the Midnight Com- mander, used only if the user doesn't have his own ~/.mc/ini file.

/usr/lib/mc/mc.lib

Global settings for the Midnight Commander. Set- tings in this file affect all users, whether they have ~/.mc/ini or not, as long as ~/.mc/ini doesn't override them. Currently, only terminal settings are loaded from mc.lib.

~/.mc/ini

User's own setup. If this file is present then the setup is loaded from here instead of the system- wide startup file.

/usr/lib/mc/mc.hint

This file contains the hints (cookies) displayed by the program.

/usr/lib/mc/mc.menu

This file contains the default system-wide applica- tions menu.

~/.mc/menu

Page 90: Man Des Commandes Linux

�-0

User's own application menu. If this file is pre- sent it is used instead of the system-wide applica- tions menu.

~/.mc/Tree

The directory list for the directory tree and tree view features.

./.mc.menu

Local user-defined menu. If this file is present it is used instead of the home or system-wide applica- tions menu.

LICENSE This program is distributed under the terms of the GNU 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 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).

The Midnight Commander page on the World Wide Web: http://www.gnome.org/mc/

AUTHORS Miguel de Icaza ([email protected]), Janne Kukonlehto ([email protected]), Radek Doulik ([email protected]), Fred Leeflang ([email protected]), Dugan Porter ([email protected]), Jakub Jelinek (jj@sun- site.mff.cuni.cz), Ching Hui ([email protected]), Andrej Borsenkow ([email protected]), Norbert Warmuth ([email protected]), Mauricio Plaza (mok@rox- anne.nuclecu.unam.mx), Paul Sheer ([email protected]), Pavel Machek ([email protected]) and Pavel Roskin ([email protected]) are the developers of this package. Alessandro Rubini ([email protected]) has been espe- cially helpful debugging and enhancing the program's mouse support, John Davis ([email protected]) also made his S- Lang library available to us under the GPL and answered my questions about it, and the following people have con- tributed code and many bug fixes (in alphabetical order):

Adam Tla/lka ([email protected]), [email protected] (Alex I. Tkachenko), Antonio Palama, DOS port ([email protected]), Erwin van Eijk (wabbit@cor- ner.iaf.nl), Gerd Knorr ([email protected]), Jean- Daniel Luiset ([email protected]), Jon Stevens ([email protected]), Juan Francisco Grigera, Win32 port ([email protected]), Juan Jose Ciarlante (jjcia- [email protected]), Ilya Rybkin ([email protected]), Marcelo Roccasalva (mfroc- [email protected]), Massimo Fontanelli ([email protected]), Sergey Ya. Korshunoff ([email protected]), Thomas Pundt ([email protected] ster.de), Timur Bakeyev ([email protected]),

�&*

Tomasz Cholewo ([email protected]), Torben Fjerdingstad ([email protected]), Vadim Sinoli- tis ([email protected]) and Wim Osterholt ([email protected]).

BUGS See the file TODO in the distribution for information on what remains to be done.

If you want to report a problem with the program, please send mail to this address: [email protected].

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 and if the program crashes, we would appreciate a stack trace.

30 October 1998 mc(1)

&-� ����� &-� �����

NAME mcedit - Full featured terminal text editor for Unix-like systems.

USAGE mcedit [[+number] file [-bcCdfhstVx?]]

DESCRIPTION Mcedit is a link to mc, the Midnight Commander, forcing it to immediately start its internal editor. The editor is a terminal version of the cooledit standalone X Window edi- tor.

OPTIONS +number

Go to the line specified by number (do not insert a space between the "+" sign and the number).

-b Forces black and white display.

-c Force color mode on terminals where mcedit defaults to black and white.

-C <keyword>=<FGcolor>,<BGcolor>:<keyword>= ... Used to specify a different color set, where key- word is one of normal, selected, marked, markse- lect, errors, reverse menu, menusel, menuhot, menuhotsel and gauge. The colors are optional and are one of black, gray, red, brightred, green, brightgreen, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan, brightcyan, lightgray and white. See the Colors section in mc.1 for more information.

-d Disables mouse support.

Page 91: Man Des Commandes Linux

�&�

-f Displays the compiled-in search paths for Midnight Commander files.

-t Used only if the code was compiled with Slang and terminfo: it makes the Midnight Commander use the value of the TERMCAP variable for the terminal information instead of the information on the sys- tem wide terminal database

-V Displays the version of the program.

-x Forces xterm mode. Used when running on xterm- capable terminals (two screen modes, and able to send mouse escape sequences).

Features The internal file editor provides most of the features of common full screen editors. It has an extensible file size limit of sixteen megabytes and edits binary files flaw- lessly. The features it presently supports are: Block 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 search and replace); shift-arrow MSW-MAC text highlighting (for the linux console only); insert-overwrite toggle; word-wrap; a variety of tabbing options; syntax highlight- ing for various file types; and an option to pipe text blocks through shell commands like indent and ispell.

Keys The editor is very easy to use and requires no tutoring. To see what keys do what, just consult the appropriate pull-down menu. Other keys are: Shift movement keys do text highlighting (Linux console only). Ctrl-Ins copies to the file ~/.cedit/cooledit.clip, and Shift-Ins pastes from ~/.cedit/cooledit.clip. Shift-Del cuts to ~/.cedit/cooledit.clip, and Ctrl-Del deletes highlighted text - all linux console only. The completion key (see mc.1) also does a hard return without an automatic indent. Mouse highlighting also works, and you can override the mouse as usual by holding down the shift key while drag- ging the mouse to let normal terminal mouse highlighting work.

To define a macro, press Ctrl-R and then type out the key strokes you want to be executed. Press Ctrl-R again when finished. You can then assign the macro to any key you like by pressing that key. The macro is executed when you press Ctrl-A and then the assigned key. The macro is also executed if you press Meta, Ctrl, or Esc and the assigned key, provided that the key is not used for any other func- tion. Once defined, the macro commands go into the file ~/.cedit/cooledit.macros. Do NOT edit this file unless you are not going to use macros again in the same editing session, because Mcedit caches macro key defines in mem- ory. Mcedit now overwrites a macro if a macro with the same key already exists, so you won't have to edit this file. You will also have to restart other running editors for macros to take effect.

F19 will format C code when it is highlighted. For this to work, make an executable file called .cedit/edit.indent.rc in your home directory containing the following:

�&�

#!/bin/sh # Use $HOME instead of ~ if this doesn't work. # You may also have to use a different redirection # syntax for some machines. /usr/bin/indent -kr -pcs ~/.cedit/cooledit.block >& /dev/null cat /dev/null > ~/.cedit/cooledit.error

C-p will run ispell on a block of text in a similar way. The file is .cedit/edit.spell.rc

#!/bin/sh # Use $HOME instead of ~ if this doesn't work. # You may also have to use a different redirection # syntax for some machines. /usr/local/bin/ispell ~/.cedit/cooledit.block >& /dev/null cat /dev/null > ~/.cedit/cooledit.error

Redefining Keys Keys may be redefined from the Midnight Commander options menu.

SYNTAX HIGHLIGHTING As of version 3.6.0, cooledit has syntax highlighting. This means that keywords and contexts (like C comments, string constants, etc) are highlighted in different colours. The following section explains the format of the file ~/.cedit/syntax.

The file ~/.cedit/syntax is rescanned on opening of a any new editor file. The file contains rules for highlighting, each of which is given on a separate line, and define which keywords will be highlighted to what colour. The file is also divided into sections, each beginning with a line with the file command, followed by a regular expres- sion. The regular expression dictates the file name that that set of rules applies to. Following this is a descrip- tion to be printed on the left of the editor window explaining the file type to the user. A third optional argument is a regular expression to match the first line of text of the file. If either the file name matches, or the first line of text, then those rules will be loaded.

A section ends with the start of a new section. Each sec- tion is divided into contexts, and each context contains rules. A context is a scope within the text that a partic- ular set of rules belongs to. For instance, the region within a C style comment (i.e. between /* and */) has its own colour. This is a context, although it will have no further rules inside it because there is probably nothing that we want highlighted within a C comment.

A trivial C programming section might look like this:

file .\*\\.c C\sProgram\sFile (#include|/\\\*)

wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_

# default colors context default

keyword whole if 24 keyword whole else 24 keyword whole for 24 keyword whole while 24 keyword whole do 24 keyword whole switch 24

Page 92: Man Des Commandes Linux

�&�

keyword whole case 24 keyword whole static 24 keyword whole extern 24 keyword { 14 keyword } 14 keyword '*' 6

# C comments context /\* \*/ 22

# C preprocessor directives context linestart # \n 18

keyword \\\n 24

# C string constants context " " 6

keyword %d 24 keyword %s 24 keyword %c 24 keyword \\" 24

Each context starts with a line of the form: context [exclusive] [whole|wholeright|wholeleft] [lines- tart] delim [linestart] delim [foreground] [background]

One exception is the first context. It must start with the command context default [foreground] [background] or else cooledit will return an error.

The linestart option dictates that delim must start at the beginning of a line.

The whole option tells that delim must be a whole word. What constitutes a whole word are a set of characters that can be changed at any point in the file with the wholechars command. The wholechars command at the top just 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- larly on the right. The left and right set of characters can be set separately with, wholechars [left|right] characters

The exclusive option causes the text between the delim- iters to be highlighted, but not the delimiters them- selves.

Each rule is a line of the form: keyword [whole|wholeright|wholeleft] [linestart] string foreground [background]

Context or keyword strings are interpreted so that you can include tabs and spaces with the sequences \t and \s. New- lines and the \ are specified with \n and \\ respectively. Since whitespace is used as a separator, it may not be used explicitedly. Also, \* must be used to specify a *. The * itself is a wildcard that matches any length of characters. For example,

keyword '*' 6 colours all C single character constants green. You could also have used

keyword "*" 6 to colour string constants, except that the matched string may not cross newlines. The wildcard may be used within context delimiters as well, but you cannot have a wildcard as the last or first character.

�&!

Important to note is the line keyword \\\n 24

This line defines a keyword containing the \ and newline characters. Because keywords have a higher precedence than context delimiters, this keyword prevents the context from ending at the end of a line if the line ends in a \ thus allowing C preprocessor directive to continue across multiple lines.

The colours themselves are numbered 0 to 26 and are explained below in FURTHER BEHAVIORAL OPTIONS. You can also use any of the named colors specified in /usr/lib/X11/rgb.txt, though only one word versions of them. It is better to stick to the numerical colors to limit use of the color palette.

Comments may be included on a line of there own and begin with a #.

Because of the simplicity of the implementation, there are a few intricacies that will not be coped with correctly but these are a minor irritation. On the whole, a broad spectrum of quite complicated situations are handled with these simple rules. It is a good idea to take a look at the syntax file to see some of the nifty tricks you can do with a little imagination. If you can't get by with the rules I have coded, and you think you have a rule that would be useful, please email me with your request. How- ever, do not ask for regular expression support, because this is flatly impossible.

A useful hint is to work with as much as possible with the things you can do rather than try to do things that this implementation can't cope with. Also remember that the aim of syntax highlighting is to make programming less prone to error, not to make code look pretty.

COLORS The default colors may be changed by appending to the MC_COLOR_TABLE environment variable. Foreground and back- ground colors pairs may be specified for example with:

MC_COLOR_TABLE="$MC_COLOR_TABLE:editnormal=lightgray,black:editbold=yellow,black:editmarked=black,cyan"

OPTIONS Most options can now be set from the editors options dia- log box. See the Options menu. The following options are defined in You can modify them to change the editor behav- ior, by editing the file. Unless specified, a 1 sets the option to on, and a 0 sets it to off, as is usual.

use_internal_edit This option is ignored when invoking mcedit.

editor_key_emulation 1 for Emacs keys, and 0 for normal Cooledit keys.

editor_tab_spacing Interpret the tab character as being of this length. Default is 8. You should avoid using other than 8 since most other editors and text viewers assume a tab spacing of 8. Use edi-

Page 93: Man Des Commandes Linux

�&�

tor_fake_half_tabs to simulate a smaller tab spac- ing.

editor_fill_tabs_with_spaces Never insert a tab space. Rather insert spaces (ascii 20h) to fill to the desired tab size.

editor_return_does_auto_indent Pressing return will tab across to match the inden- tation of the first line above that has text on it.

editor_backspace_through_tabs Make a single backspace delete all the space to the left margin if there is no text between the cursor and the left margin.

editor_fake_half_tabs This will emulate a half tab for those who want to program with a tab spacing of 4, but do not want 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 space were 4, while actually using spaces and normal tabs for an optimal fill. When editing any- where else, a normal tab is inserted.

editor_option_save_mode (0, 1 or 2.) The save mode (see the options menu also) allows you to change the method of saving a file. Quick save (0) saves the file by immediately, truncating the disk file to zero length (i.e. eras- ing it) and the writing the editor contents to the file. This method is fast, but dangerous, since a system error during a file save will leave the file only partially written, possibly rendering the data irretrievable. When saving, the safe save (1) option enables creation of a temporary file into which the file contents are first written. In the event of an problem, the original file is untouched. When the temporary file is successfully written, it is renamed to the name of the original file, thus replacing it. The safest method is cre- ate backups (2). Where a backup file is created before any changes are made. You can specify your own backup file extension in the dialog. Note that saving twice will replace your backup as well as your original file.

Miscellaneous (Scanf search and replace have previously not worked prop- erly. With this release, problems with search and replace have been fixed.)

You can use scanf search and replace to search and replace a C format string. First take a look at the sscanf and sprintf man pages to see what a format string is and how it works. An example is as follows: Suppose you want to replace all occurrences of say, an open bracket, three comma separated numbers, and a close bracket, with the word apples, the third number, the word oranges and then the second number, you would fill in the Replace dialog box as follows:

Enter search string (%d,%d,%d)

�&'

Enter replace string apples %d oranges %d Enter replacement argument order 3,2

The last line specifies that the third and then the second number are to be used in place of the first and second.

It is advisable to use this feature with Prompt On Replace on, because a match is thought to be found whenever the number of arguments found matches the number given, which is not always a real match. Scanf also treats whitespace as being elastic. Note that the scanf format %[ is very useful for scanning strings, and whitespace.

The editor also displays non-us characters (160+). When editing binary files, you should set display bits to 7 bits in the Midnight Commander options menu to keep the spacing clean.

FILES /usr/mc.hlp

The help file for the program.

/usr/lib/mc/mc.ini

The default system-wide setup for the Midnight Com- mander, used only if the user lacks his own ~/.mc.ini file.

/usr/lib/mc/mc.lib

Global settings for the Midnight Commander. Set- tings in this file are global to any Midnight Com- mander, it is useful to define site-global terminal settings.

$HOME/.mc.ini

User's own setup. If this file is present then the setup is loaded from here instead of the system- wide startup file.

$HOME/.cedit/

User's own temporary directory where block commands are processed and saved.

LICENSE This program is distributed under the terms of the GNU General Public License as published by the Free Software Foundation. See the built-in help of the Midnight Comman- der for details on the License and the lack of warranty.

AVAILABILITY 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 cooledit(1), mc(1), gpm(1), terminfo(1), scanf(3).

Page 94: Man Des Commandes Linux

�&-

AUTHORS Paul Sheer ([email protected]) is the developer of the Midnight Commander's internal editor.

BUGS See the file README.edit in the distribution for more information.

30 January 1997 mcedit(1)

�%(���� ������� ����������������� ���%(����

NOM mesg - Commander l'accès en écriture sur votre terminal.

SYNOPSIS mesg [y|n]

DESCRIPTION Mesg contrôle l'accès à votre terminal par d'autres per- sonnes. Son utilisation typique est de permettre ou d'interdire aux autres utilisateurs d'écrire sur votre terminal (voir write(1)).

OPTIONS y Permet l'accès en écriture à votre terminal.

n Interdit l'accès en écriture à votre terminal.

si aucune option n'est donnée, mesg affiche l'état d'accès courant de votre terminal.

AUTEUR Miquel van Smoorenburg ([email protected])

VOIR AUSSI talk(1), write(1), wall(1)

TRADUCTION Frédéric Delanoy, 2000.

Linux 7 Août 2000 MESG(1)

�� �%��0�"� ������ ����� &�������������������� �%��0�"�

NOM mingetty - Getty minimal pour la console.

SYNOPSIS mingetty [--noclear] [--long-hostname] tty

�&&

DESCRIPTION mingetty est un getty minimal pour l'utilisation des con- soles virtuelles. Contrairement à agetty(8), mingetty n'est pas utilisable pour les lignes série. Pour cette utilisation précise, je recommande mgetty(8).

OPTIONS --noclear

N'efface pas l'écran avant d'afficher l'invite de login (l'écran est effacé par défaut).

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

SEQUENCES D'ECHAPPEMENT mingetty reconnaît les séquences d'échappement qui peuvent être employées dans le fichier /etc/issue :

\d insère le jour courant (localtime),

\l insère la ligne série sur laquelle mingetty tourne,

\m insère le type d'architecture machine (uname -m),

\n insère le nom d'hôte de la machine sur le réseau (uname -n),

\o insère le nom de domaine,

\r insère le numéro de version du système d'exploita- tion (uname -r),

\t insère l'heure courante (localtime),

\s insère le nom du système d'exploitation,

\u resp. le nombre d'utilisateurs déjà connectés. \U insère "n users", alors que \u insère seulement "n".

\v insère la version (date) du système d'exploitation (uname -v).

EXEMPLE "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"

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

VOIR AUSSI mgetty(8), agetty(8).

AUTEUR Copyright (C) 1996 Florian La Roche <[email protected]> ou

Page 95: Man Des Commandes Linux

�&0

<[email protected]>. Page man écrite par David Frey <[email protected]> et Florian La Roche.

TRADUCTION Guillaume Allègre <[email protected]>, Jan- vier 1999

Debian 5 Mai 1999 MINGETTY(8)

��#������ ������� ����������������� ��#������

NOM mkdir - Créer des répertoires.

SYNOPSIS mkdir [-p] [-m mode] [--parents] [--mode=mode] [--help] [--version] rep...

DESCRIPTION Cette page de manuel documente la version GNU mkdir.

mkdir crée un répertoire correspondant à chacun des noms mentionnés.

Par défaut, les répertoires sont créés avec les permis- sions d'accès 0777 moins les bits positionnés dans le umask.

OPTIONS -m, --mode mode

Créer les répertoires avec le mode d'accès indiqué. Celui-ci est donné sous forme symbolique, comme dans chmod(1), en utilisant le mode par défaut comme valeur de départ.

-p, --parents S'assurer que chaque répertoire indiqué existe. Créer les répertoires parents manquants. Ces derniers sont créés avec l'autorisation d'accès umask modifiée par `u+wx'. Ne pas considérer les répertoires déjà existants comme des erreurs.

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

TRADUCTION Christophe Blaess, 1997.

FSF 20 Decembre 1996 MKDIR(1L)

�0*

��!(�"� ������ ����� &������������� ����!(�"�

NOM mkfs - Créér un système de fichiers Linux.

SYNOPSIS mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ nb_blocs ]

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.

Le code de retour retourné par mkfs est 0 en cas de succès et 1 en cas d'échec.

En fait, mkfs est simplement une interface pour les divers formatteurs de système de fichiers. (mkfs.type_de_fs) disponibles sous Linux. Le formateur du système de fichier voulu est recherché dans un certain nombre de répertoires (/sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc) (la liste exacte est définie au moment de la compilation mais contient au moins /sbin et /sbin/fs), puis en cas d'échec dans les répertoires listés par la variable d'environnement PATH. Veuillez consulter la page de manuel spécifique au système de fichier désiré pour plus de détails.

OPTIONS -V Génère plus de messages, notamment toutes les com-

mandes exécutées. Indiquer cette option plusieurs fois inhibibe l'éxécution de toute commande spécifique au système de fichiers. Ceci n'est utile que pour faire des tests.

-t fstype Indique le type de système de fichiers à formater. S'il n'est pas indiqué, le type est déduit de la ligne correspondante du fichier /etc/fstab. Sinon le format par défaut (ext2) est utilisé.

fs-options Options spécifiques au système de fichiers employé à passer au "vrai" formateur. La plupart des options suivantes sont supportés par la majorité des formatteurs de système de fichiers. Attention, il peut y avoir des exceptions.

-c Vérifie le périphérique pour éliminer les secteurs défectueux avant de formater le système de fichiers.

-l nom_de_fichier Lit la liste des secteurs défectueux depuis le nom_de_fichier

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

BOGUES Toutes les options génériques doivent précéder et ne pas

Page 96: Man Des Commandes Linux

�0�

être mélangées avec les options spécifiques au système de fichiers. Certains formateurs ne reconnaissent pas l'option -v (mode volubile), ou retournent un code d'erreur incompréhensible. De plus, certains programmes spécifiques à un système de fichiers ne peuvent détecter la taille du périphérique et nécessitent le passage du paramètre blocks .

AUTEURS David Engel ([email protected]) Fred N. van Kempen ([email protected]) Ron Sommeling ([email protected]) Cette page de manuel est une simple adaptation de celle de Remy Card (le concepteur du système de fichier étendu 2, le standard de facto sous Linux).

VOIR AUSSI fsck(8), mkfs.minix(8), mkfs.ext(8), mkfs.ext2(8), mkfs.xiafs(8).

Note du traducteur Il est possible de formater un fichier comme s'il s'agis- sait d'un périphérique. Il faudra alors passer outre aux protestations de mkfs. Le principal usage de cette option est de pouvoir formater un périphérique loopback.

TRADUCTION Thierry Vignaud <[email protected]>, 1999.

Linux 19 Mars 1999 MKFS(8)

�� �#���������� ����������������� ��� �#���

NOM mknod - Créer des fichiers spéciaux.

SYNOPSIS mknod [options] nom {bcu} numéro_majeur numéro_mineur mknod [options] nom p Options: [-m mode] [--mode=mode] [--help] [--version]

DESCRIPTION mknod crée une FIFO, un fichier spécial en mode caractère, ou un fichier spécial en mode bloc, avec le nom indiqué.

Un fichier spécial est un ensemble de trois valeurs (une booléenne, et deux entiers) enregistré dans un système de fichiers. La valeur booléenne indique s'il s'agit d'un fichier caractères ou blocs, et les deux entiers corre- spondent aux numéros majeur et mineur.

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. 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�

Les fichiers en mode bloc sont des périphériques comme des disques (où les données sont accessibles à travers un numéro de bloc, et où il est intéressant d'avoir une mémoire cache par bloc). Tous les autres périphériques sont en mode caractère. Autrefois la distinction se fai- sait autrement, les entrées/sorties en mode bloc étaient bufferisées, pas les autres.

Les arguments fournis à la suite du nom indiquent le type de fichier à créer :

p pour une FIFO

b pour un fichier spécial en mode bloc (avec buffer)

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

Lorsque l'on crée un fichier spécial bloc ou caractère, les numéros majeur et mineur correspondant au périphérique doivent être précisés après le type de fichier, en décimal, en octal commençant par 0, ou (version GNU seule- ment) en héxa-décimal précédé de 0x.

OPTIONS -m, --mode mode

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

CONFORMITÉ POSIX ne décrit pas cette commande, considérée comme non portable, et recommende d'utiliser plutôt mkfifo(1) pour créer des FIFOs. SVID dispose d'une commande /etc/mknod ayant la même syntaxe mais sans l'option mode.

NOTES Sur un système Linux (1.3.22 ou plus récent) le fichier /usr/src/linux/Documentation/devices.tex contient une liste des noms de périphériques, avec le type, et les numéros majeurs et mineurs.

VOIR AUSSI chmod(1), mkfifo(1), mknod(2).

TRADUCTION Christophe Blaess, 1997.

FSF 15 Décembre 1998 MKNOD(1)

Page 97: Man Des Commandes Linux

�0�

���%��� ������� ����������������� �����%���

NOM more - Filtre lecteur de fichier.

SYNOPSIS more [-dlfpcsu] [-num] [+/ motif] [+ numligne]

[fichier ...]

DESCRIPTION More est un filtre permettant de se déplacer dans un texte écran par écran. Cette version est particulierement prim- itive. Les utilisateurs doivent se convaincre que less(1) constitue une excellente émulation avec de nombreuses améliorations.

OPTIONS Les options sur la ligne de commande sont décrites ci- dessous. La variable d'environnement MORE peut contenir des options supplémentaires (précédées par un tiret (``-'')) mais les options sur la ligne de commande ont priorité.

-num num est un nombre entier indiquant la taille en lignes de l'ecran.

-d more affiche le message "[Press space to continue, 'q' to quit.]" pour défiler et le messaqe "[Press 'h' for instructions.]" au lieu d'émettre un beep quand on appuie sur une touche interdite.

-l Normalement more considère que ^L (form feed) est un caractère spécial et attend après chaque ligne contenant un form feed. L'option -l supprime ce comportement.

-f provoque un comptage logique des lignes, c'est à dire que les lignes longues ne sont pas découpées.

-p Ne pas dérouler: efface l'ecran avant d'afficher le texte.

-c Ne pas dérouler: affiche les lignes en partant du haut et en effacant les fins de ligne au fur et à mesure.

-s Regroupe les lignes blanches consécutives en une seule.

-u Supprime le soulignement.

+/ L'option +/ indique un texte à rechercher dans chaque fichier avant de l'afficher.

+num Commence à la ligne indiquée.

COMMANDES more reconnait un jeu de commandes interactives basé sur celui de vi(1). Certaines commandes peuvent être précédées d'un nombre décimal noté k ci-dessous. ^X signi- fie control-X.

h ou ? Aide: affiche un résumé des commandes. Si vous les

�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.

z Affiche les k lignes suivantes. Par défaut k est la taille de l'écran mais l'argument fourni devient la nouvelle valeur par défaut.

RETURN Affiche les k lignes suivantes. Par défaut k vaut 1 mais l'argument fourni devient la nouvelle valeur par défaut.

d ou ^D Déroule k lignes. la valeur par défaut vaut ini- tialement 11 mais l'argument fourni devient la nou- velle valeur par défaut.

q ou Q ou INTERRUPT Arrêt.

s Saute k lignes. Par défaut, saute une ligne.

f Saute k écrans. Par defaut, saute un écran.

b ou ^B Recule de k ecrans. Par défaut, recule d'un écran.

' Retourne au point de départ de la dernière recherche.

= Affiche le numéro de ligne courant.

/motif Recherche la k-ième occurrence d'une expression régulière. Par défaut k vaut 1.

n Recherche la k-ième occurrence de la dernière expression régulière. Par défaut k vaut 1.

!<cmd> ou :!<cmd> Exécute <cmd> dans un sous-shell.

v Lance /usr/bin/vi sur la ligne courante.

^L Réaffiche l'ecran

:n Passe au k-ième fichier suivant. Par défaut k=1.

:p Passe au k-ième fichier précédent. Par défaut k=1.

:f Affiche le nom et le numéro de ligne du fichier courant.

. Répète la commande précédente.

ENVIRONMENT More utilise les variables d'environnement suivantes quand elles existent:

MORE Cette variable contient les options préférées pour more.

SHELL Shell courant (normalement positionné par le shell au login).

TERM Spécifie le type de terminal; utilisé par more pour

Page 98: Man Des Commandes Linux

�0�

connaître les codes de contrôle de l'écran.

VOIR AUSSI vi(1) less(1)

AUTEURS Eric Shienbrood, UC Berkeley Modifié par Geoff Peck, UCB pour ajouter le soulignement et l'espacement simple. Modifié par John Foderaro, UCB pour ajouter -c et la ges- tion de la variable d'environnement MORE.

HISTORIQUE La commande more est apparue dans BSD 3.0. Cette page documente la version 5.19 (Berkeley 6/29/88), qui est celle actuellement utilisée par la communauté Linux. Cette documentation a été constituée en utilisant les pages de manuel de plusieurs autres versions et après un examen exhaustif du code source.

TRADUCTION Michel Quercia, 1997.

Linux 0.98 10 Juin 1997 MORE(1)

��' ��"� ������ ����� &������������� ���' ��"�

NOM mount - Monter un système de fichiers.

SYNOPSIS mount [-hV]

mount -a [-fnrvw] [-t type] mount [-fnrvw] [-o options [,...]] périph | rép mount [-fnrvw] [-t type] [-o options] périph rép

DESCRIPTION Tout fichier accessible par un système Unix est inséré dans une grande arborescence, la hiérarchie des fichiers, commençant à la racine /. Ces fichiers peuvent résider sur différents périphériques. La commande mount permet d'attacher un système de fichiers trouvé sur un périphérique quelconque à la grande arborescence du système. A l'inverse umount(8) le détachera à nouveau.

La forme standard de la commande mount est mount -t type périphérique répertoire

Ceci indique au noyau d'attacher le système de fichiers se trouvant sur le périphérique mentionné (dont on précise le type) dans le répertoire indiqué. Le contenu précédent du répertoire (s'il n'était pas vide), ainsi que son pro- priétaire et ses modes d'accès initiaux deviennent invisi- bles tant que le nouveau système de fichiers reste monté.

Le chemin d'accès du répertoire représente alors la racine 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é

�0'

quoique ce soit : mount -h

affiche un message d'aide mount -V

affiche un numéro de version mount [-t type]

fournit la liste des systèmes de fichiers actuellement montés (éventuellement ceux du type indiqué uniquement) - voir plus bas.

Le système de fichiers proc n'est associé à aucun périphérique, et lorsqu'on le monte, un mot quelconque, par exemple proc peut être utilise à la place de l'indica- tion de périphérique. Le choix parfois rencontre none (aucun) n'est pas très heureux, car un message d'erreur `none busy' (aucun occupé) lors d'un umount peut être mal interprété.

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, dans le cas d'un montage par NFS, périphérique peut 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 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.

(ii) Lorsque l'on monte un système de fichiers mentionné dans la fstab, il suffit d'indiquer le point de montage, ou le périphérique.

(iii) Normalement, seul le Super-Utilisateur peut monter des systèmes de fichiers. Néanmoins, si la ligne de la fstab contient l'option user, n'importe quel utilisateur peut monter le système de fichiers correspondant.

Ainsi, avec une ligne /dev/cdrom /cd iso9660 ro,user,noauto,unhide

dans la fstab, n'importe quel utilisateur peut monter le système iso9660 se trouvant sur son CDROM en utilisant la commande

mount /dev/cdrom ou

mount /cd Pour plus de details, voir fstab(5).

Les programmes mount et umount maintiennent une liste des périphériques actuellement montés dans le fichier /etc/mtab. Si mount est invoqué sans arguments, cette liste est affichée. Quand le système proc est monté (dis- ons sur /proc), les fichiers /etc/mtab et /proc/mounts sont très semblables. Le premier contient un peu plus d'informations, par exemple les options de montage, mais n'est pas obligatoirement à jour. (cf l'option -n plus bas).

OPTIONS

Page 99: Man Des Commandes Linux

�0-

L'ensemble exact des options utilisées lors d'une invoca- tion de mount est déterminé d'abord en lisant les options de la table fstab pour ce système de fichiers, puis en appliquant les options précisées par l'argument -o, et finalement en appliquant les options -r ou -w si elles sont mentionnées.

Les options valides pour la commande mount sont :

-v Mode volubile.

-f Fonctionnement normal sauf pour l'appel système final qui n'est pas exécuté. Ceci simule le montage du système de fichiers. Cette option, en conjonc- tion avec -v permet de déterminer ce que la com- mande mount essaye de faire.

-n Montage sans écriture dans /etc/mtab. Ceci est nécessaire dans le cas où /etc réside sur un système de fichiers en lecture seule.

-r Montage du système de fichiers en lecture seule. Un synonyme est -o ro.

-w Montage du système de fichiers en lecture/écriture. Il s'agit de l'option par défaut. Un synonyme en est -o rw.

-t type L'argument à la suite de -t est utilise pour préciser le type de système de fichier. Les types actuellement suppportés sont mentionnés dans linux/fs/filesystems.c: minix, ext, ext2, xiafs, hpfs, fat, msdos, umsdos, vfat, proc, nfs, iso9660, smb, ncp, affs, ufs, sysv, xenix, coherent. Notez que les 3 derniers sont équivalents, et que xenix et coherent disparaîtront dans l'avenir -- utilisez sysv à leur place.

Le type par défaut est iso9660. Si aucune option -t n'est mentionnée, ou si le type auto est précisé, la recherche de type est effectuée sur le superblock (minix, ext, ext2, xia, iso9660 sont supportés). Si cette recherche échoue, et si /proc/filesystems existe, alors tous les types de systèmes de fichiers listés seront essayés, sauf ceux marqués "nodev" (par exemple proc et nfs).

Le type auto peut être utile pour des disquettes montées par l'utilisateur. Attention la détection s'appuie sur une heuristique (la présence de nom- bres "magiques" précis) qui peut conduire à une mauvaise reconnaissance.

On peut indiquer plusieurs types, séparés par des virgules. Une liste de systèmes peut également être préfixée par no pour indiquer les types qu'il ne faut pas tester. (Ceci prend son sens avec l'option -a).

Par exemple, la commande : mount -a -t nomsdos,ext

monte tous les systèmes de fichiers, à l'exception de ceux de type msdos et ext.

-o Les options de montage sont indiquées par l'argu- ment -o suivi d'une liste d'options séparées par

�0&

des virgules. Certaines d'entre-elles ne sont utiles que lorqu'elles apparaissent dans le fichier /etc/fstab Les options suivantes sont communes au montage de tous les systèmes de fichiers :

async Toutes les entrées/sorties sur le système de fichiers seront asynchrones.

auto Peut être monté par l'argument -a.

defaults Utilisation des options par défaut : rw, suid, dev, exec, auto, nouser, et async.

dev Interpréter les fichiers spéciaux de périphériques présents sur le système de fichiers.

exec Permettre l'exécution de fichiers binaires.

noauto Ne peut être monté qu'explicitement (l'invo- cation de mount avec l'argument -a ne mon- tera pas le système de fichiers).

nodev Ne pas interpréter les fichiers spéciaux de périphériques présents sur le système de fichiers.

noexec Ne pas permettre l'exécution de fichiers binaires sur le système de fichiers monté. Ceci peut être utile sur un serveur qui con- tient des fichiers binaires pour des archi- tectures autres que la sienne.

nosuid Ne pas tenir compte des bits Set-UID ou Set- GID.

nouser Ne pas autoriser d'utilisateur ordinaire (non root) à monter le système de fichiers. C'est le comportement par défaut.

remount Remonter un système de fichiers déjà monté. Ceci est utilisé pour changer les attributs de montage, principalement pour autoriser l'écriture sur un système en lecture seule.

ro Montage du système en lecture seule.

rw Montage du système en lecture/écriture.

suid Prendre en compte les bits Set-UID ou Set- GID des fichiers se trouvant sur le système monté.

sync Toutes les entrées/sorties sur le système de fichiers seront synchrones.

user Autoriser les utilisateurs ordinaires (non root) à monter le système de fichiers. Ceci entraîne l'utilisation des options noexec, nosuid, et nodev (à moins qu'elles ne soient explicitement surchargées, comme dans une ligne d'option user,exec,dev,suid).

OPTIONS DE MONTAGE SPÉCIFIQUES

Page 100: Man Des Commandes Linux

�00

Les options suivantes ne s'appliquent qu'à certains 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 affs uid=value et gid=value

Positionner le propriétaire et le groupe de la racine du système de fichiers (par défaut : uid=gid=0, mais avec l'option uid ou gid sans valeur, l'uid et le gid du processus appelant seront utilisés).

setuid=value et setgid=value Positionner le propriétaire et le groupe de tous les fichiers du système.

mode=valeur Fixer le mode d'accès à tous les fichiers au mode valeur & 0777 sans s'occuper de leurs permissions originales. Ceci ajoute également l'autorisation de parcours dans les répertoires qui permettent la lecture. La valeur doit être mentionnée en octal.

protect N'autoriser aucune modification des bits d'accès aux fichiers du système.

usemp Utiliser l'uid et le gid du point de montage comme uid et gid de la racine du système de fichiers jusqu'au premier sync ou umount, puis ignorer cette option. Bizarre...

verbose Afficher des informations supplémentaires pour chaque montage réussi.

prefix=chaîne Préfixe à utiliser avant le nom de volume lorsque l'on suit un lien.

volume=chaîne Préfixe (30 caractères au plus) à utiliser '/' lorsque l'on suit un lien symbolique.

reserved=valeur (Par défaut : 2.) Nombre de blocs inutilisés au début du périphérique.

root=valeur Fournir explicitement l'emplacement du bloc racine.

bs=valeur Fournir la taille de bloc. Les valeurs autorisées sont 512, 1024, 2048, et 4096.

grpquota / noquota / quota / usrquota Ces options sont acceptées mais sans effet.

Options de montage pour coherent Aucune.

Options de montage pour ext Aucune. Notez que le type `ext' de système de fichiers

�**

est obsolète. Ne l'utilisez pas.

Options de montage pour ext2 `ext2' est le type standard pour les systèmes de fichiers Linux.

bsddf / minixdf Indiquer le comportement à adopter lors de l'appel système statfs. Le comportement minixdf consiste à renvoyer dans le champ f_blocks le nombre total de blocs dans le système de fichiers, alors que le comportement bsddf (par défaut) consiste à sous- traire les blocs utilisés par le système ext2 non disponibles pour le stockage. Ainsi on obtient :

% mount /k -o minixdf; df /k; umount /k Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sda6 2630655 86954 2412169 3% /k % mount /k -o bsddf; df /k; umount /k Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sda6 2543714 13 2412169 0% /k

(Remarquez que cet exemple montre que l'on peut, en ligne de commande, ajouter des options à celles mentionnées dans /etc/fstab.)

check / check=normal / check=strict Positionner le niveau de vérification. Lorsque l'une au moins de ces options est mentionnée (et check=normal est configuré par défaut) les images des i-noeuds et des blocs sont vérifiées lors du montage (ce qui peut prendre une minute ou plus sur de gros disques). Avec une vérification stricte, la libération des blocs vérifie que le bloc à libérer se trouve bien dans une zone de données.

check=none / nocheck Pas de vérification.

debug Afficher des informations de débugging lors de chaque (re)mount.

errors=continue / errors=remount-ro / errors=panic Définir le comportement à adopter lorsque des erreurs se produisent. On peut ignorer l'erreur en indiquant simplement que le système de fichier est corrompu, et continuer. On peut également remonter le système en lecture-seule. Ou l'on peut déclencher une panique du noyau et arrêter le système. Le comportement par défaut est inscrit dans le superbloc du fichier et peut être configuré avec tune2fs(8).

grpid ou bsdgroups / nogrpid ou sysvgroups Ces options définissent le GID que reçoit un nou- veau fichier créé. Quand grpid est positionné, le 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 son bit Set-GID positionné, auquel cas il reçoit le GID du répertoire parent, et s'il s'agit d'un nou- veau répertoire, voit son bit Set-GID positionné.

resgid=n et resuid=n Le système de fichiers ext2 réserve un certain

Page 101: Man Des Commandes Linux

�*�

pourcentage de l'espace disponible (par défaut 5%, voir mke2fs(8) et tune2fs(8)). Ces options déter- minent qui peut utiliser ces blocs réservés (celui qui a l'UID indiqué, ou qui appartient au groupe mentionné).

sb=n Utiliser le bloc n comme superbloc plutôt que le bloc 1. Ceci peut servir lorsque le système de fichiers a été endommagé. Généralement, des copies du superbloc sont placées tous les 8192 blocs : 1, 8193, 16385, ... (Ce qui signifie qu'il y a des centaines, voire des milliers de copies du superbloc sur des gros systèmes de fichiers. Je ne connais pas d'options de mke2fs qui créerait moins de copies).

grpquota / noquota / quota / usrquota Ces options sont acceptées mais ignorées.

Options de montage pour fat blocksize=512 / blocksize=1024

Indiquer la taille de bloc (par défaut 512).

uid=valeur et gid=valeur Indiquer le propriétaire et le groupe de tous les fichiers (par défaut : l'uid et le gid du processus appelant).

umask=valeur Fixer l'umask (c'est à dire le masque de bit des permissions qui ne sont pas fournies). Par défaut il s'agit de l'umask du processus en cours. La valeur est donnée en octal.

check=valeur Il y a trois niveaux de vérification des noms de fichiers :

r[elaxed] Les majuscules et minuscules sont acceptées et équivalentes. La partie excédentaire des noms longs est supprimée (par exemple nombeaucouptroplong.foobar devient nombeauc.foo). Les espaces en tête, et au sein des noms sont acceptés, tant dans le nom que dans l'extension.

n[ormal] Comme "relaxed", mais de nombreux caractères spéciaux (*, ?, <, espaces, etc...) sont refusés. C'est l'attitude par défaut.

s[trict] Comme "normal", mais les noms ne peuvent pas contenir de partie longue, et les caractères spéciaux qui sont acceptés par Linux mais pas par MS-DOS sont rejetés (+, =, espaces, etc...)

conv=b[inary] / conv=t[ext] / conv=a[uto] Le système de fichiers fat peut effectuer automa- tiquement les conversions CRLF<-->NL (format de texte MS-DOS vers format de texte UNIX). Les modes de conversion suivants sont autorisés :

binary aucune conversion. C'est le comportement par

�*�

défaut.

text Conversion CRLF<-->NL sur tous les fichiers.

auto Conversion CRLF<-->NL sur tous les fichiers qui n'ont pas une extension de "binaire bien-connu". Cette liste, non exhaustive, se trouve au début de fs/fat/misc.c (dans Linux 2.0, la liste est : exe, com, bin, app, sys, drv, ovl, ovr, obj, lib, dll, pif, arc, zip, lha, lzh, zoo, tar, z, arj, tz, taz, tzp, tpz, gz, tgz, deb, gif, bmp, tif, gl, jpg, pcx, tfm, vf, gf, pk, pxl, dvi).

Les programmes qui calculent des positionnements avec lseek n'aimeront pas du tout la conversion text. Plusieurs personnes ont détruit des données avec cette conversion. Faites attention !

Pour les systèmes montés en mode binaire, un outil de conversion (fromdos/todos) est disponible.

debug Activer l'attribut de débugging. Un numéro de ver- sion, et une liste des paramètres du système de fichiers seront affichés (ces données seront égale- ment affichées si le système est incohérent).

fat=12 / fat=16 Préciser s'il s'agit d'une FAT 12 bits ou 16 bits. Ceci a priorité sur la détection automatique du type de FAT. A n'utiliser qu'avec beaucoup de précautions !

quiet Activer l'attribut de silence. Les tentatives de modification du propriétaire ou du mode d'accès aux fichiers ne renverront pas d'erreurs, bien qu'elles échouent. A utiliser avec précaution !

sys_immutable, showexec, dots, nodots, dotsOK=[yes|no] Diverses tentatives risquées de forcer un comporte- ment Unix ou Dos dans un système de fichiers FAT.

Options de montage pour hpfs uid=valeur et gid=valeur

Fixer le propriétaire, et le groupe, de tous les fichiers (par défaut : l'uid et le gid du processus appelant).

umask=valeur Fixer l'umask (c'est à dire le masque de bit des permissions qui ne sont pas fournies). Par défaut il s'agit de l'umask du processus en cours. La valeur est donnée en octal.

case=lower / case=asis Convertir les noms de fichiers en minuscules (lower) ou les laisser tels quels (asis). Par défaut : case=lower.

conv=binary / conv=text / conv=auto Avec conv=text, supprimer une partie des retour- chariots (en particulier tout ceux suivis par un saut-de-ligne) durant la lecture des fichiers. Avec conv=auto, choisir, plus ou moins au hasard, entre conv=binary et conv=text. Avec conv=binary, lire le contenu des fichiers sans les modifier

Page 102: Man Des Commandes Linux

�*�

(option par défaut).

nocheck Ne pas interrompre le montage si le test de cohérence échoue.

Options de montage pour iso9660 Les noms de fichiers iso9660 normaux se présentent dans le format 8.3 (limite de longueur des noms comme sous Dos). 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 blocs/caractères, etc...

Rock Ridge est une extension du format iso9660 qui permet d'offrir ces fonctionnalités Unix. En gros, des données sont ajoutées pour chaque entrée de chaque répertoire afin 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 (sauf qu'il est en lecture seule évidemment).

norock Ne pas utiliser les extensions Rock Ridge, même si elles sont disponibles. Voir map.

check=r[elaxed] / check=s[trict] Avec check=relaxed, les noms de fichier sont con- vertis en minuscules. Ceci n'a probablement d'interêt qu'avec les options norock et map=normal. (Par défaut : check=strict.)

uid=value et gid=value Fixer le propriétaire, et le groupe, de tous les fichiers en écrasant éventuellement les informa- tions trouvées dans les extensions Rock Ridge (par défaut : uid=0,gid=0.)

map=n[ormal] / map=o[ff] Pour les volumes sans extension Rock Ridge, la tra- duction des noms de fichiers convertit les majus- cules en minuscules, supprime l'éventuel `;1' final, and transforme `;' en `.'. Avec map=off il n'y a pas de traduction. Voir norock. (Par défaut : map=normal.)

mode=value Pour les volumes non-Rock Ridge, donner le mode indiqué à tous les fichiers (Par défaut : lecture autorisée pour tous)

unhide Montrer également les fichiers cachés, et les fichiers d'extension.

block=[512|1024|2048] Fixer la taille de bloc (par défaut : block=1024.)

conv=a[uto] / conv=b[inary] / conv=m[text] / conv=t[ext] (par défaut : conv=binary.) Depuis Linux 1.3.54 cette option n'a plus d'effet. (les conversions autres que binaires étaient dangereuses, avec un risque important de corruption de données).

cruft Si l'octet de poids fort de la longueur d'un fichier contient n'importe quoi, utilisez cette option pour indiquer à mount d'ignorer ces octets dans toutes les longueurs de fichiers. Ceci

�*!

entraîne que la longueur maximale d'un fichier sera 16 Mo. L'option `cruft' est positionnée automa- tiquement quand la taille totale du CD-Rom est erronée (négative, supérieure à 800 Mo, ...), ou quand on rencontre des numeros de séquence de vol- ume autres que 0 ou 1.

Options de montage pour minix Aucune.

Options de montage pour msdos Voir les options de montage pour fat. Si le système de fichiers msdos présente des incohérences, une erreur sera indiquée, et le montage sera effectue en lecture seule. On peut réactiver l'ecriture en remontant le système de fichiers.

Options de montage pour ncp Tout comme nfs, l'implémentation ncp nécessite un argument binaire (une structure ncp_mount_data) lors de l'appel système.

Cet argument est construit par ncpmount(8) et la version actuelle de mount (2.5k) ne connait rien en ce qui con- cerne ncp.

Options de montage pour nfs Le noyau a besoin, pour monter un système nfs , d'un argu- ment binaire lors de l'appel système (une structure nfs_mount_data.

Néanmoins le programme mount peut analyser les arguments suivants, et préparer la structure nécessaire au noyau.

Les options suivantes sont de type `option=valeur' : rsize=n, wsize=n, timeo=n, retrans=n, acregmin=n, acreg- max=n, acdirmin=n, acdirmax=n, actimeo=n, retry=n, port=n, mountport=n, mounthost=nom, mountprog=n, mountvers=n, nfsprog=n, nfsvers=n, namlen=n. L'option addr=n est acceptée, mais ignorée.

On peut également employer les options booléennes suiv- antes, éventuellement précédées par no : bg, fg, soft, hard, intr, posix, cto, ac, tcp, udp.

Pour plus de détails, voir nfs(5).

Les options particulièrement utiles sont les suivantes :

rsize=8192,wsize=8192 qui améliorera la vitesse de votre connexion nfs (les tailles des buffers par défaut sont 1024 octets)

soft qui permet au noyau de renoncer au bout d'un moment si le serveur nfs ne répond pas (par défaut le noyau répète indéfiniment sa requête). On peut indiquer un délai avec timeo=time. Ceci est surtout utile s'il y a des chances pour que le serveur nfs soit arrêté, ou redémarre alors que des processus essayent d'accéder à ses fichiers.

Page 103: Man Des Commandes Linux

�*�

Options de montage pour proc uid=value et gid=value

Ces options sont reconnues, mais n'ont pas d'effet semble-t-il.

Options de montage pour smb Tout comme nfs, l'implementation smb nécéssite un argument binaire (une structure smb_mount_data) lors de l'appel système.

Cet argument est construit par smbmount(8) et la version actuelle de mount (2.5k) ne connait rien en ce qui con- cerne smb.

Options de montage pour sysv Aucune.

Options de montage pour ufs Aucune.

Options de montage pour umsdos Voir les options de montage pour msdos.

Options de montage pour vfat Tout d'abord les options de montage pour Fat sont recon- nues. De plus, il existe :

uni_xlate Traduction des caractères Unicode non gérés en séquence d'échappement spéciales. Ceci permet de sauver et de restaurer des fichiers dont le nom contient n'importe quel caractère Unicode. Sans cette option, un '?' est utilisé à la place des caractères dont la traduction est impossible. Le caractère d'échappement est ':' puisqu'il est de toute manière illégal dans les noms de fichiers vfat. La séquence d'échappement utilisée pour rem- placer le caractère unicode u est : ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12).

posix Autoriser l'existence de deux fichiers dont les noms ne diffèrent que par une distinction majus- cule/minuscule.

nonumtail Essayer d'abord de créer un nom court sans numéro de séquence avant d'essayer nom~num.ext.

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 de l'utiliser.

LE PÉRIPHÉRIQUE LOOP Il est possible de faire un montage au travers du périphérique loop (boucle). Par exemple la commande :

�*'

mount /tmp/fdimage /mnt -t msdos -o loop=/dev/loop3,blocksize=1024

va faire correspondre le périphérique boucle /dev/loop3 au fichier /tmp/fdimage, puis monter ce périphérique sur /mnt.

Ce type de montage dispose de trois options, nommées loop, offset et encryption, qui sont en réalité des options pour losetup(8).

Si aucun périphérique loop n'est mentionné explicitement (uniquement l'option `-o loop'), alors mount essayera de trouver une boucle inutilisée et se l'attribuera.

FICHIERS /etc/fstab table des systèmes de fichiers /etc/mtab table des systèmes de fichiers montés /etc/mtab~ fichier de verrouillage /etc/mtab.tmp fichier temporaire

VOIR AUSSI mount(2), umount(2), fstab(5), umount(8), swapon(8), nfs(5), mountd(8), nfsd(8), mke2fs(8), tune2fs(8), los- etup(8)

BOGUES Le montage d'un système de fichiers corrompu peut déclencher un crash système.

Sous Linux, certains systèmes de fichiers ne supportent pas l'option -o sync (le système ext2fs supporte les mises à jour synchrones (à la maniere BSD) lorsqu'il est monté avec l'option sync).

L'option -o remount peut parfois s'avérer incapable de modifier les paramètres de montage (tous les paramètres ext2fs, sauf sb, sont modifiables lors d'un remontage par exemple, mais vous ne pouvez pas modifier le gid ou l'umask pour un système fatfs).

HISTORIQUE Une commande mount est apparue dans UNIX AT&T Version 6.

TRADUCTION Christophe Blaess, 1997.

Lilo 15 Juillet 1997 MOUNT(8)

�)��� ������� ����������������� �����)���

NOM mv - Déplacer ou renommer des fichiers.

SYNOPSIS mv [options] source dest mv [options] source... répertoire Options:

Page 104: Man Des Commandes Linux

�*-

[-bfiuv] [-S suffixe_desire] [-V {numbered,existing,sim- ple}] [--backup] [--force] [--interactive] [--update] [--verbose] [--suffix=suffixe_desire] [--version-con- trol={numbered,existing,simple}] [--help] [--version]

DESCRIPTION Cette page de manuel documente la version GNU de mv.

Si le dernier argument est le nom d'un répertoire exis- tant, mv placera tous les autres fichiers à l'intérieur de ce répertoire, en conservant leurs noms.

Sinon, s'il n'y a que deux fichiers indiqués, il déplacera le premier pour remplacer le second.

Une erreur se produit s'il y a plus de deux fichiers indiqués et si le dernier argument n'est pas un réper- toire. On ne peut déplacer que des fichiers réguliers au sein du système de fichiers.

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 demande à l'utilisateur de confirmer l'écrasement du fichier. Si la réponse n'est pas affirmative, le fichier est ignoré.

OPTIONS -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 existant. Si la réponse ne commence pas par `y' ou `Y', le déplacement n'est pas effectué.

-u, --update Ne pas déplacer un fichier régulier, qui écraserait un fichier destination existant ayant une date de modification plus récente.

-v, --verbose Afficher le nom des fichiers avant de les déplacer.

--help Afficher un message d'aide sur la sortie standard, et terminer normalement.

--version Afficher le numéro de version sur la sortie stan- dard, et terminer normalement.

-S, --suffix suffixe_désiré Utiliser le suffixe_désiré lors des copie de sauve- garde des fichiers. Ce suffixe peut également être indiqué par la variable d'environnement SIM- PLE_BACKUP_SUFFIX. Cette option est prioritaire sur la variable d'environnement. Si aucun de ces deux éléments n'est indiqué, le suffixe `~', est utilisé par défaut, comme avec Emacs.

-V, --version-control {numbered,existing,simple} Cette option permet d'indiquer le type de sauveg-

�*&

arde à effectuer. La variable d'environnement VER- SION_CONTROL peut également être employée, mais cette option est prioritaire. Si VERSION_CONTROL n'est pas renseignée, et si cette option n'est pas fournie, le type de sauvegarde par défaut est `existing'. La valeur de la variable d'environ- nement VERSION_CONTROL ou de cet argument corre- spond à la variable `version-control' d'Emacs. Les valeurs acceptées sont (ainsi que les abréviations uniques) :

`t' ou `numbered' Toujours numéroter les sauvegardes.

`nil' ou `existing' Numéroter la sauvegarde s'il en existe déjà une, sinon faire une sauvegarde simple.

`never' ou `simple' Toujours faire une sauvegarde simple.

TRADUCTION Christophe Blaess, 1997.

FSF 5 Mai 1999 MV(1)

��%���� ������� ����������������� � ��%����

NOM nice - Exécuter un programme avec une priorité d'ordon- nancement modifiée.

SYNOPSIS nice [-n ajustement] [-ajustement] [--adjustment=ajuste- ment] [--help] [--version] [commande [arg...]]

DESCRIPTION Cette page de manuel documente la version GNU de nice.

Remarquez que la plupart des shells ont une commande intégrée ayant le même nom et des fonctionnalités simi- laires.

Si aucun argument n'est fourni, nice affiche la priorité d'ordonnancement en cours, dont cette commande a hérité au lancement.

Sinon, nice exécute la commande désirée en ajustant la priorité d'ordonnancement.

Si aucun ajustement n'est précisé, la valeur de priorité de la commande est augmentée de 10.

[NDT] : `nice' signifie `gentil', la valeur de priorité considérée est une valeur de gentillesse. Plus celle-ci est élévée, plus le processus est gentil vis à vis des autres, leur laissant un accès plus fréquent à l'ordon- nanceur.

Page 105: Man Des Commandes Linux

�*0

Le Super-User peut indiquer un ajustement négatif.

La priorité peut être ajustée avec nice dans l'intervalle -20 (le plus prioritaire) à 19 (le moins prioritaire).

OPTIONS -n ajustement, -ajustement, --adjustment=ajustement

Ajouter ajustement à la priorité de la commande, plutôt que la valeur 10 par défaut.

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

TRADUCTION Christophe Blaess, 1997.

FSF 2 Janvier 1997 NICE(1L)

��'����� ������� ����������������� ��'�����

NOM nohup - Exécuter un programme en le rendant insensible aux déconnexions.

SYNOPSIS nohup commande [arg...] nohup {--help,--version}

DESCRIPTION Cette page de manuel documente la version GNU de nohup.

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 à s'exécuter en arrière-plan après la déconnexion de l'util- isateur.

Si le flux de sortie standard est un tty, celui-ci, ainsi que le flux standard d'erreur sont redirigés afin d'être ajoutés au fichier `nohup.out'.

Si ce fichier n'est pas accessible en écriture, ils sont redirigés vers `$HOME/nohup.out'. Si ce dernier fichier n'est pas non plus accessible en écriture, la commande n'est pas exécutée.

Lorsque nohup crée le fichier `nohup.out' ou `$HOME/nohup.out', il ne lui donne aucune permission d'accès pour les membres du groupe ou pour les autres utilisateurs. Par contre, il ne modifie pas les autorisa- tions d'accès si le fichier existe déjà.

nohup ne bascule pas automatiquement la commande exécutée en arrière-plan. Il faut le réclamer explicitement en

��*

ajoutant un `&' à la fin de la ligne de commande.

OPTIONS Quand la version GNU de nohup est invoquée avec un seul argument, elle reconnait les options suivantes :

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

TRADUCTION Christophe Blaess, 1997.

FSF 2 Janvier 1997 NOHUP(1L)

��(($#��� ��'������������ ��(($#���

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

SYNOPSIS passwd [-k] [-l] [-u [-f]] [-d] [-S] [username]

DESCRIPTION Passwd is used to update a user's authentication token(s).

Passwd is configured to work through the Linux-PAM API. Essentially, it initializes itself as a "passwd" service with Linux-PAM and utilizes configured password modules to authenticate and then update a user's password.

A simple entry in the Linux-PAM configuration file for this service would be:

## passwd service entry that does strength checking of# a proposed password before updating it.#passwd password requisite \

/usr/lib/security/pam_cracklib.so retry=3passwd password required \

/usr/lib/security/pam_unix.so use_authtok#

Note, other module-types are not required for this appli- cation to function correctly.

OPTIONS -k The option, -k, is used to indicate that the update

should only be for expired authentication tokens

Page 106: Man Des Commandes Linux

���

(passwords); the user wishes to keep their non- expired tokens as before.

-l This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).

--stdin This option is used to indicate that passwd should read the new password from standard input, which can be a pipe.

-u This is the reverse of the -l option - it will unlock the account password by removing the ! pre- fix. This option is available to root only. By default passwd will refuse to create a passwordless account (it will not unlock an account that has only "!" as a password). The force option -f will override this protection.

-d This is a quick way to disable a password for an account. It will set the named account password- less. Available to root only.

-n This will set the minimum password lifetime, in days, if the user's account supports password life- times. Available to root only.

-x This will set the maximum password lifetime, in days, if the user's account supports password life- times. Available to root only.

-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 password lifetimes. Available to root only.

-i This will set the number of days which will pass before an expired password for this account will be taken to mean that the account is inactive and should be disabled, if the user's account supports password lifetimes. Available to root only.

-S This will output a short information about the sta- tus of the password for a given account. Available to root user only.

Remember the following two principles Protect your password.

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! Use unrelated passwords for systems controlled by different organizations. Don't give or share your password, in particular to someone claiming to be

���

from computer support or a vendor. Don't let any- 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 change it periodically.

Choose a hard-to-guess password. 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 find in a dictionary (in any language or jargon). Don't use a name (including that of a spouse, par- ent, child, pet, fantasy character, famous person, and location) or any variation of your personal or account name. Don't use accessible information about you (such as your phone number, license plate, or social security number) or your environ- ment. Don't use a birthday or a simple pattern (such as backwards, followed by a digit, or pre- ceded by a digit. Instead, use a mixture of upper and lower case letters, as well as digits or punctuation. When choosing a new password, make 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 passphrase (an understandable sequence of words), or the first letter of each word in a passphrase.

These principles are partially enforced by the system, but only partly so. Vigilence on your part will make the sys- tem much more secure.

EXIT CODE On successful completion of its task, passwd will complete with exit code 0. An exit code of 1 indicates an error occurred. Textual errors are written to the standard error stream.

CONFORMING TO 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 /lib/security/ instead of /usr/lib/security/, as indicated in the example.

FILES /etc/pam.d/passwd - the Linux-PAM configuration file

BUGS None known.

SEE ALSO pam(8), and pam_chauthok(2).

For more complete information on how to configure this application with Linux-PAM, see the Linux-PAM System Administrators' Guide at <http://parc.power.net/morgan/Linux-PAM/index.html>

Page 107: Man Des Commandes Linux

���

AUTHOR Cristian Gafton <[email protected]>

Red Hat Linux Jan 03 1998 PASSWD(1)

�(��� ������� ����������������� �����(���

NOM ps - Afficher l'état des processus en cours.

SYNOPSIS ps [-] [lujsvmaxScewhrnu] [txx] [O[+|-]k1[[+|-]k2...]] [pids]

il y a également trois options étendues :

--sortX[+|-]cle[,[+|-]cle[,...]]

--help

--version

D'autres options étendues sont à venir...

DESCRIPTION ps présente un cliche instantané des processus en cours. Pour obtenir un affichage remis à jour régulièrement, utilisez top.

Cette page de manuel documente la version de ps basée sur /proc.

OPTIONS Les arguments de la ligne de commande peuvent être précédés par un '-', mais ce n'est pas indispensable. Il existe également des options étendues, dans le style GNU, présentées plus bas. l affichage long u (utilisateur) présente le nom de l'utilisateur et

l'heure de lancement. j (job) présente les Pgid et Sid. s (signal) présente les signaux bloqués, ignorés et

interceptés. v (vm) affiche des informations sur la mémoire

virtuelle. m (mémoire) affiche des informations sur l'occupation

mémoire. A combiner avec l'option p pour obtenir les nombres de pages.

f (forêt) affiche les arbres généalogiques des proces- sus.

a (autres) présente également les processus des autres utilisateurs.

x affiche les processus qui n'ont pas de terminal de contrôle.

S additionner les temps CPU et les fautes de pagination des processus fils.

c (commande) afficher le nom de la commande exécutée.

��!

e (environnement) présente l'environnement à la suite de la ligne de commande exécutée.

w (wide) affichage large. Ne coupe pas les informations 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 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", soit son nom sans les suffixes tty ou cu. Il s'agit de l'heuristique inverse de celle utilisée par ps pour afficher les noms abrégés dans le champs TTY. Ex : ps -t1.

O[+|-]k1[,[+|-]k2[,...]] Ordonner la liste des processus en fonction d'un tri multi-niveaux spécifié par la séquence de clés abrégées k1, k2... Ces abréviations sont présentées plus bas, dans le paragraphe CLES DE TRI.

Il y a un ordre de tri par défaut pour chaque format de ps, mais ces ordres peuvent être remplacés par les directives de l'utilisateur.

Le `+' est optionnel, puisqu'il ne fait que demander l'ordre par défaut pour la cle indiquée. `-' inverse l'ordre de tri sur la clé qu'il précède. Comme pour les options t et pids, l'option O doit être la dernière option au sein d'un unique argument, mais les spécifications dans des arguments successifs sont concaténées.

pids affiche uniquement les processus indiqués. Les PIDs sont séparés par des virgules.

Au sein d'un même argument, la liste de PIDs doit être le dernier élément. après la dernière option. Exemple : ps -j1,4,5. Par contre, les listes se trouvant dans des arguments successifs sont con- caténées, par exemple : ps -l 1,2 3,4 5 6 listera tous les processus 1-6 avec le format long.

Si des PIDs sont mentionnés, ou si un terminal de contrôle est spécifié, les processus correspondants sont affichés quelques soient les autres options. Ces listes ont priorité sur les options 'a' et 'x'.

OPTIONS ÉTENDUES Ces options sont précédées par un double tiret.

--sortX[+|-]key[,[+|-]key[,...]] Trier en utilisant les clés complètes (avec plusieurs lettres) présentées dans le paragraphe CLÉS DE TRI. X peut représenter n'importe quel caractère utilisé comme séparateur. Un vrai GNUiste utilisera `='. Le `+' est superflu, puisque la direction de tri par défaut est l'ordre numérique ou lexicographique croissant. Ex.: ps -jax --sort=uid,-ppid,+pid

--help

Page 108: Man Des Commandes Linux

���

Afficher un message d'aide résumant les options d'utilisation et fournissant une liste des clés sup- portées. Cette liste peut être plus a jour que la présente page de manuel.

--version Afficher le numéro de version, et l'origine du pro- gramme.

CLES DE TRI Notez que le tri est fait en utilisant les valeurs internes et non pas les valeurs présentées à l'écran.

ABREV. COMPLETE DESCRIPTION c cmd nom de l'exécutable C cmdline ligne de commande complète f flags attributs FLAGS du format long g pgrp ID du groupe de processus G tpgid terminal contrôlant le groupe j cutime temps utilisateur cumulé J cstime temps système cumulé k utime temps utilisateur K stime temps système m min_flt nombre de fautes de page mineures M maj_flt nombre de fautes de page majeures n cmin_flt fautes de page mineures cumulées N cmaj_flt fautes de page majeures cumulées o session ID de session p pid ID de processus P ppid ID du processus père r rss taille résidente R resident pages résidentes s size taille mémoire en kilo-octets S share nombre de pages partagées t tty numéro mineur de péripherique tty T start_time heure de lancement U uid ID utilisateur u user nom d'utilisateur v vsize taille totale VM en octets y priority priorité d'ordonnancement

DESCRIPTIONS DES CHAMPS PRI Il s'agit d'un compteur dans la structure représen-

tant la tâche. C'est la fréquence, en HZ des activa- tions possibles du processus.

NI Valeur standard Unix de gentillesse (nice). Une valeur positive signifie un accàs moindre au CPU.

SIZE Taille virtuelle de l'image du processus (code + données + pile).

RSS Taille résidente de l'image du processus. Nombre de kilo-octets se trouvant en mémoire.

WCHAN Nom de la fonction du noyau dans laquelle le proces- sus est endormi. Le préfixe `sys_' est supprimé. Ce nom peut être remplacé par un nombre héxadecimal si le fichier /etc/psdatabase n'existe pas.

STAT Etat du processus. Le premier champ correspond à R (runnable) prêt à être exécuté, S (sleeping) endormi, D sommeil ininterruptible, T (traced) arrêté ou suivi, Z (zombie). Le second champ contient W si le processus n'a pas de pages résidentes. Le troisième champ contient N si le processus a une valeur de gen-

��'

tillesse positive (nice, champ NI).

TT terminal de contrôle

PAGEIN Nombre de fautes de pages majeures (où l'on doit lire des pages sur le disque, y compris dans le buffer cache).

TRS Taille de code résident en mémoire.

SWAP Nombre de kilo-octets (où de pages si l'option -p est utilisée) sur le périphérique de swap.

SHARE Mémoire partagée.

MISE À JOUR Cette version de ps basée sur proc fonctionne en lisant le pseudo-système de fichiers monté sur le répertoire /proc. Cette version n'a pas besoin de privilèges spéciaux, ni de bit S-UID positionné. Ne donnez pas de privilège à cette version de ps

Pour obtenir des informations correctes dans le champs WCHAN, il vous faudra créer le fichier /etc/psdatabase en lancant le programme /etc/psupdate. Ceci doit être repro- duit à chaque nouvelle compilation du noyau. Vous devriez également lancer 'ps' en étant connecté sous 'root' lorsque les périphériques tty du répertoire "/dev" changent.

Avec procps-1.00, ps/top lisent directement System.map si ce fichier est disponible. La recherche de la table de correspondance entre les adresses et les symboles du noyau se fait dans l'ordre suivant :

$PS_SYSTEM_MAP /boot/System.map-`uname -r` /boot/System.map /lib/modules/`uname -r`/System.map /etc/psdatabase /boot/psdatabase-`uname -r` /boot/psdatabase, /lib/modules/`uname -r`/psdatabase

NOTES Le membre used_math de la structure task_struct n'est pas affiché, car crt0.s vérifie si math est présent. L'attribut math est ainsi positionné pour tous les proces- sus. [NDT : je pense que 'math' indique une utilisation du coprocesseur arithmétique, mais je n'en suis pas sûr.]

Les programmes swappés sur le disque sont présentés sans les arguments de la ligne de commande, et sont affichés entre parenthèses sauf si l'option c est utilisée.

%CPU correspond à un rapport Temps CPU / Temps utilisa- teur. La somme des valeurs ne donne pas 100% (à moins que vous ayez de la chance). Il s'agit d'un rapport entre le temps d'exécution effectif et le temps depuis lequel le processus a été lancé.

Les champs SIZE et RSS ne prennent pas en compte les tables des pages et la structure task_struct du processus; Il y a toujours au moins 12 Ko de données résidentes en mémoire. SIZE est la taille virtuelle du processus (code

Page 109: Man Des Commandes Linux

��-

+ données + pile).

Pour effectuer la correspondance entre numéro de périphérique et nom de terminal, ps utilise une table "/etc/psdevtab". Cette table est mise à jour à chaque 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 le permettent durant l'exécution. Si la mise à jour n'est pas faite, chaque appel de ps nécéssite un appel stat(2) 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 répertoire $HOME si la demande devient pressante.

AUTEURS ps a été écrit initialement par Branko Lankester ([email protected]).

Michael K. Johnson ([email protected]) l'a ré-écrit pour utiliser le pseudo-système de fichiers "/proc", en modifiant peu de choses pour le reste.

Michael Shields ([email protected]) ajouta la gestion des listes de PIDs.

Charles Blake([email protected]) a implementé le tri multi- niveaux, la bibliothèque dans le style dirent, la corre- spondance entre numéro de péripherique et nom de terminal, la recherche binaire directe dans System.map, et beaucoup d'autres chose. C'est lui qui maintient actuellement l'ensemble proc-ps.

TRADUCTION Christophe Blaess, 1997.

Linux 9 Juin 1997 PS(1)

�$#���� ������� ����������������� ���$#����

NOM pwd - Afficher le nom du répertoire de travail en cours.

SYNOPSIS pwd pwd {--help,--version}

DESCRIPTION Cette page de manuel documente la version GNU de pwd ([NDT] pwd = Print Working Directory).

pwd affiche le nom complet du répertoire en cours.

Ceci signifie que tous les composants du chemin affiché seront de vrais répertoires, aucun lien symbolique ne sera présent.

Remarquez que la plupart des shells Unix disposent d'une commande pwd intégrée ayant les mêmes fonctionnalités. Ainsi la simple évocation de pwd exécutera généralement la

��&

version intégrée, et non pas celle documentée ici.

OPTIONS --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.

TRADUCTION Christophe Blaess, 1997.

FSF 2 Janvier 1997 PWD(1L)

�����"� ������ ����� &������������� �������"�

NOM halt, reboot - Arrêter le système.

SYNOPSIS /sbin/halt [-n] [-w] [-d] [-f] [-i] /sbin/reboot [-n] [-w] [-d] [-f] [-i]

DESCRIPTION Halt enregistre le fait que le système va s'arrêter dans 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 (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 ).

-d Ne pas enregistre le wtmp. L'option -n implique -d.

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

-i Interrompt l'activité de toutes les interfaces réseaux avant la réinitialisation ou l'arrêt.

DIAGNOSTIQUE Si vous n'êtes pas le super-utilisateur, vous n'obtiendrez que le message `must be superuser'.

NOTES Dans les versions précédentes de sysvinit , reboot et halt ne devaient jamais être appelés directement. A partir de cette version, halt et reboot appellent shutdown si le système est dans un niveau d'exécution entre 1 et 5.

Page 110: Man Des Commandes Linux

��0

AUTEUR Miquel van Smoorenburg, [email protected]

VOIR AUSSI shutdown(8), init(1).

TRADUCTION Thierry Vignaud <[email protected]>, 1999.

Linux 19 Mars 1999 HALT(8)

�%�����"� ������ ����� &������������� ���%�����"�

NOM halt, reboot - Arrêter le système.

SYNOPSIS /sbin/halt [-n] [-w] [-d] [-f] [-i] /sbin/reboot [-n] [-w] [-d] [-f] [-i]

DESCRIPTION Halt enregistre le fait que le système va s'arrêter dans 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 (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 ).

-d Ne pas enregistre le wtmp. L'option -n implique -d.

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

-i Interrompt l'activité de toutes les interfaces réseaux avant la réinitialisation ou l'arrêt.

DIAGNOSTIQUE Si vous n'êtes pas le super-utilisateur, vous n'obtiendrez que le message `must be superuser'.

NOTES Dans les versions précédentes de sysvinit , reboot et halt ne devaient jamais être appelés directement. A partir de cette version, halt et reboot appellent shutdown si le système est dans un niveau d'exécution entre 1 et 5.

AUTEUR Miquel van Smoorenburg, [email protected]

VOIR AUSSI shutdown(8), init(1).

��*

TRADUCTION Thierry Vignaud <[email protected]>, 1999.

Linux 19 Mars 1999 HALT(8)

�% ��%�"� ����(/���& ����+��������� ������% ��%�"�

NAME renice - alter priority of running processes

SYNOPSIS renice priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]

DESCRIPTION Renice alters the scheduling priority of one or more running processes. The following who parameters are interpreted as process ID's, process group ID's, or user names. Renice'ing a process group causes all pro- 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 scheduling priority altered. By default, the processes to be affected are specified by their process ID's.

Options supported by renice:

-g Force who parameters to be interpreted as process group ID's.

-u Force the who parameters to be interpreted as user names.

-p Resets the who interpretation to be (the default) process ID's.

For example,

renice +1 987 -u daemon root -p 32

would change the priority of process ID's 987 and 32, and all processes owned by users daemon and root.

Users other than the super-user may only alter the priority of processes they own, and can only monotonically increase their ``nice value'' within the range 0 to PRIO_MAX (20). (This prevents overriding administrative fiats.) The super-user may alter the priority of any process and set the 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 else in the system wants to), 0 (the ``base'' scheduling priority), any- thing negative (to make things go very fast).

FILES /etc/passwd to map user names to user ID's

SEE ALSO getpriority(2), setpriority(2)

BUGS Non super-users can not increase scheduling priorities of their own pro- cesses, even if they were the ones that decreased the priorities in the first place. The Linux kernel (at least version 2.0.0) and linux libc (at least ver- sion 5.2.18) does not agree entierly on what the specifics of the system- call interface to set nice values is. Thus causes renice to report bogus previous nice values.

Page 111: Man Des Commandes Linux

���

HISTORY The renice command appeared in 4.0BSD.

4th Berkeley Distribution June 9, 1993 4th Berkeley Distribution

����� ������� ����������������� ���������

NOM rm - Effacer des fichiers.

SYNOPSIS rm [-dfirvR] [--directory] [--force] [--interactive] [--recursive] [--help] [--version] [--verbose] nom...

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 l'entrée standard est un terminal tty, et si les options -f ou --force ne sont pas indiquées, rm demande à l'util- isateur de confirmer l'effacement du fichier. Si la réponse n'est pas affirmative, le fichier est ignoré.

La version GNU de rm, comme tous les programmes utilisant la fonction getopt(3) pour analyser leurs arguments, vous permet d'utiliser l'option -- pour indiquer que l'argument suivant n'est pas une option. Pour supprimer un fichier nomme `-f' dans le répertoire en cours, on peut utiliser soit

rm -- -f soit

rm ./-f La version Unix de rm utilise un unique `-' pour cela, car elle est antérieure au standard des options analysées par getopt().

OPTIONS -d, --directory

Efface un répertoire avec `unlink' à la place de `rmdir', ne nécessitant pas que le répertoire soit vide. Seul le Super-User peut utiliser cette option. Comme un 'unlink' sur un répertoire déréférence tous les fichiers qui y etaient con- tenus, il est conseille d'effectuer un fsck sur le système de fichiers après cette opération.

-f, --force Ignorer les fichiers non existants, et ne pas interroger l'utilisateur.

-i, --interactive Demander à l'utilisateur de confirmer l'effacement de chaque fichier. Si la réponse ne commence pas par `y' ou `Y', le fichier est ignoré.

-r, -R, --recursive

���

Supprimer récursivement le contenu des répertoires.

-v, --verbose Afficher le nom de chaque fichier avant suppres- 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.

TRADUCTION Christophe Blaess, 1997.

FSF 5 Mai 1999 RM(1)

��#������ ������� ����������������� ��#������

NOM rmdir - Supprimer des répertoires vides.

SYNOPSIS rmdir [options] [repertoire...]

Options POSIX : [-p]

Options GNU (forme courte): [-p] [--help] [--version] [--] rmdir [-p] [--parents] [--help] [--version] répertoire...

DESCRIPTION rmdir supprime chaque répertoire vide indiqué. ([NDT] rmdir = Remove Directory).

Tout argument (autre que les options) ne se rapportant pas à un répertoire vide est considéré comme une erreur.

OPTIONS POSIX -p Effacer les répertoires parents s'ils deviennent

vides après la suppression des répertoires men- tionnés en argument. Ainsi `rmdir -p a/b/c' est équivalent à `rmdir a/b/c; rmdir a/b; rmdir a'.

OPTIONS GNU -p, --parents

Comme décrit ci-dessus.

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

-- Fin des options.

ENVIRONNEMENT Les variables LANG, LC_ALL, LC_CTYPE et LC_MESSAGES ont

Page 112: Man Des Commandes Linux

���

leurs significations habituelles.

CONFORMITÉ POSIX 1003.2

NOTES La commande `rmdir foo' n'effacer le répertoire foo, que s'il est vide. Si on désire effacer également les réper- toires non-vides, il faut utiliser `rm -r foo'.

Cette page décrit la version de rmdir fournie dans le package fileutils-3.16.

TRADUCTION Christophe Blaess, 1997.

FSF 27 Novembre 1996 RMDIR(1L)

����"� ������ ����� &������������� �������"�

NOM rpm - Gestionnaire de Paquetages Red Hat.

SYNOPSIS rpm [options]

DESCRIPTION rpm est un puissant gestionnaire de paquetages, qui peut être utilisé pour construire, installer, interroger, vérifier, mettre à jour, et désinstaller des paquetages de logicies individuels. Un paquetage consiste en une archive de fichiers, et en de l'information sur ce paque- tage, incluant le nom, la version et la description du paquetage.

Un des modes de base suivants doit être sélectionné : Ini- tialiser Base De Données, Reconstruire Base De Données, Construire Paquetage, Recompiler Paquetage, Construire Paquetage à partir Tarball, Interroger, Montrer Etiquettes de Requêtes, Installer, Rafraîchir, Désinstaller, Vérifier, Vérifier Signature, Resigner, Ajouter Signature, fixer propriétaires et groupes et Montrer Configuration.

Maintenance de la Base De Données : rpm -i [--initdb] rpm -i [--rebuiddb]

Construction : rpm [-b|t] [spec_paquetage]+ rpm [--rebuild] [source_rpm]+ rpm [--tarbuild] [source_tarrée]+

Requêtes : rpm [--query] [options_de_requête] rpm [--querytags]

Maintenir les paquetages installés : rpm [--install] [options] [fichier_paquetage]+

rpm [--freshen|-F] [options_installation] [fichier_paquetage]+

��!

rpm [--uninstall|-e] [options_désinstallation] [paque- tage]+

rpm [--verify|-V] [options_vérification] [paquetage]+

Signatures: rpm [--verify|-V] [options_vérification] [paquetage]+ rpm [--resign] [fichier_paquetage]+ rpm [--addsign] [fichier_paquetage]+

Divers : rpm [--showrc] rpm [--setperms] [paquetage]+ rpm [--setgids] [paquetage]+

OPTIONS GENERALES Ces options peuvent être utilisées dans différents modes.

-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 d'habitude.

--version Afficher une seule ligne contenant le numéro de version utilisé par rpm.

--rcfile <liste_fichiers> Chacun des fichiers dans la <liste_fichiers> séparés par des deux-point est lu séquentiellement par rpm pour obtenir des informations de configura- tion. La <liste_fichiers> par défaut est /usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc. Seul le premier fichier dans la liste doit exister, les tildes sont étendues à $HOME.

--root <répertoire> Utiliser le système "enraciné" dans <répertoire> pour toutes les opérations. Notez que cela signi- fie que la base de données sera lue ou modifiée dans <répertoire> et que chacun des scripts pre et post seront lancés après un chroot() vers <réper- toire>.

--dbpath <chemin> Utiliser la base de données RPM située dans <chemin>.

--justdb Mettre à jour uniquement la base de données, pas le système de fichiers.

--ftpproxy <hôte>, --httpproxy <hôte> Utiliser <hôte> en tant qu'hôte proxy FTP ou HTTP. Voir OPTIONS FTP/HTTP.

--ftpport <port>, --httpport <port> Utiliser <port> comme port FTP ou HTTP sur l'hôte proxy. Voir OPTIONS FTP/HTTP.

--pipe <cmd>

Page 113: Man Des Commandes Linux

���

Envoyer la sortie de rpm à la commande <cmd> par l'intermédiaire d'un tube.

OPTIONS D'INSTALLATION ET DE MISE A NIVEAU La forme de la commande d'installation rpm est

rpm -i [options_installation] <fichier_paquetage>+

Ceci installe un nouveau paquetage. La forme générale d'une commande de mise à niveau rpm est

rpm -U [options_installation] <fichier_paquetage>+

Ceci met à jour ou installe le paquetage installé actuellement à la version du nouveau RPM. Ceci est la même chose que l'installation, sauf que les autres ver- sions du paquetage sont supprimées du système.

rpm [-F|--rafraîchir] [options_installation] <fichier_paquetage>+

Ceci mettra à niveau les paquetages, mais uniquement si une version plus ancienne existe actuellement.

Le <fichier_paquetage> peut être spécifié par une URL ftp ou http, auquel cas le paquetage sera téléchargé avant d'être installé. Voir OPTIONS FTP/HTTP pour obtenir des informations sur le support intégré de ftp et http par RPM.

--force Idem que --replacepkgs, --replacefiles, et --oldpa- quetage.

-h, --hash Afficher 50 marques de hachage quand l'archive du paquetage est déballée. A utiliser avec -v pour un bel affichage.

--oldpackage Permettre à une mise à niveau de remplacer un paquetage par un paquetage plus ancien.

--percent Afficher les pourcentages quand les fichiers sont extraits de l'archive du paquetage, ceci dans le but de rendre RPM facile à lancer à partir d'autres outils.

--replacefiles Installer les paquetages même s'ils remplacent des fichiers d'autres paquetages déjà installés.

--replacepkgs Installer les paquetages même si certains d'entre eux sont déjà installés sur ce système.

--allfiles Installer ou mettre à niveau tous les fichiers man- quants du paquetage, même s'ils existent déjà.

--nodeps Ne pas effectuer de vérification de dépendances avant d'installer ou de mettre à niveau un paque- tage.

��'

--noscripts Ne pas exécuter les scripts de pré- et post- installation.

--notriggers Ne pas exécuter les scripts qui sont déclenchés par l'installation de ce paquetage.

--ignoresize Ne pas examiner les systèmes de fichiers montés pour vérifier qu'il y ait un espace disque suff- isant avant d'installer ce paquetage.

--excludepath <chemin> Ne pas installer les fichiers dont les noms commen- cent par <chemin>.

--excludedocs Ne pas installer de fichiers qui sont marqués comme documentation (ce qui inclut les pages de manuel et les documents texinfo).

--includedocs Installer les fichiers de documentation. C'est le comportement par défaut.

--test Ne pas installer le paquetage, uniquement le vérifier et rapporter les conflits potentiels.

--ignorearch Ceci permet l'installation ou la mise à niveau même si l'architecture du binaire RPM et de l'hôte ne correspondent pas.

--ignoreos Ceci permet l'installation ou la mise à niveau même si les systèmes d'exploitation du binaire RPM et de l'hôte ne correspondent pas.

--prefix <chemin> Ceci fixe le préfixe d'installation à <chemin> pour les paquetages relogeables.

--relocate <ancien_chemin>=<nouveau_chemin> Pour les paquetages relogeables, traduit les fichiers qui seraient mis dans <oldchemin> par <newchemin>.

--badreloc A utiliser en conjonction avec --relocate, ceci force le relogement même si le paquetage n'est pas relogeable.

--noorder Ne pas réordonner les paquetages pour une installa- tion. La liste des paquetages devrait normalement être réordonnée pour satisfaire aux dépendances.

OPTIONS DE REQUETE La forme générale d'une commande de requête rpm est

rpm -q [options_de_requête]

Vous pouvez spécifier le format d'information de paquetage qui sera affiché. Pour cela, utilisez l'option [--query-

Page 114: Man Des Commandes Linux

��-

format|-qf], suivie de la chaîne de caractères de format.

Les formats de requête sont des versions modifiées du for- mattage standard printf(3). Ce format est constitué de chaînes de caractères statiques (qui peuvent inclure les séquences d'échappement du C standard pour les sauts de lignes, les tabulations, et d'autres caractères spéciaux) et les formatteurs du type de ceux de printf(3). Comme rpm connaît déjà les types à afficher, le spécificateur de type doit néanmoins être omis, et remplacé par le nom de l'étiquette (tag) d'entête à afficher, enfermé dans des caractères {}. La partie RPMTAG_ du nom de l'étiquette peut être omise.

Des formats de sortie alternatifs peuvent être requis en faisant suivre l'étiquette par :typetag. Actuellement, les types suivants sont supportés : octal, date, shescape, perms, fflags, et depflags.

Par exemple, pour afficher uniquement les noms des paque- tages requis, vous pouvez utiliser %{NOM} comme chaîne de caractères de format. Pour afficher de l'information de nom et de distribution en deux colonnes, vous pouvez utiliser %-30{NOM}%{DISTRIBUTION}.

rpm affichera une liste de toutes les étiquettes qu'il connaît quand il est invoqué avec l'argument --querytags.

Il y a deux sous-ensembles d'option pour les requêtes : la sélection de paquetages et la sélection d'information.

Options de sélection de paquetages :

<nom_paquetage> Interroger le paquetage intallé nommé <nom_paque- tage>.

-a, --all Interroger tous les paquetages intallés.

--whatrequires <capacité> Interroger tous les paquetages qui ont besoin de <capacité> pour leur fonctionnement propre.

--whatprovides <virtuel> Interroger tous les paquetages qui fournissent la capacité <virtuel>.

-f <fichier>, --fichier <fichier> Interroger le paquetage possédant <fichier>.

-g <groupe>, --groupe <groupe> Interroger les paquetages dont le groupe est <groupe>.

-p <fichier_paquetage> Interroger un paquetage <fichier_paquetage> non installé . Le <fichier_paquetage> peut être spécifié comme une URL de type ftp ou http, auquel cas l'entête du paquetage sera téléchargée et interrogée. Voir OPTIONS FTP/HTTP pour obtenir de l'information sur le support intégré d'un client ftp et http par RPM.

--specfile <fichier_de_specs> Analyse syntaxiquement (parse) et interroge <fichier_de_specs> comme s'il était un paquetage.

��&

Bien que toutes les informations (p.ex. les listes de fichiers) ne soient pas disponibles, ce type d'interrogation permet à rpm d'être utilisé pour extraire de l'information de fichiers de spécifica- tions sans avoir à écrire un parseur de fichiers de spécifications.

--querybynombre <nombre> Interroger la <nombre>ième entrée de la base de données directement; ceci est utile à des fins de déboggage.

--triggeredby <pkg> Interroger les paquetages qui sont déclenchés par les paquetages <pkg>.

Options de sélection d'information :

-i Afficher l'information du paquetage, incluant son nom, sa version, et sa description. Cette option utilisera --queryformat s'il a été spécifié.

-R, --requires Lister les paquetages desquels dépend ce paquetage.

--provides Lister les capacités que fournit ce paquetage.

--changelog Lister les informations de modifications de ce paquetage.

-l, --list Lister les fichiers du paquetage.

-s, --state Afficher les états des fichiers du paquetage (implique -l). L'état de chaque fichier est soit normal, non installé, ou remplacé.

-d, --docfiles Lister uniquement les fichiers de documentation (implique -l).

-c, --configfiles Lister uniquement les fichiers de configuration (implique -l).

--scripts Lister les scripts shell spécifiques au paquetage qui sont utilisés comme une partie des processus d'installation et de désinstallation, s'il y en a.

--triggers, --triggerscripts Afficher les scripts de déclenchement, s'il y en a, qui sont contenus dans le paquetage.

--dump Afficher l'information du fichier comme suit : chemin taille mtime somme_md5 mode propriétaire groupe isconfig isdoc rdev symlink. Ceci doit être utilisé avec au moins une option parmi -l, -c, -d.

--last Ordonner le listing des paquetages par date d'installation de sorte que les derniers fichiers installés soient au sommet.

Page 115: Man Des Commandes Linux

��0

--filesbypkg Lister tous les fichiers de chaque paquetage.

--triggerscripts Montrer tous les scripts de déclenchement pour les paquetages sélectionnés.

OPTIONS DE VERIFICATION La forme générale d'une commande de vérification rpm est

rpm -V|-y|--verify [verify-options]

Vérifier un paquetage compare les informations sur les fichiers installés dans le paquetage avec les informations 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, les permissions, le propriétaire et les groupes de chaque fichier. Toutes les discordances sont affichées. Les options de spécification de paquetage sont les mêmes que pour l'interrogation de paquetages.

Les fichiers qui n'étaient pas installés en provenance du paquetage, par exemple les fichiers de documentation exclus à l'installation en utilisant l'option "--exclude- docs", sont ignorés silencieusement.

Options pouvant être utilisées en mode de vérification :

--nomd5 Ignore les erreurs de somme de contrôle MD5 pendant la vérification.

--nopgp Ignore les erreurs de contrôle PGP pendant la vérification.

--nofiles Ignore les fichiers manquants pendant la vérifica- tion.

Le format de sortie est constitué d'une chaîne de caractères de 8 caractère, d'un "c" éventuel dénot- 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 avec la valeur de cet attribut enregistré dans la base de données rpm. Un simple "." (point) signi- fie que le test s'est bien passé. Les caractères suivants dénote l'échec à certains tests :

5 Somme MD5

S Taille du fichier

L Lien symbolique

T Mtime

D Périphérique

U Utilisateur

G Groupe

��*

M Mode (inclut les permissions et le type de fichier)

VERIFICATION DE SIGNATURE La forme générale d'une commande de vérification d'une signature rpm est

rpm --checksig <fichier_paquetage>+

Ceci vérifie la signature PGP du paquetage <fichier_paque- tage> pour s'assurer de son intégrité et de son origine. Les informations de configurations de PGP sont lues à par- tir des fichiers de configuration. Voir la section sur les SIGNATURES PGP pour les détails.

OPTIONS DE DESINSTALLATION La forme générale d'une commande de désinstallation rpm est

rpm -e <nom_paquetage>+

--allmatches Supprimer toutes les versions du paquetage auquel correspond <nom_paquetage>. Normalement, une erreur est émise si <paquetage_nom> correspond à de multiples paquetages.

--noscripts Ne pas exécuter les scripts de pré- et de post- désinstallation.

--notriggers Ne pas exécuter les scripts qui sont déclenchés par la suppression de ce paquetage.

--nodeps Ne pas vérifier les dépendances avant de désin- staller les paquetages.

--test Ne pas réellement désinstaller quoi que ce soit, juste effectuer un test pour voir si c'est possi- ble. Utile en conjonction avec l'option -vv.

OPTIONS DE CONSTRUCTION La forme générale d'une commande de construction rpm est

rpm -[b|t]O [options_de_construction] <spec_paque- tage>+

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

-bp Exécute l'étape "%prep" du fichier de spécifica- tions. Normalement, ceci implique de déballer les sources et d'appliquer tous les patchs.

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

Page 116: Man Des Commandes Linux

���

"%files" du fichier de spécifications subit l'expansion des macros, et des vérifications sont effectuées pour vérifier que chaque fichier existe.

-bc Effectuer l'étape "%build" du fichier de spécifica- tions (après avoir effectué l'étape prep). Cela implique en général l'équivalent d'un "make".

-bi Effectuer l'étape "%install" du fichier de spécifi- cations (après avoir effectué les étapes prep et build). Cela implique en général l'équivalent d'un "make install".

-bb Construire un paquetage binaire (après avoir effectué les étapes prep, build, et install).

-bs Construire uniquement le paquetage source (après avoir effectué les étapes prep, build, et install).

-ba Construire les paquetages paquetages binaires et sources (après avoir effectué les étapes prep, build, et install).

Les options suivantes peuvent également être utilisées :

--short-circuit Passer directement à l'étape spécifiée (çàd, passer toutes les étapes menant à l'étape spécifiée). Uniquement valide avec -bc et -bi.

--timecheck Fixer l'âge de "timecheck" (0 pour le désactiver). Cette valeur peut également être configurée en définissant la macro "_timecheck". La valeur de timecheck exprime, en secondes, l'âge maximum d'un fichier en train d'être mis en paquetage. Des avertissements seront affichés pour tous les fichiers au-delà de l'âge de timecheck.

--clean Supprimer l'arbre de construction après que les paquetages aient été créés.

--rmsource Supprimer les sources et le fichier de spécifica- tions après la construction (peut également être utilisé seul, p.ex. "rpm --rmsource foo.spec").

--test N'exécuter aucune étape de construction. Utile pour tester en profondeur les fichiers de spécifi- cations.

--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 section sur les SIGNATURES PGP pour les détails de configuration.

--buildroot <répertoire> Pendant la construction du paquetage, surcharger l'étiquette de Construction de Racine avec le répertoire <répertoire>.

--target <plate-forme> Pendant la construction du paquetage, interpréter <plate-forme> comme arch-vendor-os et fixer les macros _target, _target_arch et _target_os en

���

conséquence.

--buildarch <arch> Pendant la construction du paquetage, fixer l'architecture à <arch>. Cette option a été rendue obsolète par --target dans RPM 3.0.

--buildos <se> Pendant la construction du paquetage, fixer l'architecture à <os>. Cette option a été rendue obsolète par --target dans RPM 3.0.

OPTIONS DE RECONSTRUCTION ET DE RECOMPILATION Il y a deux autres façons d'invoquer une construction avec rpm:

rpm --recompile <fichier_paquetage_sources>+

rpm --rebuild <fichier_paquetage_sources>+

Quand il est invoqué de cette façon, rpm installe le paquetage de sources désigné, et effectue une préparation, une compilation et une installation. En plus, --rebuild construit un nouveau paquetage bianire. Quand la con- struction est terminée, le répertoire de construction est supprimé (comme avec --clean) et les sources ainsi que le fichier de spécifications du paquetage sont supprimés.

SIGNATURE D'UN RPM EXISTANT rpm --resign <fichier_paquetage_binaires>+

Cette option génère et insère de nouvelles signatures pour les paquetages spécifiés. Toute signature existante est supprimée.

rpm --addsign <fichier_paquetage_binaires>+

Cette option génère et concatène les nouvelles signatures des paquetages spécifiés à celles qui existaient déjà.

SIGNATURES PGP Pour utiliser la caractéristique des signatures, RPM doit être configuré pour lancer PGP, et il doit être capable de trouver un groupe de clés publiques (keyring) avec des clés publiques RPM à l'intérieur. Par défaut, RPM utilise les comportements par défaut de PGP pour trouver les keyrings (en utilisant PGPPATH). Si vos keyrings ne sont pas situées là où PGP s'attend à ce qu'elles soient, vous aurez besoin de configurer la macro

_pgp_path pour fournir la localisation des keyrings PGP à utiliser.

Si vous voulez être capable de signer les paquetages que vous avez créés vous-même, vous devrez également créer votre propre paire clé publique/clé secrète (voir le manuel PGP). Vous devrez également configurer les macros suivantes :

_signature

Page 117: Man Des Commandes Linux

���

Le type de la signature. Actuellement, seule celle de pgp est supportée.

_pgp_name Le nom de l'"utilisateur" dont vous voulez utiliser la clé pour signer vos paquetages.

Pendant la construction de paquetages, vous ajouterez ensuite le signe -- à la ligne de commandes. On vous demandera votre phrase de passe, et votre paquetage sera construit et signé.

Par exemple, pour être capable d'utiliser PGP pour signer les paquetages en tant qu'utilisateur "John Doe <[email protected]>" à partir des key rings situées dans /etc/rpm/.pgp en utilisant l'exécutable /usr/bin/pgp, vous devriez inclure

%_signature pgp

%_pgp_path /etc/rpm/.pgp

%_pgp_name John Doe <[email protected]>

%_pgpbin /usr/bin/pgp

dans un fichier de configuration de macros. Utilisez /etc/rpm/macros pour une configuration par système et ~/.rpmmacros pour une configuration par utilisateur.

OPTIONS DE RECONSTRUCTION DE LA BASE DE DONNEES La forme générale d'une commande de reconstruction d'une base de données rpm est

rpm --rebuiddb

Pour reconstuire une nouvelle base de données, tapez :

rpm --initdb

Les seules options pour ces modes sont --dbchemin et --root.

SHOWRC Lancer

rpm --showrc

montrera les valeurs que va utiliser RPM pour toutes les options qui peuvent être fixées dans les fichiers rpmrc.

OPTIONS FTP/HTTP RPM inclut des simples clients FTP et HTTP pour simplifier l'installation et l'interrogation de paquetages qui sont disponibles sur internet. Les fichiers de paquetage pour l'installation, la mise à niveau et les opérations d'interrogation peuvent être spécifiés dans une URL du style ftp ou http :

��!

ftp://<utilisa- teur>:<mot_de_passe>@nom_hôte:<port>/chemin/vers/paque- tage.rpm

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 anonyme est utilisé. Dans tous les cas, des transferts ftp passifs (PASV) sont utilisés.

RPM permet d'utiliser les options suivantes avec les URLs ftp :

--ftpproxy <nom_hôte> L'hôte <nom_hôte> sera utilisé comme un serveur délégué (proxy) pour tous les transferts ftp, ce qui permet aux utilisateurs d'effectuer des connex- ions au travers des gardes-barrière qui utilisent des systèmes de proxies. Cette option peut égale- ment être spécifiée en configurant la macro _ftp- proxy.

--ftpport <port> Le port TCP numéro <port> à utiliser pour les con- nexions ftp sur le serveur proxy ftp au lieu du port par défaut. Cette option peut également être spécifiée en configurant la macro _ftpport.

RPM permet d'utiliser les options suivantes avec les URLs http :

--httpproxy <nom_hôte> L'hôte <nom_hôte> sera utilisé comme un serveur délégué (proxy) pour tous les transferts http. Cette option peut également être spécifiée en con- figurant la macro _httpproxy.

--httpport <port> Le port TCP numéro <port> à utiliser pour les con- 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.

FICHIERS /usr/lib/rpm/rpmrc /etc/rpmrc ~/.rpmrc /usr/lib/rpm/macros /etc/rpm/macros ~/.rpmmacros /var/lib/rpm/conflictsindex.rpm /var/lib/rpm/fileindex.rpm /var/lib/rpm/groupindex.rpm /var/lib/rpm/nameindex.rpm /var/lib/rpm/packages.rpm /var/lib/rpm/providesindex.rpm /var/lib/rpm/requiredby.rpm /var/lib/rpm/triggerindex.rpm /tmp/rpm*

Page 118: Man Des Commandes Linux

���

VOIR AUSSI glint(8) , rpm2cpio(8) , http://www.rpm.org/

AUTEURS Marc Ewing <[email protected]> Jeff Johnson <[email protected]> Erik Troan <[email protected]>

TRADUCTION Frédéric Delanoy, 2000.

(�'�#�$ �"� ������ ����� &������������������(�'�#�$ �"�

NOM shutdown - Arrêter le système.

SYNOPSIS /sbin/shutdown [-t sec] [-arkhncfF] heure [message-aver- tissement]

DESCRIPTION shutdown arrête le système d'une façon sécurisée. Tous les utilisateurs connectés sont informés que le système va s'arrêter, et login(1) est bloqué. Il est possible d'arrêter le système immédiatement ou après un certain délai. En premier lieu, tous les processus sont informés que le système est en train de s'arrêter par le signal SIGTERM. Ceci donne le temps à des programmes comme vi(1) de sauver le fichier en cours d'édition, la chance à des programmes de traitement de mails et de nouvelles de se terminer proprement, etc. shutdown fait son travail en donnant l'ordre au processus init de modifier le niveau d'exécution. Le niveau d'exécution 0 est utilisé pour arrêter le système, le niveau d'exécution 6 est utilisé pour redémarrer le système, et le niveau d'exécution 1 est utilisé pour mettre le système dans un état où des tâches administratives peuvent être effectuées; c'est le com- portement par défaut si ni -h ni -r ne sont donnés comme option à shutdown. Pour voir quelles actions sont entreprises durant l'arrêt ou le redémarrage, voyez les entrées appropriées pour ces niveaux d'exécution dans le fichier /etc/inittab.

OPTIONS -a Utiliser /etc/shutdown.allow.

-t sec Avertir init(8) d'attendre sec secondes entre le moment de l'émission du signal d'avertissement et celui du signal de fin aux processus, avant d'effectuer un changement de niveau d'exécution.

-k Ne pas réellement s'arrêter; uniquement envoyer les messages d'avertissements à tous les processus.

-r Redémarrer la machine après l'arrêt du système.

-h Arrêter la machine après l'arrêt du système.

-n [DÉPRÉCIÉ] Ne pas appeler init(8) mais le faire soi-même. L'utilisation de cette option est

��'

découragée, et ses résultats ne sont pas toujours ce à quoi l'on s'attend.

-f Ne pas effectuer de fsck en cas de redémarrage.

-F Forcer l'utilisation de fsck en cas de redémarrage.

-c Annuler un shutdown en cours. Avec cette option, il n'est évidemment pas possible de donner l'argu- ment heure, mais vous pouvez entrer un message 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 l'heure (1 ou 2 chiffres) et mm la minute de l'heure (en deux chiffres). Secundo, il peut être au format +m, dans lequel m est le nombre de minutes à attendre. Le mot now est un synonyme pour +0.

Si shutdown est appelé avec un délai, il crée le fichier de recommandation /etc/nologin qui permet à des programmes comme login(1) de refuser des nouvelles connexions d'util- isateurs. Shutdown ne supprime ce fichier que s'il a été stoppé avant qu'il n'ait informé init (çàd qu'il ait été annulé ou que quelque chose se soit mal passé). Sinon, il est de la responsabilité des scripts d'arrêt ou de démar- rage du système de supprimer ce fichier de sorte que les utilisateurs puissent à nouveau se connecter.

Le drapeau -f signifie `redémarrage rapide'. Ceci crée uniquement un fichier de recommandation /fastboot qui peut être testé par le système quand il revient à la vie. Le fichier de démarrage rc peut tester si ce fichier existe, et décider de ne pas lancer fsck(1) puisque le système a été arrêté d'une manière propre. Après cela, le processus de démarrage devrait supprimer /fastboot.

Le drapeau -F signifie `forcer le fsck'. Ceci crée uniquement un fichier de recommandation /forcefsck qui peut être testé par le système quand il revient à la vie. Le fichier de démarrage rc peut tester si ce fichier existe, et décider de lancer fsck(1) avec un drapeau 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 cela, le processus de démarrage devrait supprimer /forcef- sck.

Le drapeau -n empêche shutdown d'appeler init, mais lui fait tuer les processus en cours d'exécution lui-même. shutdown désactive ensuite les quotas, les comptes, et le swap et démont tous les systèmes de fichiers.

CONTRÔLE D'ACCÈS shutdown peut être appelé à partir de init(8) quand les touches magiques CTRL-ALT-DEL sont pressées, en créant une entrée appropriée dans /etc/inittab. Cela signifie que tous ceux qui ont un accès physique au clavier de la con- sole peuvent arrêter le système. Pour empêcher cela, shutdown peut vérifier si un utilisateur autorisé est con- necté sur une des consoles virtuelles. Si shutdown est appelé avec l'argument -a (ajouter cette invocation de

Page 119: Man Des Commandes Linux

��-

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é, il poursuivera son exécution. Sinon, il affichera le mes- sage

shutdown : no authorized users logged in

(çàd aucun utilisateur autorisé connecté) sur la console (physique) du système. Le format de /etc/shutdown.allow est formé d'un nom d'utilisateur par ligne. Les lignes vides et les commentaires (préfixés par un #) sont permis. Actuellement, il y a une limite de 32 utilisateurs dans ce fichier.

FICHIERS /fastboot /etc/inittab /etc/init.d/halt /etc/init.d/reboot /etc/shutdown.allow

BOGUES Pas vraiment un bogue, mais la plupart des utilisateurs oublient de donner l'argument heure et sont ensuite intrigués par le message d'erreur produit par shutdown. L'argument heure est obligatoire; dans 90% des cas ce sera le mot now.

AUTEUR Miquel van Smoorenburg, [email protected]

VOIR AUSSI fsck(8), init(1), halt(8), reboot(8)

TRADUCTION Frédéric Delanoy, 2000.

Linux 22 Août 2000 SHUTDOWN(8)

��&

(������ ������� ����������������� ��(������

NOM sort - Trier les lignes d'un fichier texte.

SYNOPSIS sort [-cmus] [-t séparateur] [-o fichier_de_sortie] [-T répertoire_temporaire] [-bdfiMnr] [+POS1 [-POS2]] [-k POS1[,POS2]] [fichier...] sort {--help,--version}

DESCRIPTION Cette page de manuel documente la version GNU de sort.

sort trie, regroupe ou compare toutes les lignes des fichiers indiqués. Si aucun fichier n'est fourni, ou si le nom `-' est mentionné, la lecture se fera depuis l'entrée standard.

Par défaut, sort écrit ses résultats sur la sortie stan- dard.

sort peut opérer suivant trois modes : tri (par défaut), regroupement, et vérification de l'ordre. Les options suivantes modifient le mode opératoire :

-c ([NDT] c = check - vérifier) Vérifie si les fichiers fournis sont déjà triés : s'ils ne le sont pas, afficher un message d'erreur, et terminer avec un code de retour valant 1.

-m ([NDT] m = merge - melanger) Regrouper les fichiers indiqués en les triant. Chaque fichier d'entrée doit déjà être trié individuellement. Il est tou- jours possible de trier plutôt que de réunir, le regroupement est fourni parce qu'il est plus rapide 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 pas un saut de ligne (NewLine), la version GNU de sort en

Page 120: Man Des Commandes Linux

��0

ajoute un automatiquement.

Si la variable d'environnement TMPDIR est configurée, sort utilise ce répertoire pour stocker les fichiers tempo- raires à la place du répertoire par défaut /tmp. L'option -T répertoire_temporaire permet également de sélectionner un répertoire pour placer les fichiers temporaires, elle a priorité sur la variable d'environnement.

Les options suivantes affectent l'ordre des lignes de sor- tie. Elles peuvent être mentionnées globalement, ou appliquées à un champ clé spécifique. Si aucun champ clé n'est indiqué, les options globales s'appliquent aux com- paraisons des lignes entières, sinon elles sont transmises aux champs clés n'ayant pas d'option spécifique.

-b Ignorer les blancs en début de ligne pendant la recherche de la clé de tri sur chaque ligne.

-d Trier dans l'ordre des répertoires téléphoniques : ignorer pour le tri tous les caractères autres que les lettres, les chiffres et les blancs.

-f Considérer les minuscules comme leur équivalent en majuscule pendant le tri. Ainsi `b' est trie de manière équivalente a `B'. ([NDT] Bien entendu cela ne fonctionne pas avec les minuscules accentuées...)

-i Ignorer pour le tri les caractères en dehors de l'intervalle ASCII octal 040-0176 (bornes com- prises).

-M Une chaîne initiale, consistant en un nombre quel- conque de blancs, suivi de trois lettres correspon- dant à une abreviation de mois est convertie en majuscules avant d'être comparée dans l'ordre `JAN' < `FEB' < ... < `DEC.' Les noms invalides sont considéres comme inférieurs aux noms valides. ([NDT] Qu'en-est-il vis à vis de la localisation ?)

-n Comparer suivant la valeur arithmétique d'une chaîne numérique initiale composée d'espaces éventuels, suivis optionnellement du signe -, et de zéro ou plusieurs chiffres, éventuellement suivi d'un point décimal et de zéro ou plusieurs chiffres.

-r Inverser l'ordre de tri, afin que les lignes avec la plus grande valeur de clé apparaissent en pre- mier.

Les autres options sont :

-o fichier_de_sortie Ecrire dans le fichier_de_sortie plutôt que sur la sortie standard. Si fichier_de_sortie est égale- ment un fichier d'entrée, sort copie les données dans un fichier temporaire avant le tri pour pou- voir écrire correctement ses résultats dans le fichier_de_sortie.

-t caractère_séparateur Utiliser le caractère_séparateur afin de distinguer les champs pour rechercher la clé de tri sur chaque ligne. Par défaut le séparateur de champs est une chaîne blanche entre chaînes non-blanches.

�!*

Ceci signifie qu'avec l'entrée ` foo bar', sort distingue deux champs ` foo' et ` bar'. Le séparateur n'appartient ni au champ précédent, ni au champ suivant.

-u Pour l'action par défaut, ou pour l'action -m, n'afficher que la première séquence de lignes con- sidérées comme égales. Pour l'action -c, vérifier qu'aucune lignes consécutives ne soient égales.

+POS1 [-POS2] Indiquer un champ à utiliser comme clé de tri pour chaque ligne. Le champ consiste en une portion de de ligne débutant à la position POS1, et s'étendant jusqu'à POS2 non-inclue (ou jusqu'à la fin de la ligne si POS2 n'est pas mentionnée). Les positions des champs et des caractères sont numérotées à par- tir de 0.

-k POS1[,POS2] Une autre syntaxe possible pour indiquer les clés de tri. Les positions des champs et des caractères sont numérotées à partir de 1.

Une position est de la forme f.c, où f est le numéro du champ à utiliser, et c le numéro du premier caractère depuis le début du champ (avec +pos) ou depuis la fin du champ précédent (avec -pos). La partie .c de la position peut être omise, auquel cas le caractère considéré est le premier du champ. Si l'option -b est choisie, la partie .c d'une spécification de champ est comptée à partir du premier caractère non-blanc du champ (pour +pos) ou à par- tir du premier caractère non-blanc suivant le champ précédent (pour -pos).

Un argument +pos ou -pos peut également avoir un préfixe constitué d'une des lettres d'option Mbdfinr auquel cas les options globales ne s'appliquent pas à ce champ. l'option -b peut être attachée indépendament aux parties +pos ou -pos d'une spécification de champ. Si elle est héritée d'une option globale, elle s'appliquera aux deux parties. Si une option -n ou -M est utilisée, ceci implique que l'option -b s'applique aux deux spécifica- tions +pos et -pos. Les clés peuvent s'étendre sur plusieurs champs.

De plus quand la version GNU de sort est invoquée avec un seul argument, les options suivantes sont reconnues :

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

COMPATIBILITE Les implémentations historiques (BSD et System V) de sort diffèrent dans leurs interprétations de certaines options, notamment -b, -f, et -n. La version GNU suit le comporte- ment POSIX, qui est généralement (mais pas toujours) celui de la version System V. Suivant POSIX -n n'implique plus obligatoirement -b. Pour assurer l'homogénéïte, -M a été modifiée de la même manière. Dans certains cas, assez obscurs, ceci peut affecter la signification des positions de caractères dans les spécifications de champs. Si ceci vous perturbe, vous pouvez ajouter explicitement un -b.

Page 121: Man Des Commandes Linux

�!�

BOGUES Les différentes significations des numéros de champs en fonction de l'utilisation ou non de l'option -k induit une confusion certaine. C'est la faute à POSIX !

TRADUCTION Christophe Blaess, 1997.

FSF 14 Janvier 1997 SORT(1)

(��0���� ������� ����������������� �(��0����

NOM stty - Modifier et afficher la configuration de la ligne de terminal.

SYNOPSIS stty [configuration...] stty {-a,--all,-g,--help,--save,--version}

DESCRIPTION Cette page de manuel documente la version GNU de stty.

Si aucun argument n'est fourni, stty affiche la vitesse de communication, le numéro de discipline de ligne (sur les systèmes le supportant) et les éléments de configuration modifiés par rapport aux valeurs fixées par `stty sane'.

La configuration en question est celle de la ligne tty connectée sur l'entrée standard.

stty accepte les arguments suivants, qui modifient le com- portement de la ligne.

Un `[-]' devant un argument signifie que l'on peut l'inhiber en le faisant précéder d'un `-'. Certains argu- ments ne sont pas disponibles sur tous les systèmes, car il s'agit d'extensions non-POSIX. Ils sont indiqués par `(np)'.

Paramètres de controle :

[-]parenb Transmet un bit de parité en sortie, et en attend un en entrée.

[-]parodd Indique une parite impaire (paire si précéde de `-').

cs5 cs6 cs7 cs8 Indique une taille de caractère de 5, 6, 7, ou 8 bits.

[-]hupcl [-]hup Envoie un signal de déconnexion (Hangup) lorsque le dernier processus referme la ligne tty.

�!�

[-]cstopb Utilise deux bits d'arrêt par caractère (un seul avec `-').

[-]cread Permet la réception de données.

[-]clocal Désactive les signaux de contrôle propres aux modems.

[-]crtscts (np) Active le contrôle de flux RTS/CTS.

Paramètres d'entrée:

[-]ignbrk Ignorer les signaux breaks.

[-]brkint Un break déclenche un signal d'interruption.

[-]ignpar Ignorer les erreurs de parité.

[-]parmrk Signaler les erreurs de parité par une séquence 255-0-caractère.

[-]inpck Active la vérification de parité.

[-]istrip Effacer le bit de poids fort (8ième) des caractères en entrée.

[-]inlcr Traduire les Sauts-de-ligne (NewLine) en Retours- Chariots (Carriage Return).

[-]igncr Ignorer les Retours-Chariot (Carriage Return).

[-]icrnl Traduire les Retours-Chariots (Carriage Return) en Sauts-de-ligne (NewLine).

[-]ixon Activer le controle de flux XON/XOFF.

[-]ixoff [-]tandem Activer l'émission d'un caractère d'arrêt lorsque le buffer d'entrée est presque plein, et d'un car- actère de redémarrage lorsqu'il est à nouveau vide

[-]iuclc (np) Convertir les majuscules en minuscules.

[-]ixany (np) Permet l'utilisation de n'importe quel caractère pour redémarrer la sortie (si l'on utilise `-', seul le caractère Start sera actif).

[-]imaxbel (np) Valider l'émission d'un signal sonore lorsqu'un

Page 122: Man Des Commandes Linux

�!�

caractère arrive alors que le buffer d'entrée est plein, dans ce cas le buffer n'est pas purgé.

Paramètres de sortie :

[-]opost Postprocess output ([NDT] ???).

[-]olcuc (np) Traduire les minuscules en majuscules ([NDT] Ceci ne fonctionne pas avec les caractères accentués...)

[-]ocrnl (np) Convertir les Retours-Chariot (Carriage Return) en Sauts-de-ligne (Newline).

[-]onlcr (np) Convertir les Sauts-de-ligne (Newline) en Retours- Chariot (Carriage Return).

[-]onocr (np) Ne pas afficher les Retours-Chariots en première colonne.

[-]onlret (np) Ajouter un Retour-Chariot au Saut-de-ligne.

[-]ofill (np) Utiliser des caractères de remplissage plutôt que des délais d'attente.

[-]ofdel (np) Utiliser l'effacement (Delete) comme caractère de remplissage, à la place du caractère Null.

nl1 nl0 (np) Type de délai pour le Saut-de-ligne.

cr3 cr2 cr1 cr0 (np) Type de délai pour le Retour-chariot.

tab3 tab2 tab1 tab0 (np) Type de délai pour la Tabulation horizontale.

bs1 bs0 (np) Type de délai pour le Retour en arrière (BackSpace).

vt1 vt0 (np) Type de délai pour la Tabulation verticale.

ff1 ff0 (np) Type de délai pour le Saut-de-page (Form Feed).

Paramètres locaux :

[-]isig Valider les caractères spéciaux Interrupt, Quit, et Suspend.

[-]icanon Valider les caractères spéciaux Erase, Kill, Werase, et Rprnt.

[-]iexten

�!!

Valider les caractères spéciaux non-Posix.

[-]echo Activer l'écho des caractères saisis.

[-]echoe, [-]crterase Effectuer l'écho du caractère d'effacement sous forme BackSpace-Espace-BackSpace.

[-]echok Ajouter l'écho d'un Saut-de-Ligne (NewLine) après le caractère Kill.

[-]echonl Effectuer l'écho des Sauts-de-Ligne (NewLine) même si l'écho des autres caractères est désactive.

[-]noflsh Désactiver la purge du buffer après les caractères spéciaux Interrupt et Quit.

[-]xcase (np) Activer l'entrée et la sortie de caractères majus- cules en faisant précéder leur équivalent minuscule par `\', si l'option ICANNON est active.

[-]tostop (np) Arrêter les travaux en arrière-plan qui tentent d'écrire sur leur terminal.

[-]echoprt [-]prterase (np) Effectuer l'écho des caractères effacés entre `\' et '/'.

[-]echoctl [-]ctlecho (np) Afficher l'écho des caractères de contrôle avec la notation (`^c') plutôt que sous leur forme littérale.

[-]echoke [-]crtkill (np) Effectuer l'écho du caractère spécial Kill en effaçant chaque caractère sur la ligne comme indiqué par les paramètres Echoprt et Echoe, à la place des paramètres Echoctl et Echok.

Paramètres combinés :

[-]evenp [-]parity Identique à parenb -parodd cs7. Avec `-', iden- tique à -parenb cs8.

[-]oddp Identique à parenb parodd cs7. Avec `-', identique à -parenb cs8.

[-]nl Identique à -icrnl -onlcr. Avec `-', identique à icrnl -inlcr -igncr onlcr -ocrnl -onlret.

ek Réinitialise les caractères spéciaux Erase et Kill à leurs valeurs par défaut.

sane Identique à cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt

Page 123: Man Des Commandes Linux

�!�

echoctl echoke. Réinitialise également tous les caractères de contrôle à leurs valeurs par défaut.

[-]cooked Identique à brkint ignpar istrip icrnl ixon opost isig icanon. Réinitialise également les caractères Eof et Eol à leurs valeurs par défaut si ce sont les mêmes que les caractères Min et Time (voir plus bas). Avec `-', identique à raw.

[-]raw Identique à -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0. Avec `-', identique à cooked.

[-]cbreak Identique à -icanon.

[-]pass8 Identique à -parenb -istrip cs8. avec `-', iden- tique à parenb istrip cs7.

[-]litout Identique à -parenb -istrip -opost cs8. Avec `-', Identique à parenb istrip opost cs7.

[-]decctlq (np) Identique à -ixany.

[-]tabs (np) Identique à tab0. Avec `-', identique à tab3.

[-]lcase [-]LCASE (np) Identique à xcase iuclc olcuc.

crt Identique à echoe echoctl echoke.

dec Identique à echoe echoctl echoke -ixany. Configure également les caractères spéciaux Interrupt avec la valeur Ctrl-C, Erase avec Del, et Kill avec Ctrl-U.

Caractères spéciaux :

Les valeurs par défaut des caractères spéciaux varient suivant les systèmes. Ils sont configurés en utilisant la syntaxe `nom valeur'. Les noms sont indiqués ci-dessous, et les valeurs peuvent être fournies soit littéralement en utilisant la notation (`^c'), soit avec un entier commen- cant par `0x' pour une valeur héxadécimale, `0' pour une valeur octale, ou tout autre chiffre pour une valeur décimale. Indiquer la valeur `^-' ou `undef' permet de désactiver le caractère spécial.

intr Envoie le signal Intr.

quit Envoie le signal Quit.

erase Efface le dernier caractère saisi.

kill Efface la ligne en cours.

eof Signale une fin de fichier (terminer la saisie).

eol Fin de ligne.

�!'

eol2 (np) Autre caractère pour terminer la ligne.

swtch (np) Basculer à un autre niveau de shell.

start Redémarrage de la sortie après un arrêt.

stop Arrêt de la sortie.

susp Emission d'un signal Terminal Stop

dsusp (np) Emission d'un signal Terminal Stop après avoir vidé le buffer d'entrée.

rprnt (np) Réafficher la ligne en cours.

werase (np) Effacement du dernier mot saisi.

lnext (np) Lire le caractère suivant littéralement, même s'il s'agit d'un caractère spécial.

Paramètres spéciaux :

min N Lorsque -icanon est configuré, indique le nombre minimal de caractères à lire pendant la durée `time' avant que la lecture n'échoue.

time N Lorsque -icanon est configuré, indique la durée (en dixièmes de secondes) pour lire `min' caractères avant que la lecture n'échoue.

ispeed N Configure la vitesse d'entrée à la valeur N

ospeed N Configure la vitesse de sortie à la valeur N

rows N (np) Indique au noyau que le terminal dispose de N lignes.

cols N columns N (np) Indique au noyau que le terminal dispose de N colonnes.

size (np) 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 configuration de rows et cols dans le noyau utilisent généralement les variables d'environ- nement LINES et COLUMNS à la place. Toutefois, la version GNU de stty ne les utilise pas.

line N (np) Utiliser la discipline de ligne N.

speed Affiche la vitesse du terminal.

N Fixe les vitesses d'entrée et de sortie à la valeur N. N peut prendre les valeurs suivantes : 0 50 75

Page 124: Man Des Commandes Linux

�!-

110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 exta extb. exta est equivalent a 19200, extb a 38400. 0 raccroche la ligne si -clo- cal est configuré.

OPTIONS -a, --all

Afficher la configuration en cours de manière lisi- ble humainement.

--help Afficher un message d'aide sur la sortie standard et terminer normalement.

-g, --save Afficher la configuration en cours de manière util- isable comme argument pour une autre commande stty qui restituera le même paramètrage.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

TRADUCTION Christophe Blaess, 1997.

FSF 7 Janvier 1997 STTY(1L)

('���� ������� ����������������� ���('����

NOM su - Executer un shell avec un User-ID et un Group-ID différents.

SYNOPSIS su [-flmp] [-c commande] [-s shell] [--login] [--fast] [--preserve-environment] [--command=commande] [--shell=shell] [-] [--help] [--version] [utilisateur [arg...]]

DESCRIPTION Cette page de manuel documente la version GNU de su.

su permet à un utilisateur de se transformer temporaire- ment en un autre utilisateur.

Un shell est exécute avec les UID, GID effectifs et réels, ainsi que les groupes supplémentaires de l'utilisateur indiqué.

Si aucun nom d'utilisateur n'est mentionné, le nom root, le Super-Utilisateur, est utilisé par défaut.

Le shell exécuté est celui mentionné dans l'enregistrement correspondant à l'utilisateur dans le fichier /etc/passwd. Si aucun shell n'y est indiqué, /bin/sh est exécuté par défaut.

Si l'utilisateur dispose d'un mot de passe, su le réclame, à moins qu'il n'ait été invoque avec un UID réel valant 0

�!&

(celui du Super-Utilisateur).

Par défaut, su ne change pas de répertoire. Il positionne les variables d'environnement `HOME' et `SHELL' à partir des valeurs lues dans le fichier des mots de passe, et si l'utilisateur demandé n'est pas root, renseigne les vari- ables `USER' et `LOGNAME'. Par défaut le shell exécuté n'est pas un shell de connexion.

Si un ou plusieurs arguments sont fournis, ils sont trans- mis comme arguments supplémentaires au shell.

su ne gère pas spécifiquement /bin/sh ou tout autre shell (en positionnant argv[0] a "-su", en transmettant la com- mande -c seulement à certains shells, etc...)

Sur les systèmes disposant de la journalisation syslog, su peut être compilé afin de fournir des rapports d'échec, et éventuellement de réussite des tentatives d'utilisation de su.

Ce programme ne gère pas le "groupe wheel" utilisé pour restreindre l'accès par su au compte Super-Utilisateur, car il pourrait aider des administrateurs systèmes fas- cistes à disposer d'un pouvoir incontrôlé sur les autres utilisateurs.

OPTIONS -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 démarrage (.cshrc). Avec les shells de type Bourne, l'option -f désactive le développement des motifs génériques dans les noms de fichiers, ce qui n'est généralement pas le but recherché.

--help Afficher un message d'aide sur la sortie standard et terminer normalement.

-, -l, --login Appelle le shell sous forme de shell de connexion. Voici ce que cela signifie : Invalider toutes les variables d'environnement sauf `TERM', `HOME', et `SHELL' (qui sont renseignées comme décrit ci- dessus), ainsi que `USER' et `LOGNAME' (qui sont alors remplies même pour le Super-Utilisateur). Remplir `PATH' avec une valeur par défaut donnée lors de la compilation. Se déplacer dans le réper- toire HOME de l'utilisateur. Ajouter "-" au nom du shell, pour que celui-ci lise son ou ses fichiers de démarrage.

-m, -p, --preserve-environment Ne pas changer les variables d'environnement `HOME', `USER', `LOGNAME', et `SHELL'. Executer le shell correspondant à la variable d'environnement `SHELL' plutot que celui présent dans l'enreg- istrement /etc/passwd de l'utilisateur, à moins que ce dernier ait un shell restreint, et que l'appelant ne soit pas le Super-Utilisateur. Un shell est restreint s'il n'est pas dans la liste

Page 125: Man Des Commandes Linux

�!0

/etc/shells, ou dans une liste fournie lors de la compilation si ce dernier fichier n'existe pas. Le comportement de cette option peut être partielle- ment modifiée avec les options --login et --shell.

-s, --shell shell Exécute le shell indiqué plutôt que celui présent dans l'enregistrement /etc/passwd de l'utilisateur, à moins que ce dernier ait un shell restreint, et que l'appelant ne soit pas le Super-Utilisateur.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

Pourquoi GNU SU ne gère-t-il pas le groupe `wheel' (par Richard Stallman) Il peut arriver qu'un petit groupe d'utilisateurs essayent de s'approprier l'ensemble du système. Par exemple, en 1984, quelques utilisateurs du laboratoire d'I.A du MIT 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 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 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.

Je me situe du cote du peuple, pas du côté des chefs. Si vous avez l'habitude de soutenir les patrons et les admin- istrateurs systèmes quoi qu'ils fassent, cette idée peut vous paraître étrange au premier abord.

TRADUCTION Christophe Blaess, 1997.

FSF 7 Janvier 1997 SU(1L)

(0 ���� �������!(! ��(0 ����

NAME sync - flush filesystem buffers

SYNOPSIS sync [OPTION]

DESCRIPTION Force changed blocks to disk, update the super block.

--help display this help and exit

--version output version information and exit

��*

AUTHOR Written by Jim Meyering.

REPORTING BUGS Report bugs to <[email protected]>.

COPYRIGHT Copyright (C) 2001 Free Software Foundation, Inc. This is free software; see the source for copying condi- tions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO The full documentation for sync is maintained as a Texinfo manual. If the info and sync programs are properly installed at your site, the command

info sync

should give you access to the complete manual.

sync (fileutils) 4.1 April 2001 SYNC(1)

(0(����#�"� �������(/���&�� &��������* ������(0(����#�"�

NAME sysklogd - Linux system logging utilities.

SYNOPSIS syslogd [ -a socket ] [ -d ] [ -f config file ] [ -h ] [ -l hostlist ] [ -m interval ] [ -n ] [ -p socket ] [ -r ] [ -s domainlist ] [ -v ] [ -x ]

DESCRIPTION Sysklogd provides two system utilities which provide sup- port for system logging and kernel message trapping. Sup- 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 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.

Syslogd provides a kind of logging that many modern pro- grams use. Every logged message contains at least a time and a hostname field, normally a program name field, too, but that depends on how trusty the logging program is.

While the syslogd sources have been heavily modified a couple of notes are in order. First of all there has been a systematic attempt to insure that syslogd follows its default, standard BSD behavior. The second important con- cept to note is that this version of syslogd interacts transparently with the version of syslog found in the standard libraries. If a binary linked to the standard shared libraries fails to function correctly we would like

Page 126: Man Des Commandes Linux

���

an example of the anomalous behavior.

The main configuration file /etc/syslog.conf or an alter- native file, given with the -f option, is read at startup. Any lines that begin with the hash mark (``#'') and empty lines are ignored. If an error occurs during parsing the whole line is ignored.

OPTIONS -a socket

Using this argument you can specify additional sockets from that syslogd has to listen to. This is needed if you're going to let some daemon run within a chroot() environment. You can use up to 19 additional sockets. If your environment needs even more, you have to increase the symbol MAXFUNIX within the syslogd.c source file. An example for a chroot() daemon is described by the people from OpenBSD at http://www.psionic.com/papers/dns.html.

-d Turns on debug mode. Using this the daemon will not proceed a fork(2) to set itself in the back- ground, but opposite to that stay in the foreground and write much debug information on the current tty. See the DEBUGGING section for more informa- tion.

-f config file Specify an alternative configuration file instead of /etc/syslog.conf, which is the default.

-h By default syslogd will not forward messages it receives from remote hosts. Specifying this switch on the command line will cause the log daemon to forward any remote messages it receives to forward- ing hosts which have been defined.

-l hostlist Specify a hostname that should be logged only with its simple hostname and not the fqdn. Multiple hosts may be specified using the colon (``:'') sep- arator.

-m interval The syslogd logs a mark timestamp regularly. The default interval between two -- MARK -- lines is 20 minutes. This can be changed with this option. Setting the interval to zero turns it off entirely.

-n Avoid auto-backgrounding. This is needed espe- cially if the syslogd is started and controlled by init(8).

-p socket You can specify an alternative unix domain socket instead of /dev/log.

-r This option will enable the facility to receive message from the network using an internet domain socket with the syslog service (see services(5)). The default is to not receive any messages from the network.

This option is introduced in version 1.3 of the sysklogd package. Please note that the default

���

behavior is the opposite of how older versions behave, so you might have to turn this on.

-s domainlist Specify a domainname that should be stripped off before logging. Multiple domains may be specified 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 satu.infodrom.north.de no domain would be cut, you will have to specify two domains like: -s north.de:infodrom.north.de.

-v Print version and exit.

-x Disable name lookups when receiving remote mes- sages. This avoids deadlocks when the nameserver is running on the same machine that runs the syslog daemon.

SIGNALS Syslogd reacts to a set of signals. You may easily send a signal to syslogd using the following:

kill -SIGNAL `cat /var/run/syslogd.pid`

SIGHUP This lets syslogd perform a re-initialization. All open files are closed, the configuration file (default is /etc/syslog.conf) will be reread and the syslog(3) facility is started again.

SIGTERM The syslogd will die.

SIGINT, SIGQUIT If debugging is enabled these are ignored, other- wise syslogd will die.

SIGUSR1 Switch debugging on/off. This option can only be used if syslogd is started with the -d debug option.

SIGCHLD Wait for childs if some were born, because of wall'ing messages.

CONFIGURATION FILE SYNTAX DIFFERENCES Syslogd uses a slightly different syntax for its configu- ration file than the original BSD sources. Originally all messages of a specific priority and above were forwarded to the log file.

For example the following line caused ALL output from daemons using the daemon facilities (debug is the lowest priority, so every higher will also match) to go into /usr/adm/daemons:

# Sample syslog.conf daemon.debug /usr/adm/daemons

Under the new scheme this behavior remains the same. The difference is the addition of four new specifiers, the

Page 127: Man Des Commandes Linux

���

asterisk (*) wildcard, the equation sign (=), the exclama- tion mark (!), and the minus sign (-).

The * specifies that all messages for the specified facil- ity are to be directed to the destination. Note that this behavior is degenerate with specifying a priority level of debug. Users have indicated that the asterisk notation is more intuitive.

The = wildcard is used to restrict logging to the speci- fied priority class. This allows, for example, routing only debug messages to a particular logging source.

For example the following line in syslog.conf would direct debug messages from all sources to the /usr/adm/debug file.

# Sample syslog.conf *.=debug /usr/adm/debug

The ! is used to exclude logging of the specified priori- ties. This affects all (!) possibilities of specifying priorities.

For example the following lines would log all mes- sages of the facility mail except those with the priority info to the /usr/adm/mail file. And all messages from news.info (including) to news.crit (excluding) would be logged to the /usr/adm/news file.

# Sample syslog.conf mail.*;mail.!=info /usr/adm/mail news.info;news.!crit /usr/adm/news

You may use it intuitively as an exception specifier. The above mentioned interpretation is simply inverted. Doing that you may use

mail.none or

mail.!* or

mail.!debug

to skip every message that comes with a mail facility. There is much room to play with it. :-)

The - may only be used to prefix a filename if you want to omit sync'ing the file after every write to it.

This may take some acclimatization for those individuals used to the pure BSD behavior but testers have indicated that this syntax is somewhat more flexible than the BSD behavior. Note that these changes should not affect stan- dard syslog.conf(5) files. You must specifically modify the configuration files to obtain the enhanced behavior.

SUPPORT FOR REMOTE LOGGING These modifications provide network support to the syslogd facility. Network support means that messages can be for- warded from one node running syslogd to another node run- ning syslogd where they will be actually logged to a disk file.

To enable this you have to specify the -r option on the

��!

command line. The default behavior is that syslogd won't listen to the network.

The strategy is to have syslogd listen on a unix domain socket for locally generated log messages. This behavior will allow syslogd to inter-operate with the syslog found in the standard C library. At the same time syslogd lis- tens on the standard syslog port for messages forwarded from other hosts. To have this work correctly the ser- vices(5) files (typically found in /etc) must have the following entry:

syslog 514/udp

If this entry is missing syslogd neither can receive remote messages nor send them, because the UDP port cant be opened. Instead syslogd will die immediately, blowing out an error message.

To cause messages to be forwarded to another host replace the normal file line in the syslog.conf file with the name of the host to which the messages is to be sent prepended with an @.

For example, to forward ALL messages to a remote host use the following syslog.conf entry:

# Sample syslogd configuration file to # messages to a remote host forward all. *.* @hostname

To forward all kernel messages to a remote host the configuration file would be as follows:

# Sample configuration file to forward all kernel # messages to a remote host. kern.* @hostname

If the remote hostname cannot be resolved at startup, because the name-server might not be accessible (it may be started after syslogd) you don't have to worry. Syslogd will retry to resolve the name ten times and then com- plain. Another possibility to avoid this is to place the hostname in /etc/hosts.

With normal syslogds you would get syslog-loops if you send out messages that were received from a remote host to the same host (or more complicated to a third host that sends it back to the first one, and so on). In my domain (Infodrom Oldenburg) we accidently got one and our disks filled up with the same single message. :-(

To avoid this in further times no messages that were received from a remote host are sent out to another (or the same) remote host anymore. If there are scenarios where this doesn't make sense, please drop me (Joey) a line.

If the remote host is located in the same domain as the host, syslogd is running on, only the simple hostname will be logged instead of the whole fqdn.

In a local network you may provide a central log server to have all the important information kept on one machine. If the network consists of different domains you don't have to complain about logging fully qualified names

Page 128: Man Des Commandes Linux

���

instead of simple hostnames. You may want to use the strip-domain feature -s of this server. You can tell the syslogd to strip off several domains other than the one the server is located in and only log simple hostnames.

Using the -l option there's also a possibility to define single hosts as local machines. This, too, results in logging only their simple hostnames and not the fqdns.

The UDP socket used to forward messages to remote hosts or to receive messages from them is only opened when it is needed. In releases prior to 1.3-23 it was opened every time but not opened for reading or forwarding respec- tively.

OUTPUT TO NAMED PIPES (FIFOs) This version of syslogd has support for logging output to named pipes (fifos). A fifo or named pipe can be used as a destination for log messages by prepending a pipy symbol (``|'') to the name of the file. This is handy for debug- ging. Note that the fifo must be created with the mkfifo command before syslogd is started.

The following configuration file routes debug mes- sages from the kernel to a fifo:

# Sample configuration to route kernel debugging # messages ONLY to /usr/adm/debug which is a # named pipe. kern.=debug |/usr/adm/debug

INSTALLATION CONCERNS There is probably one important consideration when 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 in the shared libraries changed somewhere in the region of libc.so.4.[2-4].n. The specific change was to null-termi- nate the message before transmitting it to the /dev/log socket. Proper functioning of this version of syslogd is dependent on null-termination of the message.

This problem will typically manifest itself if old stati- cally linked binaries are being used on the system. Bina- ries using old versions of the syslog function will cause empty lines to be logged followed by the message with the first character in the message removed. Relinking these binaries to newer versions of the shared libraries will correct this problem.

Both the syslogd(8) and the klogd(8) can either be run from init(8) or started as part of the rc.* sequence. If it is started from init the option -n must be set, other- wise you'll get tons of syslog daemons started. This is because init(8) depends on the process ID.

SECURITY THREATS There is the potential for the syslogd daemon to be used as a conduit for a denial of service attack. Thanks go to John Morrison ([email protected]) for alerting me to this potential. A rogue program(mer) could very easily flood the syslogd daemon with syslog messages resulting in the log files consuming all the remaining space on the filesystem. Activating logging over the inet domain sock-

��'

ets will of course expose a system to risks outside of programs or individuals on the local machine.

There are a number of methods of protecting a machine:

1. Implement kernel firewalling to limit which hosts or networks have access to the 514/UDP socket.

2. Logging can be directed to an isolated or non-root filesystem which, if filled, will not impair the machine.

3. The ext2 filesystem can be used which can be con- 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. ALSO NOTE that this will prevent usage of remote logging since syslogd will be unable to bind to the 514/UDP socket.

4. Disabling inet domain sockets will limit risk to the local machine.

5. Use step 4 and if the problem persists and is not secondary to a rogue program/daemon get a 3.5 ft (approx. 1 meter) length of sucker rod* and have a chat with the user in question.

Sucker rod def. -- 3/4, 7/8 or 1in. hardened steel rod, male threaded on each end. Primary use in the 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 lots and for dealing with the occasional recalci- trant or belligerent individual.

DEBUGGING When debugging is turned on using -d option then syslogd will be very verbose by writing much of what it does on stdout. Whenever the configuration file is reread and re- parsed you'll see a tabular, corresponding to the internal data structure. This tabular consists of four fields:

number This field contains a serial number starting by zero. This number represents the position in the internal data structure (i.e. the array). If one number is left out then there might be an error in the corresponding line in /etc/syslog.conf.

pattern This field is tricky and represents the internal structure exactly. Every column stands for a facility (refer to syslog(3)). As you can see, there are still some facilities left free for for- mer use, only the left most are used. Every field in a column represents the priorities (refer to syslog(3)).

action This field describes the particular action that takes place whenever a message is received that matches the pattern. Refer to the syslog.conf(5) manpage for all possible actions.

arguments This field shows additional arguments to the actions in the last field. For file-logging this

Page 129: Man Des Commandes Linux

��-

is the filename for the logfile; for user-logging this is a list of users; for remote logging this is 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.

/dev/log The Unix domain socket to from where local syslog messages are read.

/var/run/syslogd.pid The file containing the process id of syslogd.

BUGS If an error occurs in one line the whole rule is ignored.

Syslogd doesn't change the filemode of opened logfiles at any stage of process. If a file is created it is world readable. If you want to avoid this, you have to create it and change permissions on your own. This could be done in combination with rotating logfiles using the savelog(8) program that is shipped in the smail 3.x distribution. Remember that it might be a security hole if everybody is able to read auth.* messages as these might contain pass- words.

SEE ALSO syslog.conf(5), klogd(8), logger(1), syslog(2), syslog(3), services(5), savelog(8)

COLLABORATORS Syslogd is taken from BSD sources, Greg Wettstein ([email protected]) performed the port to Linux, Mar- tin Schulze ([email protected]) fixed some bugs and added sev- eral new features. Klogd was originally written by Steve Lord ([email protected]), Greg Wettstein made major improve- ments.

Dr. Greg Wettstein Enjellic Systems Development Oncology Research Division Computing Facility Roger Maris Cancer Center Fargo, ND [email protected]

Stephen Tweedie Department of Computer Science Edinburgh University, Scotland [email protected]

Juha Virtanen [email protected]

Shane Alderton [email protected]

Martin Schulze Infodrom Oldenburg [email protected]

��&

Version 1.3 12 October 1998 SYSKLOGD(8)

������� ������� ����������������� ���������

NOM tail - Afficher la dernière partie d'un fichier.

SYNOPSIS tail [-c [+]N[bkm]] [-n [+]N] [-fqv] [--bytes=[+]N[bkm]] [--lines=[+]N] [--follow] [--quiet] [--silent] [--verbose] [--help] [--version] [fichier...]

tail [{-,+}Nbcfklmqv] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de tail ([NDT] tail = queue).

tail affiche la dernière partie (par défaut : 10 lignes) de chacun des fichiers indiqués.

Si aucun fichier n'est fourni, ou si le nom `-' est men- tionné, la lecture se fera depuis l'entrée standard.

Si plusieurs fichiers sont fournis, un en-tête est affiché avant chaque fichier contenant son nom encadré par `==>' et `<=='.

La version GNU de tail peut afficher n'importe quelle quantité de données, contrairement à la version UNIX qui utilise un buffer de taille fixe.

Elle ne dispose pas pas d'option -r (afficher à l'envers). Imprimer un fichier à l'envers est un travail n'ayant rien à voir avec l'affichage de sa fin. La version BSD de tail ne peut imprimer à l'envers que des fichiers tenant dans son buffer, qui à generalement la taille de 32 Ko. Une manière beaucoup plus fiable et souple d'inverser un fichier est d'utiliser la commande GNU tac.

OPTIONS tail accepte deux formats d'options différents. Le nouveau format dans lequel les nombres sont des arguments précédés par les lettres représentant des options, et l'ancien for- mat dans lequel un `+' ou un `-' est suivi d'un nombre puis d'une lettre d'option.

Si un nombre (`N') est précédé de `+', tail commence l'affichage à partir du Nième élément en partant du début du fichier (au lieu de la fin).

-c N, --bytes N Afficher N octets. N est un entier non nul, éventuellement suivi d'un caractère indiquant une unité différente :

b blocs de 512 octets.

k blocs de 1 Ko.

m blocs de 1 Mo.

Page 130: Man Des Commandes Linux

��0

-f, --follow Boucler indéfiniment, en essayant de lire de plus en plus de caractères à la fin du fichier, celui-ci devant grandir. Cette option est ignorée si la lecture se fait depuis un tube (pipe). Si plusieurs fichiers d'entrée sont indiqués tail affiche un en- tête dès qu'un fichier est modifié, pour montrer celui qui est imprimé.

-l, -n N, --lines N Afficher N lignes. -l n'est reconnu que dans l'ancien format d'options.

-q, --quiet, --silent Ne jamais afficher l'en-tête avec le nom du fichier

-v, --verbose Toujours afficher l'en-tête avec le nom du fichier

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

TRADUCTION Christophe Blaess, 1997.

FSF 14 Janvier 1997 TAIL(1)

������ ������� ����������������� ���������

NOM tar - la version GNU de l'utilitaire tar de gestion d'archives.

SYNOPSIS tar [ - ] A --catenate --concatenate | c --create | d --diff --compare | r --append | t --list | u --update | x -extract --get [ --atime-preserve ] [ -b, --block-size N ] [ -B, --read-full-blocks ] [ -C, --directory DIR ] [ --checkpoint ] [ -f, --file [HOSTNAME:]F ] [ --force- local ] [ -F, --info-script F --new-volume-script F ] [ -G, --incremental ] [ -g, --listed-incremental F ] [ -h, --dereference ] [ -i, --ignore-zeros ] [ --ignore-failed- read ] [ -k, --keep-old-files ] [ -K, --starting-file F ] [ -l, --one-file-system ] [ -L, --tape-length N ] [ -m, --modification-time ] [ -M, --multi-volume ] [ -N, --after-date DATE, --newer DATE ] [ -o, --old-archive, --portability ] [ -O, --to-stdout ] [ -p, --same-permis- sions, --preserve-permissions ] [ -P, --absolute-paths ] [ --preserve ] [ -R, --record-number ] [ --remove-files ] [ -s, --same-order, --preserve-order ] [ --same-owner ] [ -S, --sparse ] [ -T, --files-from F ] [ --null ] [ --totals ] [ -v, --verbose ] [ -V, --label NOM ] [ --version ] [ -w, --interactive, --confirmation ] [ -W, --verify ] [ --exclude FILE ] [ -X, --exclude-from FILE

�'*

] [ -Z, --compress, --uncompress ] [ -z, --gzip, --ungzip ] [ --use-compress-program PROG ] [ --block- compress ] [ -[0-7][lmh] ]

filename1 [ filename2, ... filenameN ]

directory1 [ directory2, ...directoryN ]

DESCRIPTION Voici la pages de manuel de la version GNU de tar, un pro- gramme de gestion d'archive utilisé pour créer et restau- rer des fichiers à partir d'une archive connue sous le nom tarfile. Un fichier tarfile peut être sur un lecteur de bande, cependant il est possible de produire un fichier tarfile comme un fichier normal. Le première argument de tar doit être obligatoirement une de ces lettres: Acdrtux, suivis par n'importe quelles fonctions optionnelles. Les arguments finaux de tar sont les noms des fichiers ou des répertoires qui doivent être archivés. L'utilisation d'un nom de répertoire implique toujours que les sous-réper- toires seront inclus dans l'archive.

OPTIONS PRINCIPALES Il faut obligatoirement utiliser l'une des options suiv- antes :

-A, --catenate, --concatenate ajouter des fichiers à une archive.

-c, --create créer une nouvelle archive.

-d, --diff, --compare 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.

-t, --list liste le contenu d'une archive.

-u, --update ajoute seulement les fichiers qui sont plus récents que ceux de l'archive.

-x, --extract, --get restaure les fichiers contenus dans une archive.

AUTRES OPTIONS --atime-preserve

ne modifie pas les dates d'accés des fichiers de l'archive.

-b, --block-size N impose des blocs de N*512 octets (par défaut N=20).

-B, --read-full-blocks reforme des blocs valides (pour lire les tubes 4.2BSD).

-C, --directory DIR aller dans le répertoire DIR.

Page 131: Man Des Commandes Linux

�'�

--checkpoint affiche les noms des répertoires durant la lecture de l'archive.

-f, --file [HOSTNAME:]F utilise le fichier archive F ou le périphérique F (par defaut /dev/rmt0).

--force-local le fichier archive est local même si son nom con- tient un deux-points.

-F, --info-script F --new-volume-script F lance un script à la fin de chaque bande (implique -M).

-G, --incremental crée/liste/restaure les anciens formats GNU de backup par incrémentation.

-g, --listed-incremental F crée/liste/restaure les nouveaux formats GNU de backup par incrémentation.

-h, --dereference ne pas archiver les liens symboliques, archiver les fichiers vers lesquels ils pointent.

-i, --ignore-zeros ignorer, dans l'archive, les blocs de zéros, qui correspondent normalement à EOF.

--ignore-failed-read n'abandonne pas l'opération si un fichier est illisible.

-k, --keep-old-files conserve les fichiers existants; ne les remplace pas par les fichiers présents dans l'archive.

-K, --starting-file F commence par le fichier F dans l'archive.

-l, --one-file-system reste dans le système de fichier local quand l'archive est créée.

-L, --tape-length N changes la cassette (ou disquette, le support) après avoir écrit N*1024 octets.

-m, --modification-time ne restaure pas la date de modification du fichier.

-M, --multi-volume crée/liste/restaure les archives multivolumes.

-N, --after-date DATE, --newer DATE enregistre seulement les fichiers plus récent que DATE.

-o, --old-archive, --portability ecrit une archive au format V7, plutôt qu'au format ANSI.

-O, --to-stdout

�'�

restaure les fichiers vers la sortie standard.

-p, --same-permissions, --preserve-permissions restaure toutes les informations de protection.

-P, --absolute-paths n'enlève pas les '/' au début des noms des fichiers.

--preserve comme -p -s

-R, --record-number accompage chaque message du numéro d'enregistrement au sein de l'archive.

--remove-files efface les fichiers après les avoir ajoutés à l'archive.

-s, --same-order, --preserve-order la liste des fichiers à restaurer est triée dans l'ordre d'archivage.

--same-owner conserve les appartenances des fichiers restaurés.

-S, --sparse traite efficacement les fichiers à trous.

-T, --files-from F obtenir la liste des fichiers à extraire ou à archiver depuis le fichier F.

--null lire les noms se terminant par des caractères nuls. Désactive l'option -C.

--totals affiche la taille totale de l'archive créée avec --create

-v, --verbose afficher la liste des fichiers traités.

-V, --label NOM créer une archive avec le nom de volume NAME.

--version affiche la version de tar.

-w, --interactive, --confirmation demande une confirmation pour chaque action.

-W, --verify tente de vérifier l'archive après l'avoir produite.

--exclude FILE exclut le fichier FILE du traitement.

-X, --exclude-from FILE exclut du traitement les fichiers dont les noms sont contenus dans FILE.

-Z, --compress, --uncompress compresse l'archive avec compressFP.

Page 132: Man Des Commandes Linux

�'�

-z, --gzip, --ungzip compresse l'archive avec gzip.

--use-compress-program PROG 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.

-[0-7][lmh] spécifie le lecteur et sa densité.

TRADUCTION Jérome Signouret, 2000.

Linux 2 Avril 2000 TAR(1)

�%%���� ������� ����������������� ���%%����

NOM tee - Copier l'entrée standard sur la sortie standard et dans un fichier.

SYNOPSIS tee [-ai] [--append] [--ignore-interrupts] [--help] [--version] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de tee.

La commande tee copie l'entrée standard sur la sortie standard, et dans tous les fichiers fournis en argument.

Si un fichier n'existe pas, il est créé. Si le fichier existe deja, il est écrasé, à moins que l'option -a soit précisée.

OPTIONS -a, --append

Ajouter l'entrée standard aux fichiers indiqués plutôt que de les écraser.

--help Afficher un message d'aide sur la sortie standard et terminer normalement.

-i, --ignore-interrupts Ignorer les signaux d'interruption.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

TRADUCTION Christophe Blaess, 1997.

�'!

FSF 8 Janvier 1997 TEE(1L)

�%� %���� (/���&���������*&&� ������

NAME telnet - user interface to the TELNET protocol

SYNOPSIS telnet [-8EFKLacdfrx] [-X authtype] [-b hostalias] [-e escapechar]

[-k realm] [-l user] [-n tracefile] [host [port]]

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

-F If Kerberos V5 authentication is being used, the -F option allows the local credentials to be forwarded to the remote system, including any credentials that have already been forwarded into the local environment.

-K Specifies no automatic login to the remote system.

-L Specifies an 8-bit data path on output. This causes the BINARY option to be negotiated on output.

-X atype Disables the atype type of authentication.

-a Attempt automatic login. Currently, this sends the user name via the USER variable of the ENVIRON option if supported by the remote system. The name used is that of the current user as returned by getlogin(2) if it agrees with the current user ID, otherwise it is the name associated with the user ID.

-b hostalias Uses bind(2) on the local socket to bind it to an aliased address (see ifconfig(8) and the ``alias'' specifier) or to the address of another interface than the one naturally chosen by connect(2). This can be useful when connecting to services which use IP addresses for authentication and reconfiguration of the server is undesirable (or impossible).

-c Disables the reading of the user's .telnetrc file. (See the toggle skiprc command on this man page.)

-d Sets the initial value of the debug toggle to TRUE.

-e escapechar Sets the initial telnet escape character to escapechar. If escapechar is omitted, then there will be no escape character.

Page 133: Man Des Commandes Linux

�'�

-f If Kerberos V5 authentication is being used, the -f option allows the local credentials to be forwarded to the remote system.

-k realm If Kerberos authentication is being used, the -k option requests that telnet obtain tickets for the remote host in realm realm instead of the remote host's realm, as determined by krb_realmofhost(3).

-l user When connecting to the remote system, if the remote system under- stands the ENVIRON option, then user will be sent to the remote system as the value for the variable USER. This option implies the -a option. This option may also be used with the open com- mand.

-n tracefile Opens tracefile for recording trace information. See the set tracefile command below.

-r Specifies a user interface similar to rlogin(1). In this mode, the escape character is set to the tilde (~) character, unless modified by the -e option.

-x Turns on encryption of the data stream if possible.

host Indicates the official name, an alias, or the Internet address of a remote host.

port Indicates a port number (address of an application). If a number is not specified, the default telnet port is used.

When in rlogin mode, a line of the form ~. disconnects from the remote host; ~ is the telnet escape character. Similarly, the line ~^Z suspends the telnet session. The line ~^] escapes to the normal telnet escape prompt.

Once a connection has been opened, telnet will attempt to enable the TELNET LINEMODE option. If this fails, telnet will revert to one of two input modes: either ``character at a time'' or ``old line by line'' depending on what the remote system supports.

When LINEMODE is enabled, character processing is done on the local sys- tem, under the control of the remote system. When input editing or char- acter echoing is to be disabled, the remote system will relay that infor- mation. The remote system will also relay changes to any special charac- ters that happen on the remote system, so that they can take effect on the local system.

In ``character at a time'' mode, most text typed is immediately sent to the remote host for processing.

In ``old line by line'' mode, all text is echoed locally, and (normally) 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 (this would mostly be used to enter passwords without the password being echoed).

If the LINEMODE option is enabled, or if the localchars toggle is TRUE (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 sequences to the remote side. If LINEMODE has ever been enabled, then 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 toggle autoflush and toggle autosynch below) which cause this action to flush subsequent output to the terminal (until the remote host acknowl- edges the TELNET sequence) and flush previous terminal input (in the case

�''

of quit and intr).

While connected to a remote host, telnet command mode may be entered by typing the telnet ``escape character'' (initially ``^]''). When in com- mand mode, the normal terminal editing conventions are available. Note that the escape character will return to the command mode of the initial invocation of telnet that has the controlling terminal. Use the send escape command to switch to command mode in subsequent telnet processes on remote hosts.

The following telnet commands are available. Only enough of each command to uniquely identify it need be typed (this is also true for arguments to the mode, set, toggle, unset, slc, environ, and display commands).

auth argument [...]The auth command manipulates the information sent through theTELNET AUTHENTICATE option. Valid arguments for the auth com-mand are as follows:

disable type Disables the specified type of authentication. To obtain a list of available types, use the auth disable ? command.

enable type Enables the specified type of authentication. To obtain a list of available types, use the auth enable ? command.

status Lists the current status of the various types of authentication.

close Close a TELNET session and return to command mode.

display argument [...]Displays all, or some, of the set and toggle values (seebelow).

encrypt argument [...]The encrypt command manipulates the information sent throughthe TELNET ENCRYPT option.

Valid arguments for the encrypt command are as follows:

disable type [input|output] Disables the specified type of encryption. If you omit input and output, both input and output are disabled. To obtain a list of available types, use the encrypt disable ? command.

enable type [input|output] Enables the specified type of encryption. If you omit input and output, both input and output are enabled. To obtain a list of available types, use the encrypt enable ? command.

input This is the same as the encrypt start input com- mand.

-input This is the same as the encrypt stop input com- mand.

output This is the same as the encrypt start output command.

-output This is the same as the encrypt stop output com- mand.

start [input|output]

Page 134: Man Des Commandes Linux

�'-

Attempts to start encryption. If you omit input and output, both input and output are enabled. To obtain a list of available types, use the encrypt enable ? command.

status Lists the current status of encryption.

stop [input|output] Stops encryption. If you omit input and output, encryption is on both input and output.

type type Sets the default type of encryption to be used with later encrypt start or encrypt stop com- mands.

environ arguments [...]The environ command is used to manipulate the variables thatmay be sent through the TELNET ENVIRON option. The initialset of variables is taken from the users environment, withonly the DISPLAY and PRINTER variables being exported bydefault. The USER variable is also exported if the -a or -loptions are used.Valid arguments for the environ command are:

define variable value Define the variable variable to have a value of value. Any variables defined by this command are automatically exported. The value may be enclosed in single or double quotes so that tabs and spaces may be included.

undefine variable Remove variable from the list of environment vari- ables.

export variable Mark the variable variable to be exported to the remote side.

unexport variable Mark the variable variable to not be exported unless explicitly asked for by the remote side.

list List the current set of environment variables. Those marked with a * will be sent automatically, other variables will only be sent if explicitly requested.

? Prints out help information for the environ com- mand.

logout Sends the TELNET LOGOUT option to the remote side. This com-mand is similar to a close command; however, if the remoteside does not support the LOGOUT option, nothing happens. If,however, the remote side does support the LOGOUT option, thiscommand should cause the remote side to close the TELNET con-nection. If the remote side also supports the concept of sus-pending a user's session for later reattachment, the logoutargument indicates that you should terminate the session imme-diately.

mode type type is one of several options, depending on the state of theTELNET session. The remote host is asked for permission to gointo the requested mode. If the remote host is capable ofentering that mode, the requested mode will be entered.

character Disable the TELNET LINEMODE option, or, if the

�'&

remote side does not understand the LINEMODE option, then enter ``character at a time'' mode.

line Enable the TELNET LINEMODE option, or, if the remote side does not understand the LINEMODE option, then attempt to enter ``old-line-by- line'' mode.

isig (-isig) Attempt to enable (disable) the TRAPSIG mode of the LINEMODE option. This requires that the LINEMODE option be enabled.

edit (-edit) Attempt to enable (disable) the EDIT mode of the LINEMODE option. This requires that the LINEMODE option be enabled.

softtabs (-softtabs) Attempt to enable (disable) the SOFT_TAB mode of the LINEMODE option. This requires that the LINEMODE option be enabled.

litecho (-litecho) Attempt to enable (disable) the LIT_ECHO mode of the LINEMODE option. This requires that the LINEMODE option be enabled.

? Prints out help information for the mode com- mand.

open host [-l user] [[-] port]Open a connection to the named host. If no port number isspecified, telnet will attempt to contact a TELNET server atthe default port. The host specification may be either a hostname (see hosts(5)) or an Internet address specified in the``dot notation'' (see inet(3)). The -l option may be used tospecify the user name to be passed to the remote system viathe ENVIRON option. When connecting to a non-standard port,telnet omits any automatic initiation of TELNET options. Whenthe port number is preceded by a minus sign, the initialoption negotiation is done. After establishing a connection,the file .telnetrc in the user's home directory is opened.Lines beginning with a ``#'' are comment lines. Blank linesare ignored. Lines that begin without whitespace are thestart of a machine entry. The first thing on the line is thename of the machine that is being connected to. The rest ofthe line, and successive lines that begin with whitespace areassumed to be telnet commands and are processed as if they hadbeen typed in manually to the telnet command prompt.

quit Close any open TELNET session and exit telnet. An end-of-file(in command mode) will also close a session and exit.

send argumentsSends one or more special character sequences to the remotehost. The following are the arguments which may be specified(more than one argument may be specified at a time):

abort Sends the TELNET ABORT (Abort processes) sequence.

ao Sends the TELNET AO (Abort Output) sequence, whichshould cause the remote system to flush all outputfrom the remote system to the user's terminal.

ayt Sends the TELNET AYT (Are You There) sequence, towhich the remote system may or may not choose torespond.

Page 135: Man Des Commandes Linux

�'0

brk Sends the TELNET BRK (Break) sequence, which may havesignificance to the remote system.

ec Sends the TELNET EC (Erase Character) sequence, whichshould cause the remote system to erase the last char-acter entered.

el Sends the TELNET EL (Erase Line) sequence, whichshould cause the remote system to erase the line cur-rently being entered.

eof Sends the TELNET EOF (End Of File) sequence.

eor Sends the TELNET EOR (End of Record) sequence.

escape Sends the current telnet escape character (initially``^]'').

ga Sends the TELNET GA (Go Ahead) sequence, which likelyhas no significance to the remote system.

getstatusIf the remote side supports the TELNET STATUS command,getstatus will send the subnegotiation to request thatthe server send its current option status.

ip Sends the TELNET IP (Interrupt Process) sequence,which should cause the remote system to abort the cur-rently running process.

nop Sends the TELNET NOP (No OPeration) sequence.

susp Sends the TELNET SUSP (SUSPend process) sequence.

synch Sends the TELNET SYNCH sequence. This sequence causesthe remote system to discard all previously typed (butnot yet read) input. This sequence is sent as TCPurgent data (and may not work if the remote system isa 4.2BSD system -- if it doesn't work, a lower case``r'' may be echoed on the terminal).

do cmd Sends the TELNET DO cmd sequence. cmd can be either adecimal number between 0 and 255, or a symbolic namefor a specific TELNET command. cmd can also be eitherhelp or ? to print out help information, including alist of known symbolic names.

dont cmdSends the TELNET DONT cmd sequence. cmd can be eithera decimal number between 0 and 255, or a symbolic namefor a specific TELNET command. cmd can also be eitherhelp or ? to print out help information, including alist of known symbolic names.

will cmdSends the TELNET WILL cmd sequence. cmd can be eithera decimal number between 0 and 255, or a symbolic namefor a specific TELNET command. cmd can also be eitherhelp or ? to print out help information, including alist of known symbolic names.

wont cmdSends the TELNET WONT cmd sequence. cmd can be eithera decimal number between 0 and 255, or a symbolic namefor a specific TELNET command. cmd can also be eitherhelp or ? to print out help information, including alist of known symbolic names.

�-*

? Prints out help information for the send command.

set argument value

unset argument valueThe set command will set any one of a number of telnet vari-ables to a specific value or to TRUE. The special value offturns off the function associated with the variable; this isequivalent to using the unset command. The unset command willdisable or set to FALSE any of the specified functions. Thevalues of variables may be interrogated with the display com-mand. The variables which may be set or unset, but not tog-gled, are listed here. In addition, any of the variables forthe toggle command may be explicitly set or unset using theset and unset commands.

ayt If TELNET is in localchars mode, or LINEMODE isenabled, and the status character is typed, a TELNETAYT sequence (see send ayt preceding) is sent to theremote host. The initial value for the "Are YouThere" character is the terminal's status character.

echo This is the value (initially ``^E'') which, when in``line by line'' mode, toggles between doing localechoing of entered characters (for normal processing),and suppressing echoing of entered characters (forentering, say, a password).

eof If telnet is operating in LINEMODE or ``old line byline'' mode, entering this character as the firstcharacter on a line will cause this character to besent to the remote system. The initial value of theeof character is taken to be the terminal's eof char-acter.

erase If telnet is in localchars mode (see toggle localcharsbelow), and if telnet is operating in ``character at atime'' mode, then when this character is typed, aTELNET EC sequence (see send ec above) is sent to theremote system. The initial value for the erase char-acter is taken to be the terminal's erase character.

escape This is the telnet escape character (initially ``^['')which causes entry into telnet command mode (when con-nected to a remote system).

flushoutputIf telnet is in localchars mode (see toggle localcharsbelow) and the flushoutput character is typed, aTELNET AO sequence (see send ao above) is sent to theremote host. The initial value for the flush charac-ter is taken to be the terminal's flush character.

forw1

forw2 If TELNET is operating in LINEMODE, these are thecharacters that, when typed, cause partial lines to beforwarded to the remote system. The initial value forthe forwarding characters are taken from the termi-nal's eol and eol2 characters.

interruptIf telnet is in localchars mode (see toggle localcharsbelow) and the interrupt character is typed, a TELNETIP sequence (see send ip above) is sent to the remotehost. The initial value for the interrupt character

Page 136: Man Des Commandes Linux

�-�

is taken to be the terminal's intr character.

kill If telnet is in localchars mode (see toggle localcharsbelow), and if telnet is operating in ``character at atime'' mode, then when this character is typed, aTELNET EL sequence (see send el above) is sent to theremote system. The initial value for the kill charac-ter is taken to be the terminal's kill character.

lnext If telnet is operating in LINEMODE or ``old line byline'' mode, then this character is taken to be theterminal's lnext character. The initial value for thelnext character is taken to be the terminal's lnextcharacter.

quit If telnet is in localchars mode (see toggle localcharsbelow) and the quit character is typed, a TELNET BRKsequence (see send brk above) is sent to the remotehost. The initial value for the quit character istaken to be the terminal's quit character.

reprintIf telnet is operating in LINEMODE or old line byline'' mode, then this character is taken to be theterminal's reprint character. The initial value forthe reprint character is taken to be the terminal'sreprint character.

rlogin This is the rlogin escape character. If set, the nor-mal TELNET escape character is ignored unless it ispreceded by this character at the beginning of a line.This character, at the beginning of a line, followedby a "." closes the connection; when followed by a ^Zit suspends the telnet command. The initial state isto disable the rlogin escape character.

start If the TELNET TOGGLE-FLOW-CONTROL option has beenenabled, then this character is taken to be the termi-nal's start character. The initial value for thestart character is taken to be the terminal's startcharacter.

stop If the TELNET TOGGLE-FLOW-CONTROL option has beenenabled, then this character is taken to be the termi-nal's stop character. The initial value for the stopcharacter is taken to be the terminal's stop charac-ter.

susp If telnet is in localchars mode, or LINEMODE isenabled, and the suspend character is typed, a TELNETSUSP sequence (see send susp above) is sent to theremote host. The initial value for the suspend char-acter is taken to be the terminal's suspend character.

tracefileThis is the file to which the output, caused bynetdata or option tracing being TRUE, will be written.If it is set to ``-'', then tracing information willbe written to standard output (the default).

worderaseIf telnet is operating in LINEMODE or ``old line byline'' mode, then this character is taken to be theterminal's worderase character. The initial value forthe worderase character is taken to be the terminal'sworderase character.

�-�

? Displays the legal set (unset) commands.

skey sequence challengeThe skey command computes a response to the S/Key challenge.See skey(1) for more information on the S/Key system.

slc state The slc command (Set Local Characters) is used to set orchange the state of the special characters when the TELNETLINEMODE option has been enabled. Special characters arecharacters that get mapped to TELNET commands sequences (likeip or quit) or line editing characters (like erase and kill).By default, the local special characters are exported.

check Verify the current settings for the current spe- cial characters. The remote side is requested to send all the current special character settings, and if there are any discrepancies with the local side, the local side will switch to the remote value.

export Switch to the local defaults for the special char- acters. The local default characters are those of the local terminal at the time when telnet was started.

import Switch to the remote defaults for the special characters. The remote default characters are those of the remote system at the time when the TELNET connection was established.

? Prints out help information for the slc command.

status Show the current status of telnet. This includes the peer oneis connected to, as well as the current mode.

toggle arguments [...]Toggle (between TRUE and FALSE) various flags that control howtelnet responds to events. These flags may be set explicitlyto TRUE or FALSE using the set and unset commands listedabove. More than one argument may be specified. The state ofthese flags may be interrogated with the display command.Valid arguments are:

authdebug Turns on debugging information for the authenti- cation code.

autoflush If autoflush and localchars are both TRUE, then when the ao or quit characters are recognized (and transformed into TELNET sequences; see set above for details), telnet refuses to display any data on the user's terminal until the remote system acknowledges (via a TELNET TIMING MARK option) that it has processed those TELNET sequences. The initial value for this toggle is TRUE if the terminal user had not done an "stty noflsh", otherwise FALSE (see stty(1)).

autodecrypt When the TELNET ENCRYPT option is negotiated, by default the actual encryption (decryption) of the data stream does not start automatically. The autoencrypt (autodecrypt) command states that encryption of the output (input) stream should be enabled as soon as possible.

autologin If the remote side supports the TELNET AUTHENTICATION option TELNET attempts to use it to perform automatic authentication. If the

Page 137: Man Des Commandes Linux

�-�

AUTHENTICATION option is not supported, the user's login name are propagated through the TELNET ENVIRON option. This command is the same as specifying a option on the open command.

autosynch If autosynch and localchars are both TRUE, then when either the intr or quit character is typed (see set above for descriptions of the intr and quit characters), the resulting TELNET sequence sent is followed by the TELNET SYNCH sequence. This procedure should cause the remote system to begin throwing away all previously typed input until both of the TELNET sequences have been read and acted upon. The initial value of this toggle is FALSE.

binary Enable or disable the TELNET BINARY option on both input and output.

inbinary Enable or disable the TELNET BINARY option on input.

outbinary Enable or disable the TELNET BINARY option on output.

crlf If this is TRUE, then carriage returns will be sent as <CR><LF>. If this is FALSE, then car- riage returns will be send as <CR><NUL>. The initial value for this toggle is FALSE.

crmod Toggle carriage return mode. When this mode is enabled, most carriage return characters received from the remote host will be mapped into a carriage return followed by a line feed. This mode does not affect those characters typed by the user, only those received from the remote host. This mode is not very useful unless the remote host only sends carriage return, but never line feeds. The initial value for this toggle is FALSE.

debug Toggles socket level debugging (useful only to the superuser). The initial value for this tog- gle is FALSE.

encdebug Turns on debugging information for the encryp- tion code.

localchars If this is TRUE, then the flush, interrupt, quit, erase, and kill characters (see set above) are recognized locally, and transformed into (hopefully) appropriate TELNET control sequences (respectively ao, ip, brk, ec, and el; see send above). The initial value for this toggle is TRUE in ``old line by line'' mode, and FALSE in ``character at a time'' mode. When the LINEMODE option is enabled, the value of localchars is ignored, and assumed to always be TRUE. If LINEMODE has ever been enabled, then quit is sent as abort, and eof and suspend are sent as eof and susp (see send above).

netdata Toggles the display of all network data (in hex- adecimal format). The initial value for this toggle is FALSE.

options Toggles the display of some internal telnet pro-

�-!

tocol processing (having to do with TELNET options). The initial value for this toggle is FALSE.

prettydump When the netdata toggle is enabled, if prettydump is enabled the output from the netdata command will be formatted in a more user readable format. Spaces are put between each character in the output, and the beginning of any TELNET escape sequence is preceded by a '*' to aid in locating them.

skiprc When the skiprc toggle is TRUE, TELNET skips the reading of the .telnetrc file in the user's home directory when connections are opened. The ini- tial value for this toggle is FALSE.

termdata Toggles the display of all terminal data (in hexadecimal format). The initial value for this toggle is FALSE.

verbose_encrypt When the verbose_encrypt toggle is TRUE, telnet prints out a message each time encryption is enabled or disabled. The initial value for this toggle is FALSE.

? Displays the legal toggle commands.

z Suspend telnet. This command only works when the user isusing the csh(1).

! [command]Execute a single command in a subshell on the local system.If command is omitted, then an interactive subshell isinvoked.

? [command]Get help. With no arguments, telnet prints a help summary.If a command is specified, telnet will print the help informa-tion for just that command.

ENVIRONMENT telnet uses at least the HOME, SHELL, DISPLAY, and TERM environment vari- ables. Other environment variables may be propagated to the other side via the TELNET ENVIRON option.

FILES ~/.telnetrc user customized telnet startup values

HISTORY The telnet command appeared in 4.2BSD.

NOTES On some remote systems, echo has to be turned off manually when in ``old line by line'' mode.

In ``old line by line'' mode or LINEMODE the terminal's eof character is only recognized (and sent to the remote system) when it is the first character on a line.

Source routing is not supported yet for IPv6.

BSD February 3, 1994 BSD

Page 138: Man Des Commandes Linux

�-�

������ �����������'���������� ���������

NAME top - display top CPU processes

SYNOPSIS top [-] [d delay] [p pid] [q] [c] [C] [S] [s] [i] [n iter] [b]

DESCRIPTION top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive inter- face for manipulating processes. It can sort the tasks by CPU usage, memory usage and runtime. can be better con- figured than the standard top from the procps suite. Most features can either be selected by an interactive command or by specifying the feature in the personal or system- wide configuration file. See below for more information.

COMMAND-LINE OPTIONS d Specifies the delay between screen updates. You can

change this with the s interactive command.

p Monitor only processes with given process id. This flag can be given up to twenty times. This option is neither available interactively nor can it be put into the configuration file.

q This causes top to refresh without any delay. If the caller has superuser priviledges, top runs with the highest possible priority.

S Specifies cumulative mode, where each process is listed with the CPU time that it as well as its dead children has spent. This is like the -S flag to ps(1). See the discussion below of the S interactive command.

s Tells top to run in secure mode. This disables the potentially dangerous of the interactive commands (see below). A secure top is a nifty thing to leave running on a spare terminal.

i Start top ignoring any idle or zombie processes. See the interactive command i below.

C display total CPU states in addition to individual CPUs. This option only affects SMP systems.

c display command line instead of the command name only. The default behaviour has been changed as this seems to be more useful.

n Number of iterations. Update the display this number of times and then exit.

b Batch mode. Useful for sending output from top to other programs or to a file. In this mode, top will not accept command line input. It runs until it pro- duces the number of iterations requested with the n option or until killed. Output is plain text suitable for display on a dumb terminal.

�-'

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 the s interactive command.

uptime This line displays the time the system has been up, and the three load averages for the system. The load averages are the average number of process ready to run during the last 1, 5 and 15 minutes. This line is just like the output of uptime(1). The uptime display may be toggled by the interactive l command.

processes The total number of processes running at the time of the last update. This is also broken down into the number of tasks which are running, sleeping, stopped, or undead. The processes and states display may be toggled by the t interactive command.

CPU states Shows the percentage of CPU time in user mode, system mode, niced tasks, and idle. (Niced tasks are only those whose nice value is negative.) Time spent in niced tasks will also be counted in system and user time, so the total will be more than 100%. The pro- cesses and states display may be toggled by the t interactive command.

Mem Statistics on memory usage, including total available memory, free memory, used memory, shared memory, and memory used for buffers. The display of memory infor- mation may be toggled by the m interactive command.

Swap Statistics on swap space, including total swap space, available swap space, and used swap space. This and Mem are just like the output of free(1).

PID The process ID of each task.

PPID The parent process ID each task.

UID The user ID of the task's owner.

USER The user name of the task's owner.

PRI The priority of the task.

NI The nice value of the task. Negative nice values are higher priority.

SIZE The size of the task's code plus data plus stack space, in kilobytes, is shown here.

TSIZE The code size of the task. This gives strange values for kernel processes and is broken for ELF processes.

DSIZE Data + Stack size. This is broken for ELF processes.

TRS Text resident size.

SWAP Size of the swapped out part of the task.

Page 139: Man Des Commandes Linux

�--

D Size of pages marked dirty.

LC Last used processor. (That this changes from time to time is not a bug; Linux intentionally uses weak affinity. Also notice that the very act of running top may break weak affinity and cause more processes to change current CPU more often because of the extra demand for CPU time.)

RSS The total amount of physical memory used by the task, in kilobytes, is shown here. For ELF processes used library pages are counted here, for a.out processes not.

SHARE The amount of shared memory used by the task is shown in this column.

STAT The state of the task is shown here. The state is either S for sleeping, D for uninterruptible sleep, R for running, Z for zombies, or T for stopped or traced. These states are modified by trailing < for a process with negative nice value, N for a process with positive nice value, W for a swapped out process (this does not work correctly for kernel processes).

WCHAN depending on the availablity of either /boot/psdatabase or the kernel link map /boot/Sys- tem.map this shows the address or the name of the kernel function the task currently is sleeping in.

TIME Total CPU time the task has used since it started. If cumulative mode is on, this also includes the CPU time used by the process's children which have died. You can set cumulative mode with the S command line option or toggle it with the interactive command S. The header line will then be changed to CTIME.

%CPU The task's share of the CPU time since the last screen update, expressed as a percentage of total CPU time per processor.

%MEM The task's share of the physical memory.

COMMAND The task's command name, which will be truncated if it is too long to be displayed on one line. Tasks in memory will have a full command line, but swapped-out tasks will only have the name of the program in parentheses (for example, "(getty)").

A , WP these fields from the kmem top are not supported.

INTERACTIVE COMMANDS Several single-key commands are recognized while top is running. Some are disabled if the s option has been given on the command line.

space Immediately updates the display.

^L Erases and redraws the screen.

h or ? Displays a help screen giving a brief summary of com-

�-&

mands, and the status of secure and cumulative modes.

k Kill a process. You will be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt, kill, send signal 9. The default signal, as with kill(1), is 15, SIGTERM. This command is not avail- able in secure mode.

i Ignore idle and zombie processes. This is a toggle switch.

I Toggle between Solaris (CPU percentage divided by total number of CPUs) and Irix (CPU percentage calcu- lated solely by amount of time) views. This is a toggle switch that affects only SMP systems.

n or # Change the number of processes to show. You will be prompted to enter the number. This overrides auto- matic determination of the number of processes to show, which is based on window size measurement. If 0 is specified, then top will show as many processes as will fit on the screen; this is the default.

q Quit.

r Re-nice a process. You will be prompted for the PID of the task, and the value to nice it to. Entering a positve value will cause a process to be niced to negative values, and lose priority. If root is run- ning top, a negative value can be entered, causing a process to get a higher than normal priority. The default renice value is 10. This command is not available in secure mode.

S This toggles cumulative mode, the equivalent of ps -S, i.e., that CPU times will include a process's defunct children. For some programs, such as compil- ers, which work by forking into many seperate tasks, normal mode will make them appear less demanding than they actually are. For others, however, such as shells and init, this behavior is correct. In any case, try cumulative mode for an alternative view of CPU use.

s Change the delay between updates. You will be prompted to enter the delay time, in seconds, between updates. Fractional values are recognized down to microseconds. Entering 0 causes continuous updates. The default value is 5 seconds. Note that low values cause nearly unreadably fast displays, and greatly raise the load. This command is not available in secure mode.

f or F Add fields to display or remove fields from the dis- play. See below for more information.

o or O Change order of displayed fields. See below for more information.

l toggle display of load average and uptime information.

m toggle display of memory information.

Page 140: Man Des Commandes Linux

�-0

t toggle display of processes and CPU states informa- tion.

c toggle display of command name or full command line.

N sort tasks by pid (numerically).

A sort tasks by age (newest first).

P sort tasks by CPU usage (default).

M sort tasks by resident memory usage.

T sort tasks by time / cumulative time.

W Write current setup to ~/.toprc. This is the recom- mended way to write a top configuration file.

The Field and Order Screens After pressing f, F, o or O you will be shown a screen specifying the field order on the top line and short descriptions of the field contents. The field order string uses the following syntax: If the letter in the filed string corresponding to a field is upper case, the field will be displayed. This is furthermore indicated by an asterisk in front of the field description. The order of the fields corresponds to the order of the letters in the string.

From the field select screen you can toggle the display of a field by pressing the corresponding letter.

From the order screen you may move a field to the left by pressing the corresponding upper case letter resp. to the right by pressing the lower case one.

Configuration Files Top reads it's default configuration from two files, /etc/toprc and ~/.toprc. The global configuration file may be used to restrict the usage of top to the secure mode for non-priviledged users. If this is desired, the file should contain a 's' to specify secure mode and a digit d (2<=d<=9) for the default delay (in seconds) on a single line. The personal configuration file contains two lines. The first line contains lower and upper letters to specify which fields in what order are to be displayed. The letters correspond to the letters in the Fields or Order screens from top. As this is not very instructive, it is recommended to select fields and order in a running top process and to save this using the W interactive com- mand. The second line is more interesting (and impor- tant). It contains information on the other options. Most important, if you have saved a configuration in secure mode, you will not get an insecure top without removing the lower 's' from the second line of your ~/.toprc. A digit specifies the delay time between updates, a capital '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 default sorting order (by CPU usage) is not supported.

NOTES 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.

%CPU shows the cputime/realtime percentage in the period

�&*

of time between updates. For the first update, a short delay is used, and top itself dominates the CPU usage. After that, top will drop back, and a more reliable esti- mate of CPU usage is available.

The SIZE and RSS fields don't count the page tables and the task_struct of a process; this is at least 12K of mem- ory that is always resident. SIZE is the virtual size of the process (code+data+stack).

Keep in mind that a process must die for its time to be recorded on its parent by cumulative mode. Perhaps more useful behavior would be to follow each process upwards, adding time, but that would be more expensive, possibly prohibitively so. In any case, that would make top's behavior incompatible with ps.

FILES /etc/toprc The global configuration file. ~/.toprc The personal configuration file.

SEE ALSO ps(1), free(1), uptime(1), kill(1), renice(1).

BUGS If the window is less than about 70x7, top will not format information correctly.

Many fields still have problems with ELF processes.the help screens are not yet optimized for windows with

less than 25 lines

AUTHOR top was originally written by Roger Binns, based on Branko Lankester's <[email protected]> ps program. Robert Nation <[email protected]> re-wrote it significantly to use the proc filesystem, based on Michael K. Johnson's <[email protected]> proc-based ps program. Michael Shields <[email protected]> made many changes, including secure and cumulative modes and a gen- eral cleanup. Tim Janik <[email protected]> added age sorting and the ability to monitor specific processes through their ids.

Helmut Geyer <[email protected]> Heavily changed it to include support for configurable fields and other new options, and did further cleanup and use of the new readproc interface.

The "b" and "n" options contributed by George Bonser <[email protected]> for CapTech IT Services.

Michael K. Johnson <[email protected]> is now the main- tainer.

Please send bug reports to <[email protected]>

Linux Feb 1 1993 TOP(1)

��0���� ������� ����������������� ����0����

NOM tty - Afficher le nom du terminal associe à l'entrée stan-

Page 141: Man Des Commandes Linux

�&�

dard.

SYNOPSIS tty [-s] [--silent] [--quiet] [--help] [--version]

DESCRIPTION Cette page de manuel documente la version GNU de tty.

tty affiche le nom de fichier du tty associé à son entrée standard. Il affiche `not a tty' si l'entrée standard n'est pas un terminal.

Son code de retour vaut : 0 si l'entrée standard est un tty 1 si l'entrée standard n'est pas un tty 2 si un argument est incorrect 3 s'il y a eu une erreur d'écriture

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

et terminer normalement.

-s, --silent, --quiet Ne rien afficher, renvoyer simplement le code de retour.

--version Afficher un numéro de version sur la sortie stan- dard et terminer normalement.

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 TTY(1L)

' ��%���� ������� ����������������� ' ��%����

NOM uname - Afficher des informations sur le système.

SYNOPSIS uname [-snrvma] [--sysname] [--nodename] [--release] [--machine] [--all] [--help] [--version]

DESCRIPTION Cette page de manuel documente la version GNU de uname.

uname affiche des informations concernant la machine et le système d'exploitation sur lequel il est invoqué.

Si aucune option n'est fournie, uname agit comme si l'argument -s était indiqué.

Si plusieurs options sont indiquées, ou si l'argument -a est fourni, les informations sont affichées dans l'ordre `snrvm' avec un espace entre chaque élément.

OPTIONS -m, --machine

Afficher le type (matériel) de machine.

�&�

-n, --nodename Afficher le nom d'hôte de la machine sur le réseau.

-r, --release Afficher le numéro de version du système d'exploitation.

-s, --sysname Afficher le nom du système d'exploitation.

-v Afficher la version du système d'exploitation.

-a, --all Afficher toutes les informations décrites ci- dessus.

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

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 UNAME(1L)

'�#��%#����� �����'�#��%#�����

NAME updatedb - update the slocate database

SYNOPSIS updatedb [-u] [-u path] [-e path1,path2,...] [-f fstype1,...] [-l [01] ] [-q] [-v,--verbose] [-V, --ver- sion] [-h, --help] pattern...

DESCRIPTION This manual page documents slocate, a security-enhanced version of locate. updatedb is simply a link to slocate that implies the -u option.

OPTIONS -u Create slocate database starting at the root direc-

tory. This is the default behavior when called as updatedb.

-U path Create slocate database starting at path path.

-e dirs Exclude directories in the comma-separated list dirs from the slocate database.

-f fstypes Exclude file systems in the comma-separated list dirs from the slocate database.

Page 142: Man Des Commandes Linux

�&�

-l <num> Security level. -l 0 turns security checks off, which will make searches faster. -l 1 turns secu- rity checks on. This is the default.

-q Quiet mode; error messages are suppressed.

-v Verbose mode; display files indexed when creating database

--help Print a summary of the options to slocate and exit.

--version Print the version number of slocate and exit.

ENVIRONMENT SEE ALSO

locate(1L),

UPDATEDB(1L)

'(%��##�"� �������'(%��##�"�

NAME useradd - Create a new user or update default new user information

SYNOPSIS useradd [-c comment] [-d home_dir]

[-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir] | -M] [-p passwd] [-s shell] [-u uid [ -o]] [-n] [-r] login

useradd -D [-g default_group] [-b default_home] [-f default_inactive] [-e default_expire_date] [-s default_shell]

DESCRIPTION Creating New Users When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line and the default values from the system. The new user account will be entered into the system files as needed, the home directory will be created, and initial files copied, depending on the command line options. The version provided with Red Hat Linux will create a group for each user added to the system, unless -n option is given. The options which apply to the useradd command are

-c comment The new user's password file comment field.

-d home_dir The new user will be created using home_dir as the value for the user's login directory. The default is to append the login name to default_home and use that as the login directory name.

-e expire_date

�&!

The date on which the user account will be dis- abled. The date is specified in the format YYYY- MM-DD.

-f inactive_days The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of -1 disables the feature. The default value is -1.

-g initial_group The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1.

-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. 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 contained in skeleton_dir or /etc/skel will be cre- ated in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not copy any files.

-M The user home directory will not be created, even if the system wide settings from /etc/login.defs is to create home dirs.

-n A group having the same name as the user being added to the system will be created by default. This option will turn off this Red Hat Linux spe- cific behavior.

-r This flag is used to create a system account. That is, an user with an UID lower than value of UID_MIN defined in /etc/login.defs. Note that useradd will not create a home directory for such an user, regardless of the default setting in /etc/login.defs. You have to specify -m option if you want a home directory for a system account to be created. This is an option added by Red Hat.

-p passwd The encrypted password, as returned by crypt(3). The default is to disable the account.

-s shell The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell.

-u uid The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than 99 and greater

Page 143: Man Des Commandes Linux

�&�

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 values from the command line. The valid options are

-b default_home The initial path prefix for a new user's home directory. The user's name will be affixed to the end of default_home to create the new directory name if the -d option is not used when creating a new account.

-e default_expire_date The date on which the user account is disabled.

-f default_inactive The number of days after a password has expired before the account will be disabled.

-g default_group The group name or ID for a new user's initial group. The named group must exist, and a numerical group ID must have an existing entry .

-s default_shell The name of the new user's login shell. The named program will be used for all future new user accounts.

If no options are specified, useradd displays the current default values.

NOTES The system administrator is responsible for placing the default user files in the /etc/skel directory. This version of useradd was modified by Red Hat to suit Red Hat user/group conventions.

CAVEATS You may not add a user to an NIS group. This must be per- 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 /etc/default/useradd - default information /etc/login.defs - system-wide settings /etc/skel - directory containing default files

SEE ALSO chfn(1), chsh(1), crypt(3), groupadd(8), groupdel(8), groupmod(8), passwd(1), userdel(8), usermod(8)

AUTHOR Julianne Frances Haugh ([email protected])

USERADD(8)

�&'

'(%�#%��"� �������'(%�#%��"�

NAME userdel - Delete a user account and related files

SYNOPSIS userdel [-r] login

DESCRIPTION The userdel command modifies the system account files, deleting all entries that refer to login. The named user must exist.

-r Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually.

FILES /etc/passwd - user account information /etc/shadow - secure user account information /etc/group - group information

CAVEATS userdel will not allow you to remove an account if the user is currently logged in. You must kill any running processes which belong to an account that you are delet- ing. You may not remove any NIS attributes on an NIS client. This must be performed on the NIS server.

SEE ALSO chfn(1), chsh(1), groupadd(8), groupdel(8), groupmod(8), passwd(1), useradd(8), usermod(8)

AUTHOR Julianne Frances Haugh ([email protected])

USERDEL(8)

$ ��� �����������'���������� �����$ ���

NAME w - Show who is logged on and what they are doing.

SYNOPSIS w - [husfV] [user]

DESCRIPTION w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been 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 name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process.

Page 144: Man Des Commandes Linux

�&-

The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.

The PCPU time is the time used by the current process, named in the "what" field.

COMMAND-LINE OPTIONS -h Don't print the header.

-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".

-s Use the short format. Don't print the login time, JCPU or PCPU times.

-f Toggle printing the from (remote hostname) field. 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.

FILES /etc/utmp information about who is currently logged on /proc process information

SEE ALSO free(1), ps(1), top(1), uptime(1), utmp(5), who(1)

AUTHORS w was re-written almost entirely by Charles Blake, based on the version by Larry Greenfield <[email protected] gers.edu> and Michael K. Johnson <[email protected]>.

Please send bug reports to <[email protected]>

8 Dec 1993 W(1)

$������ ������� ����������������� ��$������

NOM wall -- Envoyer un message sur les terminaux de tout les utilisateurs.

SYNOPSIS wall [ message ]

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

�&&

Le message peut être fourni en tant qu'argument sur la ligne de commande, ou il peut être envoyé dans l'entrée standard de wall. Quant l'entrée standard est un termi- nal, le message doit se terminer par la touche EOF (la plupart du temps Controle-D).

VOIR AUSSI mesg(1).

AUTHOR Miquel van Smoorenburg, [email protected]

TRADUCTION Christophe Blaess, 1997.

Linux 16 Avril 1997 WALL(1)

$������� �����������'���������� �$�������

NAME watch - execute a program periodically, showing output fullscreen

SYNOPSIS watch [-dhv] [-n <seconds>] [--differences[=cumulative]] [--help] [--interval=<seconds>] [--version] <command>

DESCRIPTION watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds; use -n or --interval to specify a differ- ent interval.

The -d or --differences flag will highlight the differ- ences between successive updates. The --cumulative option makes highlighting "sticky", presenting a running display of all positions that have ever changed.

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 watch itself.

EXAMPLES To watch for mail, you might do

watch -n 60 from

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

watch -d ls -l

Page 145: Man Des Commandes Linux

�&0

If you're only interested in files owned by user joe, you might use

watch -d 'ls -l | fgrep joe'

To see the effects of quoting, try these out

watch echo $$

watch echo '$$'

watch echo "'"'$$'"'"

You can watch for your administrator to install the latest kernel with

watch uname -r

(Just kidding.)

BUGS Upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All --differ- ences highlighting is lost on that update as well.

Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them.

AUTHORS The original watch was written by Tony Rems <[email protected]> in 1991, with mods and corrections by Francois Pinard. It was reworked and new features added by Mike Coleman <[email protected]> in 1999.

1999 Apr 3 WATCH(1)

$���� ������� ����������������� ����$ ����

NOM wc - Afficher le nombre d'octets, de mots et de lignes d'un fichier.

SYNOPSIS wc [-clw] [--bytes] [--chars] [--lines] [--words] [--help] [--version] [fichier...]

DESCRIPTION Cette page de manuel documente la version GNU de wc ([NDT] wc = Word Count).

wc compte le nombre d'octets, de mots séparés par des blancs, et de sauts de lignes (NewLines) dans chacun des fichiers indiqués.

Si aucun fichier n'est fourni, ou si le nom `-' est men- tionné, la lecture se fait depuis l'entrée standard.

Une ligne de statistiques est affichée pour chaque

�0*

fichier, précédée du nom du fichier s'il a été indiqué en argument.

Si plusieurs fichiers sont mentionnés, wc ajoute une ligne finale de statistiques, contenant le cumul des valeurs, précédé du nom `total'. Les statistiques sont affichées dans l'ordre suivant : nombre de lignes, de mots, et d'octets.

Par défaut wc affiche les trois valeurs. Les options per- mettent de n'en afficher que certaines d'entre elles. Les options ne se surchargent pas, mais cumulent leurs effets, ainsi wc --bytes --words affiche à la fois le nombre d'octets et de mots.

OPTIONS -c, --bytes, --chars

Afficher uniquement le nombre d'octets.

-w, --words Afficher uniquement le nombre de mots

-l, --lines Afficher uniquement le nombre de sauts de lignes

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

TRADUCTION Christophe Blaess, 1997.

FSF 13 Janvier 1997 WC(1)

$������ ������� ����������������� ��$ ������

NOM who - Montrer qui est connecté.

SYNOPSIS who [-imqsuwHT] [--count] [--idle] [--heading] [--help] [--message] [--mesg] [--version] [--writable] [fichier] [am i]

DESCRIPTION Cette page de manuel documente la version GNU de who.

Si aucun argument n'est fourni, hormis d'éventuelles options, who affiche les informations suivantes pour chaque utilisateur connecté :

nom de connexion terminal heure de connexion nom d'hote distant, ou numéro de terminal X

Page 146: Man Des Commandes Linux

�0�

Si un argument est fourni qui ne soit pas une option, who 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.

Si deux arguments ne représentant pas des options sont fournis, who affiche seulement les informations concernant l'utilisateur qui l'a invoqué (ceci étant déterminé grâce à son entrée standard), précédé du nom d'hôte. Tradition- nellement, les deux arguments sont `am i', comme dans `who am i'. ([NDT] Mais ca marche aussi tres bien avec `who suis je' ;-)

OPTIONS -m Identique `who am i'.

-q, --count Affiche uniquement les noms d'utilisateurs et le nombres de personnes connectées. Ceci a priorité sur toutes les autres options.

-s Sans effet - uniquement pour assurer la compati- bilité avec d'autres versions de who.

-i, -u, --idle Après l'heure de connexion, affiche le nombre d'heures et de minutes d'inactivité (idle) de l'utilisateur. `.' signifie que l'utilisateur a été actif durant la dernière minute. `old' signi- fie que l'utilisateur a été inactif pendant plus de 24 heures.

-H, --heading Afficher une ligne de libellé pour les colonnes.

-w, -T, --mesg, --message, --writable Comme -s, mais ajoute après le nom de connexion un caractère indiquant le statut de l'utilisateur vis à vis des messages :

+ les messages émis par write sont autorisés

- les messages émis par write ne sont pas autorisés

? impossible de trouver le périphérique du terminal

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

TRADUCTION Christophe Blaess, 1997.

FSF 9 Janvier 1997 WHO(1L)

�0�

$���%��� �������� �1�*+��&&������ �$���%���

NOM write - Envoyer un message à un autre utilisateur.

SYNOPSIS write utilisateur [nom_terminal]

DESCRIPTION Write vous permet de communiquer avec d'autres utilisa- teurs, en copiant des lignes de votre terminal sur le leur.

Quand vous exécutez la commande write , l'utilisateur à qui vous écrivez reçoit un message de la forme :

Message de votrenom@votremachine sur votreterminal à hh:mm ...

Toutes les lignes suivantes que vous entrerez seront copiées sur le terminal de l'utilisateur spécifié. Si l'autre utilisateur veut répondre, il doit également lancer write.

Quand vous avez terminé, entrez un caractère de fin de fichier (EOF) ou bien un caractère d'interruption. L'autre utilisateur verra le message EOF qui indique que la conversation est terminée.

Vous pouvez empêcher quiconque (à l'exception du super-utilisateur) d'écrire sur votre terminal en util- isant la commande mesg(1). Certaines commandes, par exem- ple nroff(1) et pr(1), peuvent désactiver automatiquement l'écriture sur votre terminal, de sorte que leur sortie ne soit pas écrasée.

Si l'utilisateur que vous voulez joindre est connecté sur plus d'un terminal, vous pouvez spécifier sur quel termi- nal écrire en spécifiant le nom du terminal comme second argument à la commande write. Sinon, vous pouvez laisser write sélectionner un des terminaux ; il prendra celui en activité depuis le moins longtemps, pour que si l'utilisa- teur est connecté au travail et s'est connecté ensuite à la maison, le message ira au bon endroit (à la maison).

L'arrangement traditionnel utilisé pour écrire à quelqu'un est que quand la chaîne de caractères "-o" est placée dans 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 personne concernée croit que la conversation est terminée.

VOIR AUSSI mesg(1), talk(1), who(1)

HISTORIQUE Une commande write est apparue dans la version 6 de UNIX AT&T.

TRADUCTION Frédéric Delanoy, 2000.

Page 147: Man Des Commandes Linux

�0�

Linux 7 Août 2000 WRITE(1)

.�2�� �����.!���"3 ����.�2��

NAME X - a portable, network-transparent window system

SYNOPSIS The X Window System is a network transparent window system which runs on a wide range of computing and graphics machines. It should be relatively straightforward to build the X Consortium software distribution on most ANSI C and POSIX compliant systems. Commercial implementations are also available for a wide range of platforms.

The X Consortium requests that the following names be used when referring to this software:

X X Window System X Version 11

X Window System, Version 11 X11

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

DESCRIPTION X Window System servers run on computers with bitmap dis- plays. The server distributes user input to and accepts output requests from various client programs through a variety of different interprocess communication channels. Although the most common case is for the client programs to be running on the same machine as the server, clients can be run transparently from other machines (including machines with different architectures and operating sys- tems) as well.

X supports overlapping hierarchical subwindows and text and graphics operations, on both monochrome and color dis- plays. For a full explanation of the functions that are available, see the Xlib - C Language X Interface manual, the X Window System Protocol specification, the X Toolkit Intrinsics - C Language Interface manual, and various toolkit documents.

The number of programs that use X is quite large. Pro- grams provided in the core X Consortium distribution include: a terminal emulator, xterm; a window manager, twm; a display manager, xdm; a console redirect program, xconsole; a mail interface, xmh; a bitmap editor, bitmap; resource listing/manipulation tools, appres, editres; access control programs, xauth, xhost, and iceauth; user preference setting programs, xrdb, xcmsdb, xset, xsetroot, xstdcmap, and xmodmap; clocks, xclock and oclock; a font displayer, (xfd; utilities for listing information about fonts, windows, and displays, xlsfonts, xwininfo, xlsclients, xdpyinfo, xlsatoms, and xprop; screen image manipulation utilities, xwd, xwud, and xmag; a performance measurement utility, x11perf; a font compiler, bdftopcf; a font server and related utilities, xfs, fsinfo, fslsfonts, fstobdf; an X Image Extension exerciser, xieperf; a dis-

�0!

play server and related utilities, Xserver, rgb, mkfont- 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, 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 or all of the screen to be redrawn, xrefresh.

Many other utilities, window managers, games, toolkits, etc. are included as user-contributed software in the X Consortium distribution, or are available using anonymous ftp on the Internet. See your site administrator for details.

STARTING UP There are two main ways of getting the X server and an initial set of client applications started. The particu- lar method used depends on what operating system you are running and whether or not you use other window systems in addition to X.

xdm (the X Display Manager) If you want to always have X running on your dis- play, your site administrator can set your machine up to use the X Display Manager xdm. This program is typically started by the system at boot time and takes care of keeping the server running and getting users logged in. If you are running xdm, you will see a window on the screen welcoming you to the system and asking for your username and password. Simply type them in as you would at a normal terminal, pressing the Return key after each. If you make a mistake, xdm will display an error message and ask you to try again. After you have successfully logged in, xdm will start up your X environment. By default, if you have an executable file named .xsession in your home directory, xdm will treat it as a program (or shell script) to run to start up your initial clients (such as terminal emulators, clocks, a window manager, user settings for things like the background, the speed of the pointer, etc.). Your site administrator can provide details.

xinit (run manually from the shell) Sites that support more than one window system might choose to use the xinit program for starting X manually. If this is true for your machine, your site administrator will probably have pro- vided a program named "x11", "startx", or "xstart" that will do site-specific initialization (such as loading convenient default resources, running a window manager, displaying a clock, and starting several terminal emulators) in a nice way. If not, you can build such a script using the xinit program. This utility simply runs one user-speci- fied program to start the server, runs another to start up any desired clients, and then waits for either to finish. Since either or both of the user-specified programs may be a shell script, this gives substantial flexibility at the expense of a nice interface. For this reason, xinit is not intended for end users.

Page 148: Man Des Commandes Linux

�0�

DISPLAY NAMES From the user's perspective, every X server has a display name of the form:

hostname:displaynumber.screennumber

This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple moni- tors):

hostname The hostname specifies the name of the machine to which the display is physically connected. If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used.

displaynumber The phrase "display" is usually used to refer to collection of monitors that share a common key- board and pointer (mouse, tablet, etc.). Most workstations tend to only have one keyboard, and therefore, only one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a display number (beginning at 0) when the X server for that display is started. The display number must always be given in a display name.

screennumber Some displays share a single keyboard and pointer among two or more monitors. Since each monitor has its own set of windows, each screen is assigned a screen number (beginning at 0) when the X server for that display is started. If the screen number is not given, screen 0 will be used.

On POSIX systems, the default display name is stored in your DISPLAY environment variable. This variable is set automatically by the xterm terminal emulator. However, when you log into another machine on a network, you will need to set DISPLAY by hand to point to your display. For example,

% setenv DISPLAY myws:0 $ DISPLAY=myws:0; export DISPLAY

The xon script can be used to start an X program on a remote machine; it automatically sets the DISPLAY variable correctly.

Finally, most X programs accept a command line option of -display displayname to temporarily override the contents of DISPLAY. This is most commonly used to pop windows on another person's screen or as part of a "remote shell" command to start an xterm pointing back to your display. For example,

% xeyes -display joesws:0 -geometry 1000x1000+0+0 % rsh big xterm -display myws:0 -ls </dev/null &

X servers listen for connections on a variety of different communications channels (network byte streams, shared mem- ory, etc.). Since there can be more than one way of con-

�0'

tacting a given server, The hostname part of the display name is used to determine the type of channel (also called a transport layer) to be used. X servers generally support the following types of connections:

local The hostname part of the display name should be the empty string. For example: :0, :1, and :0.1. The most efficient local transport will be chosen.

TCPIP The hostname part of the display name should be the server machine's IP address name. Full Inter- net names, abbreviated names, and IP addresses are all allowed. For example: x.org:0, expo:0, 198.112.45.11:0, bigmachine:1, and hydra:0.1.

DECnet The hostname part of the display name should be the server machine's nodename, followed by two colons instead of one. For example: myws::0, big::1, and hydra::0.1.

ACCESS CONTROL An X server can use several types of access control. Mechanisms provided in Release 6 are:

Host Access Simple host-based access control. MIT-MAGIC-COOKIE-1 Shared plain-text "cookies". XDM-AUTHORIZATION-1 Secure DES based private-keys. SUN-DES-1 Based on Sun's secure rpc system. MIT-KERBEROS-5 Kerberos Version 5 user-to-user.

Xdm initializes access control for the server and also places authorization information in a file accessible to the user. Normally, the list of hosts from which connec- tions are always accepted should be empty, so that only clients with are explicitly authorized can connect to the display. When you add entries to the host list (with xhost), the server no longer performs any authorization on connections from those machines. Be careful with this.

The file from which Xlib extracts authorization data can be specified with the environment variable XAUTHORITY, and defaults to the file .Xauthority in the home directory. Xdm uses $HOME/.Xauthority and will create it or merge in authorization records if it already exists when a user logs in.

If you use several machines and share a common home direc- tory across all of the machines by means of a network file system, you never really have to worry about authorization files, the system should work correctly by default. Oth- erwise, as the authorization files are machine-indepen- dent, you can simply copy the files to share them. To manage authorization files, use xauth. This program allows you to extract records and insert them into other files. Using this, you can send authorization to remote machines when you login, if the remote machine does not share a common home directory with your local machine. Note that authorization information transmitted ``in the clear'' through a network file system or using ftp or rcp can be ``stolen'' by a network eavesdropper, and as such may enable unauthorized access. In many environments, this level of security is not a concern, but if it is, you need to know the exact semantics of the particular autho- rization data to know if this is actually a problem.

Page 149: Man Des Commandes Linux

�0-

For more information on access control, see the Xsecurity manual page.

GEOMETRY SPECIFICATIONS 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. Although the layout of windows on a display is controlled by the window manager that the user is running (described below), most X programs accept a command line argument of the form -geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF, and YOFF are numbers) for specifying a pre- ferred size and location for this application's main win- dow.

The WIDTH and HEIGHT parts of the geometry specification are usually measured in either pixels or characters, depending on the application. The XOFF and YOFF parts are measured in pixels and are used to specify the distance of the window from the left or right and top and bottom edges of the screen, respectively. Both types of offsets are measured from the indicated edge of the screen to the cor- responding edge of the window. The X offset may be speci- fied in the following ways:

+XOFF The left edge of the window is to be placed XOFF pixels in from the left edge of the screen (i.e., the X coordinate of the window's origin will be XOFF). XOFF may be negative, in which case the window's left edge will be off the screen.

-XOFF The right edge of the window is to be placed XOFF pixels in from the right edge of the screen. XOFF may be negative, in which case the window's right edge will be off the screen.

The Y offset has similar meanings:

+YOFF The top edge of the window is to be YOFF pixels below the top edge of the screen (i.e., the Y coordinate of the window's origin will be YOFF). YOFF may be negative, in which case the window's top edge will be off the screen.

-YOFF The bottom edge of the window is to be YOFF pixels above the bottom edge of the screen. YOFF may be negative, in which case the window's bottom edge will be off the screen.

Offsets must be given as pairs; in other words, in order to specify either XOFF or YOFF both must be present. Win- dows can be placed in the four corners of the screen using the following specifications:

+0+0 upper left hand corner.

-0+0 upper right hand corner.

-0-0 lower right hand corner.

+0-0 lower left hand corner.

In the following examples, a terminal emulator is placed in roughly the center of the screen and a load average monitor, mailbox, and clock are placed in the upper right hand corner:

�0&

xterm -fn 6x10 -geometry 80x24+30+200 & xclock -geometry 48x48-0+0 & xload -geometry 48x48-96+0 & xbiff -geometry 48x48-48+0 &

WINDOW MANAGERS The layout of windows on the screen is controlled by spe- cial programs called window managers. Although many win- dow managers will honor geometry specifications as given, others may choose to ignore them (requiring the user to explicitly draw the window's region on the screen with the pointer, for example).

Since window managers are regular (albeit complex) client programs, a variety of different user interfaces can be built. The X Consortium distribution comes with a window manager named twm which supports overlapping windows, popup menus, point-and-click or click-to-type input mod- els, title bars, nice icons (and an icon manager for those who don't like separate icon windows).

See the user-contributed software in the X Consortium dis- tribution for other popular window managers.

FONT NAMES Collections of characters for displaying text and symbols in X are known as fonts. A font typically contains images that share a common appearance and look nice together (for example, a single size, boldness, slant, and character set). Similarly, collections of fonts that are based on a common type face (the variations are usually called roman, bold, italic, bold italic, oblique, and bold oblique) are called families.

Fonts come in various sizes. The X server supports scal- able fonts, meaning it is possible to create a font of arbitrary size from a single source for the font. The server supports scaling from outline fonts and bitmap fonts. Scaling from outline fonts usually produces sig- nificantly better results than scaling from bitmap fonts.

An X server can obtain fonts from individual files stored in directories in the file system, or from one or more font servers, or from a mixtures of directories and font servers. The list of places the server looks when trying to find a font is controlled by its font path. Although most installations will choose to have the server start up with all of the commonly used font directories in the font path, the font path can be changed at any time with the xset program. However, it is important to remember that the directory names are on the server's machine, not on the application's.

Bitmap font files are usually created by compiling a tex- tual font description into binary form, using bdftopcf. Font databases are created by running the mkfontdir pro- gram in the directory containing the source or compiled versions of the fonts. Whenever fonts are added to a directory, mkfontdir should be rerun so that the server can find the new fonts. To make the server reread the font database, reset the font path with the xset program. For example, to add a font to a private directory, the following commands could be used:

% cp newfont.pcf ~/myfonts

Page 150: Man Des Commandes Linux

�00

% mkfontdir ~/myfonts % xset fp rehash

The xfontsel and xlsfonts programs can be used to browse through the fonts available on a server. Font names tend to be fairly long as they contain all of the information needed to uniquely identify individual fonts. However, the X server supports wildcarding of font names, so the full specification

-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1

might be abbreviated as:

-*-courier-medium-r-normal--*-100-*-*-*-*-iso8859-1

Because the shell also has special meanings for * and ?, wildcarded font names should be quoted:

% xlsfonts -fn '-*-courier-medium-r-normal--*-100-*-*-*-*-*-*'

The xlsfonts program can be used to list all of the fonts that match a given pattern. With no arguments, it lists all available fonts. This will usually list the same font at many different sizes. To see just the base scalable font names, try using one of the following patterns:

-*-*-*-*-*-*-0-0-0-0-*-0-*-* -*-*-*-*-*-*-0-0-75-75-*-0-*-* -*-*-*-*-*-*-0-0-100-100-*-0-*-*

To convert one of the resulting names into a font at a specific size, replace one of the first two zeros with a nonzero value. The field containing the first zero is for the pixel size; replace it with a specific height in pix- els to name a font at that size. Alternatively, the field containing the second zero is for the point size; replace it with a specific size in decipoints (there are 722.7 decipoints to the inch) to name a font at that size. The last zero is an average width field, measured in tenths of pixels; some servers will anamorphically scale if this value is specified.

FONT SERVER NAMES One of the following forms can be used to name a font server that accepts TCP connections:

tcp/hostname:port tcp/hostname:port/cataloguelist

The hostname specifies the name (or decimal numeric address) of the machine on which the font server is run- ning. The port is the decimal TCP port on which the font server is listening for connections. The cataloguelist specifies a list of catalogue names, with '+' as a separa- tor.

Examples: tcp/x.org:7100, tcp/198.112.45.11:7100/all.

One of the following forms can be used to name a font server that accepts DECnet connections:

decnet/nodename::font$objname decnet/nodename::font$objname/cataloguelist

The nodename specifies the name (or decimal numeric address) of the machine on which the font server is run-

�**

ning. The objname is a normal, case-insensitive DECnet object name. The cataloguelist specifies a list of cata- logue names, with '+' as a separator.

Examples: DECnet/SRVNOD::FONT$DEFAULT, dec- net/44.70::font$special/symbols.

COLOR NAMES Most applications provide ways of tailoring (usually through resources or command line arguments) the colors of various elements in the text and graphics they display. A color can be specified either by an abstract color name, or by a numerical color specification. The numerical specification can identify a color in either device-depen- dent (RGB) or device-independent terms. Color strings are case-insensitive.

X supports the use of abstract color names, for example, "red", "blue". A value for this abstract name is obtained by searching one or more color name databases. Xlib first searches zero or more client-side databases; the number, location, and content of these databases is implementation dependent. If the name is not found, the color is looked up in the X server's database. The text form of this database is commonly stored in the file <XRoot>/lib/X11/rgb.txt, where <XRoot> is replaced by the root of the X11 install tree.

A numerical color specification consists of a color space name and a set of values in the following syntax:

<color_space_name>:<value>/.../<value>

An RGB Device specification is identified by the prefix "rgb:" and has the following syntax:

rgb:<red>/<green>/<blue>

<red>, <green>, <blue> := h | hh | hhh | hhhh h := single hexadecimal digits

Note that h indicates the value scaled in 4 bits, hh the value scaled in 8 bits, hhh the value scaled in 12 bits, and hhhh the value scaled in 16 bits, respectively. These values are passed directly to the X server, and are assumed to be gamma corrected.

The eight primary colors can be represented as:

black rgb:0/0/0 red rgb:ffff/0/0 green rgb:0/ffff/0 blue rgb:0/0/ffff yellow rgb:ffff/ffff/0 magenta rgb:ffff/0/ffff cyan rgb:0/ffff/ffff white rgb:ffff/ffff/ffff

For backward compatibility, an older syntax for RGB Device is supported, but its continued use is not encouraged. The syntax is an initial sharp sign character followed by a numeric specification, in one of the following formats:

#RGB (4 bits each) #RRGGBB (8 bits each) #RRRGGGBBB (12 bits each) #RRRRGGGGBBBB (16 bits each)

Page 151: Man Des Commandes Linux

�*�

The R, G, and B represent single hexadecimal digits. When fewer than 16 bits each are specified, they represent the most-significant bits of the value (unlike the "rgb:" syn- tax, in which values are scaled). For example, #3a7 is the same as #3000a0007000.

An RGB intensity specification is identified by the prefix "rgbi:" and has the following syntax:

rgbi:<red>/<green>/<blue>

The red, green, and blue are floating point values between 0.0 and 1.0, inclusive. They represent linear intensity values, with 1.0 indicating full intensity, 0.5 half intensity, and so on. These values will be gamma cor- rected by Xlib before being sent to the X server. The input format for these values is an optional sign, a string of numbers possibly containing a decimal point, and an optional exponent field containing an E or e followed by a possibly signed integer string.

The standard device-independent string specifications have the following syntax:

CIEXYZ:<X>/<Y>/<Z> (none, 1, none) CIEuvY:<u>/<v>/<Y> (~.6, ~.6, 1) CIExyY:<x>/<y>/<Y> (~.75, ~.85, 1) CIELab:<L>/<a>/<b> (100, none, none) CIELuv:<L>/<u>/<v> (100, none, none) TekHVC:<H>/<V>/<C> (360, 100, 100)

All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are floating point values. Some of the values are constrained to be between zero and some upper bound; the upper bounds are given in parentheses above. The syntax for these val- ues is an optional '+' or '-' sign, a string of digits possibly containing a decimal point, and an optional expo- nent field consisting of an 'E' or 'e' followed by an optional '+' or '-' followed by a string of digits.

For more information on device independent color, see the Xlib reference manual.

KEYBOARDS The X keyboard model is broken into two layers: server- specific codes (called keycodes) which represent the phys- ical keys, and server-independent symbols (called keysyms) which represent the letters or words that appear on the keys. Two tables are kept in the server for converting keycodes to keysyms:

modifier list Some keys (such as Shift, Control, and Caps Lock) are known as modifier and are used to select dif- ferent symbols that are attached to a single key (such as Shift-a generates a capital A, and Con- trol-l generates a control character ^L). The server keeps a list of keycodes corresponding to the various modifier keys. Whenever a key is pressed or released, the server generates an event that contains the keycode of the indicated key as well as a mask that specifies which of the modi- fier keys are currently pressed. Most servers set up this list to initially contain the various shift, control, and shift lock keys on the key- board.

�*�

keymap table Applications translate event keycodes and modifier masks into keysyms using a keysym table which con- tains one row for each keycode and one column for various modifier states. This table is initial- ized by the server to correspond to normal type- writer conventions. The exact semantics of how the table is interpreted to produce keysyms depends on the particular program, libraries, and language input method used, but the following con- ventions for the first four keysyms in each row are generally adhered to:

The first four elements of the list are split into two groups of keysyms. Group 1 contains the first and second keysyms; Group 2 contains the third and fourth keysyms. Within each group, if the first element is alphabetic and the the second element is the special keysym NoSymbol, then the group is treated as equivalent to a group in which the first element is the lowercase letter and the second element is the uppercase letter.

Switching between groups is controlled by the keysym named MODE SWITCH, by attaching that keysym to some key and attaching that key to any one of the modifiers Mod1 through Mod5. This modifier is called the ``group modi- fier.'' Group 1 is used when the group modifier is off, and Group 2 is used when the group modifier is on.

Within a group, the modifier state determines which keysym to use. The first keysym is used when the Shift and Lock modifiers are off. The second keysym is used when the Shift modifier is on, when the Lock modifier is on and the second keysym is uppercase alphabetic, or when the Lock modifier is on and is interpreted as ShiftLock. Other- wise, when the Lock modifier is on and is interpreted as CapsLock, the state of the Shift modifier is applied first to select a keysym; but if that keysym is lowercase alpha- betic, then the corresponding uppercase keysym is used instead.

OPTIONS Most X programs attempt to use the same names for command line options and arguments. All applications written with the X Toolkit Intrinsics automatically accept the follow- ing options:

-display display This option specifies the name of the X server to use.

-geometry geometry This option specifies the initial size and loca- tion of the window.

-bg color, -background color Either option specifies the color to use for the window background.

-bd color, -bordercolor color Either option specifies the color to use for the window border.

-bw number, -borderwidth number Either option specifies the width in pixels of the window border.

Page 152: Man Des Commandes Linux

�*�

-fg color, -foreground color Either option specifies the color to use for text or graphics.

-fn font, -font font Either option specifies the font to use for dis- playing text.

-iconic This option indicates that the user would prefer that the application's windows initially not be visible as if the windows had be immediately iconified by the user. Window managers may choose not to honor the application's request.

-name This option specifies the name under which resources for the application should be found. This option is useful in shell aliases to distin- guish between invocations of an application, with- out resorting to creating links to alter the exe- cutable file name.

-rv, -reverse Either option indicates that the program should simulate reverse video if possible, often by swap- ping the foreground and background colors. Not all programs honor this or implement it correctly. It is usually only used on monochrome displays.

+rv This option indicates that the program should not simulate reverse video. This is used to override any defaults since reverse video doesn't always work properly.

-selectionTimeout This option specifies the timeout in milliseconds within which two communicating applications must respond to one another for a selection request.

-synchronous This option indicates that requests to the X server should be sent synchronously, instead of asynchronously. Since Xlib normally buffers requests to the server, errors do not necessarily get reported immediately after they occur. This option turns off the buffering so that the appli- cation can be debugged. It should never be used with a working program.

-title string This option specifies the title to be used for this window. This information is sometimes used by a window manager to provide some sort of header identifying the window.

-xnllanguage language[_territory][.codeset] This option specifies the language, territory, and codeset for use in resolving resource and other filenames.

-xrm resourcestring This option specifies a resource name and value to override any defaults. It is also very useful for setting resources that don't have explicit command line arguments.

�*!

RESOURCES To make the tailoring of applications to personal prefer- ences easier, X provides a mechanism for storing default values for program resources (e.g. background color, win- dow title, etc.) Resources are specified as strings that are read in from various places when an application is run. Program components are named in a hierarchical fash- ion, with each node in the hierarchy identified by a class and an instance name. At the top level is the class and instance name of the application itself. By convention, the class name of the application is the same as the pro- gram name, but with the first letter capitalized (e.g. Bitmap or Emacs) although some programs that begin with the letter ``x'' also capitalize the second letter for historical reasons.

The precise syntax for resources is:

ResourceLine = Comment | IncludeFile | ResourceSpec | <empty line> Comment = "!" {<any character except null or newline>} IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace FileName = <valid filename for operating system> ResourceSpec = WhiteSpace ResourceName WhiteSpace ":" WhiteSpace Value ResourceName = [Binding] {Component Binding} ComponentName Binding = "." | "*" WhiteSpace = {<space> | <horizontal tab>} Component = "?" | ComponentName ComponentName = NameChar {NameChar} NameChar = "a"-"z" | "A"-"Z" | "0"-"9" | "_" | "-" Value = {<any character except null or unescaped newline>}

Elements separated by vertical bar (|) are alternatives. Curly braces ({...}) indicate zero or more repetitions of the enclosed elements. Square brackets ([...]) indicate that the enclosed element is optional. Quotes ("...") are used around literal characters.

IncludeFile lines are interpreted by replacing the line with the contents of the specified file. The word "include" must be in lowercase. The filename is inter- preted relative to the directory of the file in which the line occurs (for example, if the filename contains no directory or contains a relative directory specification).

If a ResourceName contains a contiguous sequence of two or more Binding characters, the sequence will be replaced with single "." character if the sequence contains only "." characters, otherwise the sequence will be replaced with a single "*" character.

A resource database never contains more than one entry for a given ResourceName. If a resource file contains multi- ple lines with the same ResourceName, the last line in the file is used.

Any whitespace character before or after the name or colon in a ResourceSpec are ignored. To allow a Value to begin with whitespace, the two-character sequence ``\space'' (backslash followed by space) is recognized and replaced by a space character, and the two-character sequence ``\tab'' (backslash followed by horizontal tab) is recog- nized and replaced by a horizontal tab character. To allow a Value to contain embedded newline characters, the two-character sequence ``\n'' is recognized and replaced by a newline character. To allow a Value to be broken across multiple lines in a text file, the two-character

Page 153: Man Des Commandes Linux

�*�

sequence ``\newline'' (backslash followed by newline) is recognized and removed from the value. To allow a Value to contain arbitrary character codes, the four-character sequence ``\nnn'', where each n is a digit character in the range of ``0''-``7'', is recognized and replaced with a single byte that contains the octal value specified by the sequence. Finally, the two-character sequence ``\\'' is recognized and replaced with a single backslash.

When an application looks for the value of a resource, it specifies a complete path in the hierarchy, with both class and instance names. However, resource values are usually given with only partially specified names and classes, using pattern matching constructs. An asterisk (*) is a loose binding and is used to represent any number of intervening components, including none. A period (.) is a tight binding and is used to separate immediately adjacent components. A question mark (?) is used to match any single component name or class. A database entry can- not end in a loose binding; the final component (which cannot be "?") must be specified. The lookup algorithm searches the resource database for the entry that most closely matches (is most specific for) the full name and class being queried. When more than one database entry matches the full name and class, precedence rules are used to select just one.

The full name and class are scanned from left to right (from highest level in the hierarchy to lowest), one com- ponent at a time. At each level, the corresponding compo- nent and/or binding of each matching entry is determined, and these matching components and bindings are compared according to precedence rules. Each of the rules is applied at each level, before moving to the next level, until a rule selects a single entry over all others. The rules (in order of precedence) are:

1. An entry that contains a matching component (whether name, class, or "?") takes precedence over entries that elide the level (that is, entries that match the level in a loose binding).

2. An entry with a matching name takes precedence over both entries with a matching class and entries that match using "?". An entry with a matching class takes precedence over entries that match using "?".

3. An entry preceded by a tight binding takes precedence over entries preceded by a loose binding.

Programs based on the X Tookit Intrinsics obtain resources from the following sources (other programs usually support some subset of these sources):

RESOURCE_MANAGER root window property Any global resources that should be available to 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 frequently taken care of when the user starts up X through the display manager or xinit.

SCREEN_RESOURCES root window property Any resources specific to a given screen (e.g. colors) that should be available to clients on all machines should be stored in the SCREEN_RESOURCES property on the root window of that screen. The

�*'

xrdb program will sort resources automatically and place them in RESOURCE_MANAGER or SCREEN_RESOURCES, as appropriate.

application-specific files Directories named by the environment variable XUSERFILESEARCHPATH or the environment variable XAPPLRESDIR (which names a single directory and should end with a '/' on POSIX systems), plus directories in a standard place (usually under <XRoot>/lib/X11/, but this can be overridden with the XFILESEARCHPATH environment variable) are searched for for application-specific resources. For example, application default resources are usually kept in <XRoot>/lib/X11/app-defaults/. See the X Toolkit Intrinsics - C Language Inter- face manual for details.

XENVIRONMENT Any user- and machine-specific resources may be specified by setting the XENVIRONMENT environment variable to the name of a resource file to be loaded by all applications. If this variable is not defined, a file named $HOME/.Xdefaults-host- name is looked for instead, where hostname is the name of the host where the application is execut- ing.

-xrm resourcestring Resources can also be specified from the command line. The resourcestring is a single resource name and value as shown above. Note that if the string contains characters interpreted by the shell (e.g., asterisk), they must be quoted. Any number of -xrm arguments may be given on the com- mand line.

Program resources are organized into groups called classes, so that collections of individual resources (each of which are called instances) can be set all at once. By convention, the instance name of a resource begins with a lowercase letter and class name with an upper case letter. Multiple word resources are concatenated with the first letter of the succeeding words capitalized. Applications written with the X Toolkit Intrinsics will have at least the following resources:

background (class Background) This resource specifies the color to use for the window background.

borderWidth (class BorderWidth) This resource specifies the width in pixels of the window border.

borderColor (class BorderColor) This resource specifies the color to use for the window border.

Most applications using the X Toolkit Intrinsics also have the resource foreground (class Foreground), specifying the color to use for text and graphics within the window.

By combining class and instance specifications, applica-

Page 154: Man Des Commandes Linux

�*-

tion preferences can be set quickly and easily. Users of color displays will frequently want to set Background and Foreground classes to particular defaults. Specific color instances such as text cursors can then be overridden without having to define all of the related resources. For example,

bitmap*Dashed: off XTerm*cursorColor: gold XTerm*multiScroll: on XTerm*jumpScroll: on XTerm*reverseWrap: on XTerm*curses: on XTerm*Font: 6x10 XTerm*scrollBar: on XTerm*scrollbar*thickness: 5 XTerm*multiClickTime: 500 XTerm*charClass: 33:48,37:48,45-47:48,64:48 XTerm*cutNewline: off XTerm*cutToBeginningOfLine: off XTerm*titeInhibit: on XTerm*ttyModes: intr ^c erase ^? kill ^u XLoad*Background: gold XLoad*Foreground: red XLoad*highlight: black XLoad*borderWidth: 0 emacs*Geometry: 80x65-0-0 emacs*Background: rgb:5b/76/86 emacs*Foreground: white emacs*Cursor: white emacs*BorderColor: white emacs*Font: 6x10 xmag*geometry: -0-0 xmag*borderColor: white

If these resources were stored in a file called .Xre- sources in your home directory, they could be added to any existing resources in the server with the following com- mand:

% xrdb -merge $HOME/.Xresources

This is frequently how user-friendly startup scripts merge user-specific defaults into any site-wide defaults. All sites are encouraged to set up convenient ways of automat- ically loading resources. See the Xlib manual section Resource Manager Functions for more information.

ENVIRONMENT DISPLAY

This is the only mandatory environment variable. It must point to an X server. See section "Display Names" above.

XAUTHORITY This must point to a file that contains authoriza- tion data. The default is $HOME/.Xauthority. See Xsecurity(7x), xauth(1), xdm(1), Xau(3).

ICEAUTHORITY This must point to a file that contains authoriza- tion data. The default is $HOME/.ICEauthority.

LC_ALL, LC_CTYPE, LANG The first non-empty value among these three deter- mines the current locale's facet for character han- dling, and in particular the default text encoding.

�*&

See locale(7x), setlocale(3), locale(1).

XMODIFIERS This variable can be set to contain additional information important for the current locale set- ting. Typically set to @im=<input-method> to enable a particular input method. See XSetLocaleModi- fiers(3).

XLOCALEDIR This must point to a directory containing the locale.alias file and Compose and XLC_LOCALE file hierarchies for all locales. The default value is <XRoot>/lib/X11/locale, i.e. normally /usr/X11R6/lib/X11/locale.

XENVIRONMENT This must point to a file containing X resources. The default is $HOME/.Xdefaults-<hostname>. Unlike <XRoot>/lib/X11/Xresources, it is consulted each time an X application starts.

XFILESEARCHPATH This must contain a colon separated list of path templates, where libXt will search for resource files. The default value consists of

<XRoot>/lib/X11/%L/%T/%N%C%S:\ <XRoot>/lib/X11/%l/%T/%N%C%S:\ <XRoot>/lib/X11/%T/%N%C%S:\ <XRoot>/lib/X11/%L/%T/%N%S:\ <XRoot>/lib/X11/%l/%T/%N%S:\ <XRoot>/lib/X11/%T/%N%S

i.e. normally

/usr/X11R6/lib/X11/%L/%T/%N%C%S:\ /usr/X11R6/lib/X11/%l/%T/%N%C%S:\ /usr/X11R6/lib/X11/%T/%N%C%S:\ /usr/X11R6/lib/X11/%L/%T/%N%S:\ /usr/X11R6/lib/X11/%l/%T/%N%S:\ /usr/X11R6/lib/X11/%T/%N%S

A path template is transformed to a pathname by substituting:

%N => name (basename) being searched for %T => type (dirname) being searched for %S => suffix being searched for %C => value of the resource "customization"

(class "Customization") %L => the locale name %l => the locale's language (part before '_') %t => the locale's territory (part after '_` but before '.') %c => the locale's encoding (part after '.')

XUSERFILESEARCHPATH This must contain a colon separated list of path templates, where libXt will search for user depen- dent resource files. The default value is:

$XAPPLRESDIR/%L/%N%C:\ $XAPPLRESDIR/%l/%N%C:\ $XAPPLRESDIR/%N%C:\ $HOME/%N%C:\ $XAPPLRESDIR/%L/%N:\ $XAPPLRESDIR/%l/%N:\

Page 155: Man Des Commandes Linux

�*0

$XAPPLRESDIR/%N:\ $HOME/%N

$XAPPLRESDIR defaults to $HOME, see below.

A path template is transformed to a pathname by substituting:

%N => name (basename) being searched for %T => type (dirname) being searched for %S => suffix being searched for %C => value of the resource "customization"

(class "Customization") %L => the locale name %l => the locale's language (part before '_') %t => the locale's territory (part after '_` but before '.') %c => the locale's encoding (part after '.')

XAPPLRESDIR This must point to a base directory where the user stores his application dependent resource files. The default value is $HOME. Only used if XUSERFILE- SEARCHPATH is not set.

XKEYSYMDB This must point to a file containing nonstandard keysym definitions. The default value is <XRoot>/lib/X11/XKeysymDB, i.e. normally /usr/X11R6/lib/X11/XKeysymDB.

XCMSDB This must point to a color name database file. The default value is <XRoot>/lib/X11/Xcms.txt, i.e. normally /usr/X11R6/lib/X11/Xcms.txt.

XFT_CONFIG This must point to a configuration file for the Xft library. The default value is <XRoot>/lib/X11/Xft- Config, i.e. normally /usr/X11R6/lib/X11/XftConfig.

RESOURCE_NAME This serves as main identifier for resources belonging to the program being executed. It defaults to the basename of pathname of the pro- gram.

SESSION_MANAGER Denotes the session manager the application should connect. See xsm(1), rstart(1).

XF86BIGFONT_DISABLE Setting this variable to a non-empty value disables the XFree86-Bigfont extension. This extension is a mechanism to reduce the memory consumption of big fonts by use of shared memory.

XKB_FORCE XKB_DISABLE XKB_DEBUG _XKB_CHARSET _XKB_LOCALE_CHARSETS _XKB_OPTIONS_ENABLE _XKB_LATIN1_LOOKUP _XKB_CONSUME_LOOKUP_MODS _XKB_CONSUME_SHIFT_AND_LOCK _XKB_IGNORE_NEW_KEYBOARDS _XKB_CONTROL_FALLBACK _XKB_COMP_LED _XKB_COMP_FAIL_BEEP

��*

These variables influence the X Keyboard Extension.

EXAMPLES The following is a collection of sample command lines for some of the more frequently used commands.For more information on a particular command, please refer to that command's manual page.

% xrdb $HOME/.Xresources % xmodmap -e "keysym BackSpace = Delete" % mkfontdir /usr/local/lib/X11/otherfonts % xset fp+ /usr/local/lib/X11/otherfonts % xmodmap $HOME/.keymap.km % xsetroot -solid 'rgbi:.8/.8/.8' % xset b 100 400 c 50 s 1800 r on % xset q % twm % xmag % xclock -geometry 48x48-0+0 -bg blue -fg white % xeyes -geometry 48x48-48+0 % xbiff -update 20 % xlsfonts '*helvetica*' % xwininfo -root % xdpyinfo -display joesworkstation:0 % xhost -joesworkstation % xrefresh % xwd | xwud % bitmap companylogo.bm 32x32 % xcalc -bg blue -fg magenta % xterm -geometry 80x66-0-0 -name myxterm $* % xon filesysmachine xload

DIAGNOSTICS A wide variety of error messages are generated from vari- ous programs. The default error handler in Xlib (also used by many toolkits) uses standard resources to con- struct diagnostic messages when errors occur. The defaults for these messages are usually stored in <XRoot>/lib/X11/XErrorDB. If this file is not present, error messages will be rather terse and cryptic.

When the X Toolkit Intrinsics encounter errors converting resource strings to the appropriate internal format, no error messages are usually printed. This is convenient when it is desirable to have one set of resources across a variety of displays (e.g. color vs. monochrome, lots of fonts vs. very few, etc.), although it can pose problems for trying to determine why an application might be fail- ing. This behavior can be overridden by the setting the StringConversionsWarning resource.

To force the X Toolkit Intrinsics to always print string conversion error messages, the following resource should be placed in the file that gets loaded onto the RESOURCE_MANAGER property using the xrdb program (fre- quently called .Xresources or .Xres in the user's home directory):

*StringConversionWarnings: on

To have conversion messages printed for just a particular application, the appropriate instance name can be placed before the asterisk:

xterm*StringConversionWarnings: on

Page 156: Man Des Commandes Linux

���

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)