You are on page 1of 160

Instituto Profesional Linux (LPI) Examen LPIC 101 Gua de Preparacin

Versin 3 Traduccin al espaol

Hardy Beltran Monasterios Orignal de Alan McKinnon, Michel Bisson

LPIC 101 Guia de Preparacion

Table of Contents
About this document.....................................................................vii Regarding the LPI 101 Exam........................................................viii
Approximate number of questions per topic..........................................................viii Peso per topic.........................................................................................................viii Tips on writing the exam..........................................................................................ix

Tpico 101: Hardware & Architecture.............................................1


Summary...................................................................................................................1 General hardware.................................................................................................1 Setting and reading the hardware and system time.............................................2 Hardware-related commands...............................................................................2 KERNEL MODULES (general)..............................................................................3 Getting information on hardware.........................................................................4 USB..................................................................................................................4 PCI...................................................................................................................4 PCMCIA...........................................................................................................4 PNP..................................................................................................................5 SCSI.................................................................................................................5 SERIAL.............................................................................................................6 CDROMS..........................................................................................................7 I/O ADDRESSES..............................................................................................7 I/O MEMORY....................................................................................................7 INTERRUPTS...................................................................................................7 DMA.................................................................................................................7 CPU..................................................................................................................7 DEVICES..........................................................................................................7 KERNEL OPTIONS..........................................................................................7 FILESYSTEMS.................................................................................................7 SYSTEM MEMORY..........................................................................................8 The /proc file system........................................................................................8 Plug and Play...................................................................................................9 1.101.1 Configure Fundamental BIOS Settings..........................................................11 Purpose of BIOS......................................................................................................11 CMOS Set-up program............................................................................................11 Hard disk Set-up.....................................................................................................11 BIOS error handling................................................................................................11 Peripherals settings................................................................................................12 Reserving IRQs for older ISA cards........................................................................12 1.101.3 Configure Modem and Sound cards...............................................................13 Modems..................................................................................................................13 Sound Cards...........................................................................................................13 1.101.4 Setup SCSI Devices........................................................................................14 Notes......................................................................................................................14 SCSI Architecture...................................................................................................14 Properties and rules of SCSI..............................................................................14 Types of SCSI.....................................................................................................14 SCSI speed table................................................................................................15 Addressing SCSI devices....................................................................................15 SCSI Onboard BIOS............................................................................................15 i

LPIC 101 Guia de Preparacion Booting from SCSI drive.....................................................................................15 SCSI in Linux......................................................................................................15 Naming of SCSI devices.....................................................................................16 1.101.5 Setup different PC expansion cards...............................................................17 Tools........................................................................................................................17 PCI..........................................................................................................................17 1.101.6 Configure Communication Devices................................................................19 Tools........................................................................................................................19 Modem AT Commands............................................................................................20 1.101.7 Configure USB devices...................................................................................21 Summary.................................................................................................................21 USBDevFS Filesystem............................................................................................22 Architecture of USB Modules.................................................................................22 List of current USB modules...................................................................................23 Dynamically loading USB Modules.........................................................................23 hotplug...............................................................................................................23 USB Manager (usbmgr)......................................................................................24

Tpico 102: Linux Installation & Package Management...............25


Summary.................................................................................................................25 1.102.1 Design hard disk layout..................................................................................26 File Hierarchy Standard (FHS)...............................................................................26 Why multiple partitions in Linux?...........................................................................26 File tree structure...................................................................................................26 Swap Partitions.......................................................................................................27 1.102.2 Install a boot manager....................................................................................28 LILO........................................................................................................................28 LILO display codes.............................................................................................28 Settings in /etc/lilo.conf......................................................................................29 GRUB (GRand Unified Bootloader).........................................................................29 Entries in GRUB menu/config file.......................................................................29 How does GRUB work?......................................................................................30 1.102.3 Make and install programs from source.........................................................31 Tools and files used.................................................................................................31 Difference between scripts and compiled programs...............................................31 Verifying the validity of the package's content.......................................................31 Standard file extentions for packages.....................................................................31 Unpacking packages...............................................................................................31 Packing files............................................................................................................32 Compilation process...............................................................................................32 1.102.4 Manage shared libraries.................................................................................34 Sequence of events.................................................................................................34 Tools and files used.................................................................................................34 1.102.5 Use Debian package management..................................................................35 1.102.6 Use Red Hat Package Manager (RPM)...........................................................36 Filename format of RPM pacakges.........................................................................36 Content of RPM packages.......................................................................................36 RPM database.........................................................................................................36 Syntax.....................................................................................................................36 Action.................................................................................................................36 Installation Options............................................................................................37 De-Installation Options.......................................................................................37 Package queries..................................................................................................37 Query Package selection (combined with -q option)...........................................38 Examples................................................................................................................39 ii

LPIC 101 Guia de Preparacion Querying rpm packages that are not installed....................................................39 Advanced Examples............................................................................................39 Verifying integrity of packages...............................................................................40 PGP and GPG Signature test..............................................................................40 Extract from RPM Man page..................................................................................40 QUERYING AND VERIFYING PACKAGES..........................................................40 INSTALLING, UPGRADING, AND REMOVING PACKAGES................................41 MISCELLANEOUS.............................................................................................41 SELECT-OPTIONS..............................................................................................41 QUERY-OPTIONS...............................................................................................41 INSTALL-OPTIONS.............................................................................................41

Tpico 103: GNU & Unix Commands.............................................42

Summary.................................................................................................................42 1.103.1 Work on the command line.............................................................................43 Shell (local) and Environment (exported) variables................................................43 Exported variables (Environment variables)......................................................43 Setting and unsetting variables..........................................................................44 Read-Only Variables (variable cannot be changed or unset)..............................44 $TERM (present terminal type)..........................................................................44 Command substitution............................................................................................44 Command history and editing.................................................................................44 Command history navigation..............................................................................44 Command Line Editing commands.....................................................................45 Applying commands recursively (-r,-R,--recursive).................................................45 man and info...........................................................................................................46 1.103.2 Process text streams using filters..................................................................47 Commands list........................................................................................................47 Command Examples...............................................................................................48 cut -dx -fy............................................................................................................48 expand................................................................................................................48 unexpand............................................................................................................48 fmt......................................................................................................................48 head [-|+][n]x.....................................................................................................48 join.....................................................................................................................48 nl........................................................................................................................48 od -bih -t x..........................................................................................................49 paste...................................................................................................................49 pr........................................................................................................................50 split -lx -by[b|k|m]...............................................................................................50 cat.......................................................................................................................50 tac.......................................................................................................................50 tail [-|+][n]x........................................................................................................51 tr -d.....................................................................................................................51 wc -l|-c|-w...........................................................................................................51 xargs...................................................................................................................51 sed......................................................................................................................51 sort -ky[n] -tx......................................................................................................52 grep [-virns]........................................................................................................52 more...................................................................................................................52 less.....................................................................................................................52 uniq....................................................................................................................52 awk -Fx...............................................................................................................52 1.103.3 Perform basic file management......................................................................54 cd........................................................................................................................54 iii

LPIC 101 Guia de Preparacion ls.........................................................................................................................54 cp........................................................................................................................54 mv.......................................................................................................................55 mkdir..................................................................................................................55 rmdir..................................................................................................................55 touch..................................................................................................................55 File naming wildcards (globbing).......................................................................55 Finding files with find.........................................................................................55 1.103.4 Use streams, pipes, and redirects..................................................................56 Standard I/O...........................................................................................................56 pipes ('|').................................................................................................................56 | xargs.....................................................................................................................56 Redirection.............................................................................................................57 >.........................................................................................................................57 >>......................................................................................................................57 <.........................................................................................................................57 <<......................................................................................................................57 Combining outputs.............................................................................................57 tee......................................................................................................................57 1.103.5 Create, monitor, and kill processes................................................................59 Process Viewing Commands...................................................................................59 Signalling active processes.....................................................................................60 Terminating processes............................................................................................60 Shell job control and '&'.........................................................................................61 1.103.6 Modify process execution priorities...............................................................63 1.103.7 Search text files using regular expressions....................................................64 1.103.8 Perform basic file editing operations using vi................................................65

Tpico 104: Devices, Linux Filesystems, FHS................................67

Summary.................................................................................................................67 I-nodes................................................................................................................67 Content of boot Block.........................................................................................67 Content of Super Block (partial).........................................................................67 Content of Normal inodes...................................................................................67 EXT2 Filesystem.................................................................................................68 Some differences between EXT2 and normal filesystem....................................68 Journaling Filesystems.......................................................................................69 1.104.1 Create partitions and filesystems...............................................................69 Notes......................................................................................................................70 Partitioning.............................................................................................................70 Creating a filesystem..............................................................................................71 1.104.2 Maintain the integrity of filesystems..............................................................73 Disk Usage..............................................................................................................73 Disk Free................................................................................................................73 File system check....................................................................................................73 File system debugging............................................................................................74 File system info dump.............................................................................................74 File system tweaking..............................................................................................74 1.104.3 Control mounting and unmounting filesystems..............................................76 1.104.4 Managing disk quota......................................................................................78 Summary.................................................................................................................78 Procedure for installing quotas...............................................................................78 Detailed preparation of quotas...............................................................................79 Repquota.................................................................................................................80 Quotaon and Quotaoff.............................................................................................80 iv

LPIC 101 Guia de Preparacion Files involved with disk quotas...............................................................................81 1.104.5 Use file permissions to control access to files................................................82 File type..................................................................................................................82 Files and directory access rights............................................................................82 Changing a file's access rights...........................................................................82 Directory access rights.......................................................................................83 Attributes (chattr & lsattr).................................................................................84 1.104.6 Manage file ownership...................................................................................86 chown.....................................................................................................................86 chgrp.......................................................................................................................87 chmod.....................................................................................................................88 1.104.7 Create and change hard and symbolic links...................................................89 1.104.8 Find system files and place files in the correct location.................................91 find..........................................................................................................................91 locate......................................................................................................................92 slocate.....................................................................................................................92 whereis...................................................................................................................93 which......................................................................................................................93

Tpico 110: The X Window System................................................95


Summary.................................................................................................................95 1.110.1 Install & Configure XFree86..........................................................................96 X Server..................................................................................................................96 XF86Config file...................................................................................................96 XF86 Configuration programs............................................................................97 Layout of the XF86Config file.............................................................................97 Running the X-Server.........................................................................................98 Controlling X-Server settings.............................................................................98 File format for resources files............................................................................99 X11 Fonts and Fonts server....................................................................................99 xset.....................................................................................................................99 Setting-up a Font server (xfs).............................................................................99 Format of font names.......................................................................................101 Installing new fonts..........................................................................................101 1.110.2 Set up a display manager.............................................................................103 Starting an X session............................................................................................103 Display managers.................................................................................................103 xdm configuration............................................................................................104 kdm configuration............................................................................................104 gdm configuration............................................................................................105 Running XTerminals using xdm/kdm.....................................................................105 Activate XDMCP (XDM Control Protocol).........................................................105 Allow access through the network....................................................................105 For direct query from a client......................................................................105 For Broadcast or indirect queries from clients............................................106 For Unattended x-login................................................................................106 gdm XDMCP configuration...................................................................................106 1.110.4 Install & Customize a Window Manager Environment.................................107 Window manager..................................................................................................107 Configuration of X Clients (X programs)...............................................................107 -geometry.........................................................................................................107 Selecting a font for X Clients................................................................................108 -fn fontname.....................................................................................................108 ~/.Xresources or ~/.Xdefaults file.........................................................................108 Starting an X session with startx..........................................................................109 v

LPIC 101 Guia de Preparacion Starting an X session with xdm/kdm/gdm.............................................................109 X11 on the network...............................................................................................110 Preparing the X Client......................................................................................110 Preparing the X-Server.....................................................................................110 Permanently allowing access to an X-Server....................................................110 Checking library dependencies for X-Client programs.........................................110

Glossary of Terms........................................................................111

vi

LPIC 101 Guia de Preparacion

Acerca de este documento


Traduccin al espaol. Coordinador Hardy Beltran Monasterios Como es el caso de muchos instructores Linux, necesitaba una gua para preparar a mis estudiantes a realizar el examen de Nivel 1 del programa LPI. Es as que encontr este documento gracias a que fue mencionado en la lista de discusin de LPI y comenz a trabajar en su traduccin al espaol. Unicamente se trabaj en la traduccin y no hay ningn cambio que se haya realizado a la versin 3 de Alan McKinnon. La traduccin del tema El sistema X Window es una colaboracin de Rodrigo Camacho cuyo correo es irodrigo_camacho@yahoo.com. Cualquier consulta sobre la versin en espaol debera ser enviada a mi: Hardy Beltran Monasterios Coordinador de la traduccin al espaol hbm@hardy.com.bo Versin 3 por Alan McKinnon Yo necesitaba para mis estudiantes una gua de preparacin para el examen, una vez que ellos haban completado su entrenamiento en Linux y queran prepararse para rendir el examen de Nivel 1 del programa LPI. Encontr en el sitio del LPI (http://www.lpi.org) la versin 2 de esta gua escrita por Michel Bisson y encajaba a mis necesidades. El contenido de esta gua es esencialmente el mismo que Michel escribi. Meramente volv a darle formato, cambi el orden de algunas secciones y correg algunos errores gramaticales y de tipeo. Cualquier consulta de esta gua debera ser enviada a mi: alan@afribiz.co.za Esta gua es relanzada bajo los mismos trminos del documento original, que se indican ms adelante. Versin 2 por Michel Bisson Este documento fue producido para ayudar a los candidatos a pasar el examen LPI 101. Lo he creado esencialmente como una referencia y no como un tutorial. En general esa es la razn de porque no tiene muchas explicaciones de los temas tratados. Usualmente yo lo utilizo en mis cursos como preparacin para el examen. Hasta donde yo se, cubre los aspectos ms importantes de los tpicos preguntados en el examen, pero su forma y organizacin de contenido no es perfecta. Ayudado por este documento y con suficiente prctica. Muchos de mis estudiante aprobaron el examen. En algunos tpicos he agregado ms informacin de la que es necesaria para el examen LPI 101. Cuando tenga una duda, refirase a la descripcin de los requerimientos ubicados al principio de cada tpico. Este es un documento libre. Usted lo puede distribuir, modificar o mejorar para uso personal o comercial, como usted desee. No asumo responsabilidad alguna de ningn tipo por la precisin de la informacin en este documento, ni por el xito o fracaso de cualquier de participante en pasar el examen. Apreciar que si usted hace alguna moficiacin a este documento, me enve una copia de la nueva versin. Porfavor hgame saber de cualquier error o impresicin de la informacin en este vii

LPIC 101 Guia de Preparacion documento, que me ayudara a mejorarlo. Cualquier tipo de retroalimentacin es bienvenida. Si alguien quiere contribuir a este documento, ser bienvenido, por favor contacteme a: michel@linuxint.com Espero que lo ayude a prepararse para el examen LPI 101 y recuerde que la prctica, prctica y ms prctica es la clave.

viii

LPIC 101 Guia de Preparacion

Respecto al examen LPI 101


Este es un requerimiento para el examen de certificacin LPI Nivel 1. Cubre las habilidades bsicas de administracin del sistema que son comunes para todas las distribuciones Linux. Cada objetivo tiene asignado un peso numrico. Los pesos van en un rago de 1 a 10, e indican la importancia relativa de cada objetivo. Los objetivos con mayor peso sern cubertos en el examen con ms preguntas. Nmero aproximado de preguntas por tpico Nmero total de preguntas 65

Hardware & Arquitectura.............................................................................................7 Instalacin de Linux & Gestin de paquetes...............................................................14 Ordenes GNU & Unix..................................................................................................20 Dispositivos, Sistema de archivos Linux, Jerarqua estndar......................................16 El Sistema X Window....................................................................................................8

Peso por tpico


Peso total de todos los tpicos y secciones Tpico 101 1.101.1 1.101.3 1.101.4 1.101.5 1.101.6 1.101.7 Tpico 102 1.102.1 1.102.2 1.102.3 1.102.4 1.102.5 o 1.102.6 Tpico 103 1.103.1 1.103.2 1.103.3 1.103.4 1.103.5 1.103.6 1.103.7 1.103.8 Tpico 104 1.104.1 1.104.2 Hardware & Arquitectura Configurar Configurar Configurar Configurar Configurar Configurar 98 8

parmetros fundamentales del BIOS....................................1 tarjetas de sonido y de modem.............................................1 dispositivos SCSI..................................................................1 diferentes tarjestas de expancin en la PC...........................3 dispositivos de comunicacin................................................1 dispositivos USB...................................................................1 22

Instalacin de Linux & Gestin de paquetes

Disear la organizacin del disco............................................................5 Instalar un gestor de arranque................................................................1 Construir e instalar programas desde cdigo fuente..............................5 Gestionar bibliotecas compartidas..........................................................3 Gestin de paquetes en Debian (DEB)....................................................8 Gestin de paquetes en Red Hat (RPM)..................................................8 Ordenes GNU & Unix 31 Trabajo en la lnea de rdenes................................................................5 Procesar flujos de texto usando filtros....................................................6 Realizar gestin bsica de archivos........................................................3 Uso de flujos, tubera y redireccionamiento............................................5 Crear, monitorear, y terminar procesos..................................................5 Modificar la prioridad de ejecucin de procesos.....................................3 Buscar en archivos de texto usando expresiones regulares....................3 Realizar operaciones bsicas de edicin de archivos con vi....................1 Dispositivos, Sistema de archivos Linux, Jerarqua Estandar 24 Crear particiones y sistema de archivos.................................................3 Mantener la integridad del sistema de archivos.....................................3 ix

LPIC 101 Guia de Preparacion 1.104.3 1.104.4 1.104.5 1.104.6 1.104.7 1.104.8 Tpico 110 1.110.1 1.110.2 1.110.4 Controlar el montar y desmontar sistema de archivos ...........................3 Gestionar cuotas de disco.......................................................................3 Usar permisos de archivo para controlar acceso a ellos.........................5 Gestionar la propiedad de archivos.........................................................1 Crear y cambiar enlaces simblicos y rgidos.........................................1 Buscar archivos del sistema y colocarlos en su ubicacin correcta........5 El Sistema X Window 13 Instalar & Configurar XFree86...............................................................5 Configurar un gestor de visualizacin.....................................................3 Instalar & personalizar un Gestor de Ventanas.......................................5

Consejos al escribir el examen


Muchas preguntas que requieren que usted llene en los espacios en blanco, no requieren ninguna opcin. Ejemplo cat o ls o cp (sin opciones) Use su experiencia y sentido comn para decidir que es importante y que no lo es cuando estuidie. Cuando tenga una duda, simplemente lea la descripcin de los requerimientos ubicados al principio de cada tpico. Le recomiendo que usted cree un listado de todos los tpicos para si mismo y revselos por un momento de tiempo en tiempo. Esto puede ayudarle a evitar invertir mucho tiempo en un tema a expensas de otros temas importantes. Observe el peso de cada tpico e invierta la cantidad de tiempo equivalente en l. Cuando haga el examen, le recomiendo que primero responda a las preguntas de las que usted est seguro y entonces vuelva a las otras despus. Lea las preguntas cuidadosamente y asegrese que usted las comprende muy bien. Entonces lea TODAS las respuestas detenidamente antes de responder. Casi consegu ser atrapado algunas veces, contestando algo que estaba seguro no podra ser ninguna otra cosa, pero cuando le las otras respuestas, vi que una de ellas era realmente la respuesta correcta. El examen es dificultoso y necesita concentracin y buena memoria. No est recomendado ingerir comida pesada antes del examen. No hay necesidad de apresurarse durante el examen y correr el riesgo de pasar por alto algo. Hay mas que tiempo suficiente para responder todas las preguntas. Cuando haya terminado y aun quede tiempo, revise sus respuestas.

Tpico 101: Hardware & Arquitectura

Tpico 101: Hardware & Arquitectura


Peso total para este tpico 1.101.1 1.101.3 1.101.4 1.101.5 1.101.6 1.101.7 8

Configuracin fundamentales de la BIOS................................................1 Configurar modem y placa de sonido......................................................1 Configurar dispositivos SCSI..................................................................1 Configurar diferentes tarjetas de expancin de PC.................................3 Configurar dispositivos de comunicacin................................................1 Configurar dispositivos USB...................................................................1

Resmen
Generalidades de Hardware
Procesador, BIOS, RAM , Sistema de bus de direcciones, Sistema de bus de datos, direcciones de E/S y conflictos de IRQ. Tabla IRQ Usado por el sistema: 1,2,6,8,14,15 Generalmente libre: Quizas liberable: Compartiendo IRQ Generalmente sin problemas con PCI, no deseable con ISA DMA 8 canales DMA. El canal DMA 4 est siempre ocupado. Normalmente se usan: DMA 1, 2 o 3. Observer por conflictos de DMA Configurando direcciones de E/S, IRQ y DMA Perifricos integrados en la placa base: via BIOS Antiguas tarjetas de expansin ISA: Jumpers e interruptores DIP en las tarjetas Nuevas tarjetas de expansin ISA: Jumpers para direcciones E/S e IRQ por software Tarjetas de expansin ISA Conectar-y-Usar (Plug-And-Play): Caracterstica del BIOS o del sistema operativo Tarjetas de expansin PCI: Via BIOS y sistema operativo usando el bus PCI Direccin de memoria base de ciertas tarjetas PCI 5,9,10,11,13 3,4,7,12

Tpico 101: Hardware & Arquitectura Directamente en la tarjeta

Configurando y leendo el reloj de hardware y la hora del sistema


date Muestra fecha y hora actual del sistema date -s "15:34" Establece la fecha y hora del sistema hwclock Muestra la fecha y hora del reloj de hardware hwclock --localtime El reloj de hardware es mantenido en hora local hwclock --utc El reloj de hardware es mantenido en hora universal (UTC) hwclock --set --date="9/22/2002 16:45:05" Establece la hora y fecha del reloj de hardware hwclock --hctosys Establece el reloj del sistema al mismo que del reloj de hardware hwclock --systohc Establece el reloj de hardware al mismo que del reloj de sistema setclock 09/18/2003 21:13:00 Establece el reloj de hardware y del sistema en una sla orden a Jue Sep 18 21:13:00 2003 (solo Red Hat) Variables de tiempo en /etc/sysconfig HWCLOCK="--localtime" para modo de tiempo local HWCLOCK=-u para modo de tiempo universal Cuando SuSE arranca establece el tiempo desde el script /etc/init.d/boot Los archivos que tienen alguna relacin con el tiempo son: /usr/lib/zoneinfo/localtime --> /etc/localtime archivo binario /etc/adjtime Archivo temporal utilizado para ajustar el tiempo regularmente

Ordenes relacionadas a hardware


ksysctrl

Tpico 101: Hardware & Arquitectura Es bueno para mostrar los dispositivos encontrados en el sistema a la windows. (SuSE) hwinfo Muestra un montn de informacin sobre el hardware automticamente econtrado. (SuSE) lsdev Muestra una lista de los dispositivos renocidos y sus direcciones de E/S, IRQ y DMA procinfo Muestra una lista de los dispositivos renocidos y sus direcciones de E/S, IRQ y DMA MAKEDEV Orden para crear archivos de dispositivo losetup Configura y controla dispositivos bucle (loop devices)

MODULOS DEL NUCLEO (general)


Lista todos los mdulos del ncleo cargados actualmente: lsmod cat /proc/modules Para obtener ms informacin acerca de un mdulo use: modinfo <nombre-de-modulo> Para cargar un mdulo del ncleo: modprobe insmod modprobe est recomendado porque tambin verifica las dependencias de el mdulo. Para descargar un mdulo del kernel use:: modprobe -r <nombre-de-modulo> sin la extensin .o rmmod <nombre-de-modulo> sin la extensin .o Para listar todos los mdulos cargables del ncleo que podran no cargar apropiadamente por cauza de smbolos no encontrados (dependencias no satisfechas): depmod Archivos de configuracin para mdulos del ncleo: /etc/modules.conf Antigua configuracin utilizada por modprobe para cambiar la forma en que un mdulo es cargado o descargado. 3

Tpico 101: Hardware & Arquitectura /etc/modprobe.conf Nuevo archivo de configuracion para la orden modprobe que tiene el mismo propsito que el archivo /etc/modules.conf (antiguo). Nota: No he determinado que resultados se pueden obtener si ambos archivos de configuracin estn presentes en el sistema. Lista las opciones utilizadas para cargar mdulos indicados en /etc/modprobe.conf: modprobe -c

Obteniendo informacin del hardware


USB
lsusb Lista todos los dispositivos USB conectados /sbin/hotplug Script; maneja dispositivos PCI & USB conectables en caliente (hot-pluggable) rchotplug [start|stop] Incia/detiene el configurador de USB y PCI usbmodules --device /proc/bus/usb/<NNN>/<nnn> Lista mdulos del ncleo que corresponden a dispositivos USB actualmente conectados a la computadora. Ejemplo: usbmodules --device /proc/bus/usb/001/009

PCI
lspci Lista todos los dispositivos PCI, de manera fcil de leer cat /proc/pci Lista todos los dispositivos PCI, con abundante informacin setpci Configura dispositivos PCI pcitweak Lista, escribe y lee el espacio de configuracin PCI scanpci Registra/prueba el bus PCI /sbin/hotplug Script; maneja dispositivos PCI & USB conectables en caliente (hot-pluggable) rchotplug [start|stop] Incia/detiene el configurador de USB y PCI. (SuSE)

Tpico 101: Hardware & Arquitectura

PCMCIA
cardinfo Programa X para listar y controlar tarjetas PCMCIA cardctl Programa de consola para controlar tarjetas PCMCIA dump_cis Programa de consola para listar tarjetas PCMCIA y sus parmetros cardmgr Demonio que carga y descarga mdulos PCMCIA para las tarjetas insertadas. /etc/init.d/pcmcia Script que carga cardmgr como demonio

PNP
lspnp Lista dispositivos de Conectar-y-Usar (Plug and Play) y los recursos disponibles /etc/isapnp.conf Archivo usado por isapnp para configurar dispositivos PnP Vea tambin la . pgina del manual de setpnp para ms informacin sobre el control de recursos para dispositivos PnP . isapnp /etc/isapnp.conf Configura los dispositivos PnP de acuerdo a /etc/isapnp.conf

SCSI
sg_map Muestra el mapeo entre dispositivos sg y otros dispositivos SCSI. cat /proc/scsi/scsi Muestra informacin de todos los posibles dispositivos SCSI: hdx, srx, sgx, scdx scsiinfo -l Lista dispositivos SCSI activos en el sistema. ej. /dev/sda /dev/scd0 etc. sg_reset ejercita la capacidad (capability) de resetear el dispositivo/bus/anfitrin SCSI scsi_info Herramienta de descripcin de un dispositivo SCSI sg_test_rwbuf Prueba el adaptador SCSI del anfitrin (SCSI host adapter) realizando operaciones de lectura y escritura en el buffer del dispositivo y calculando cifras de comprobacin. 5

Tpico 101: Hardware & Arquitectura lsscsi Lista todos los dispositivos SCSI (o anfitriones) presentes en el sistema mover utilidad para controlar cambiadores de medios SCSI sg_scan Hace un registro del bus SCSI y enva el resultado a la salida estndar STDOUT sg_senddiag Ejecuta una orden SCSI SEND DIAGNOSTIC sg_logs Lee las pginas de registro SCSI LOG SENSE scsidev Pobla /dev/scsi con nombres de dispotivo que son persistentes contra cambios a la configuracin SCSI. sg_start Inicia (spins-up) o detiene (spins down) dispositivos SCSI sg_readcap Llama a la orden READ CAPACITY en un dispositivo SCSI sg_rbuf Lee datos utilizando la orden SCSI READ BUFFER sg_inq Entrega los datos recuperados con la orden SCSI INQUIRY sginfo outputs mode sense information for a SCSI generic device sg_modes Lee las pginas SCSI MODE SENSE xmover Herramienta X11 para cambiadores de medio SCSI scsi_devfs_scan Registra dispositivos SCSI en un rbol devfs sane-find-scanner Busca scanners SCSI y USB y sus respectivos archivos de dispositivo scsiformat Formato a bajo nivel de un disco SCSI

SERIAL
cat /proc/tty/drivers Muestra los puertos seriales detectados. 6

Tpico 101: Hardware & Arquitectura

CDROMS
cat /proc/sys/dev/cdrom/info Informacin de la unidad de CD-ROM y sus capacidades. Nota: Unidades cd CDROM SCSI pueden ser dispositivos scdx (/dev/scdx)

I/O ADDRESSES
cat /proc/ioports Direcciones de E/S utilizadas por los dispositivos.

I/O MEMORY
cat /proc/iomem Direcciones de memoria utilizadas.

INTERRUPTS
cat /proc/interrupts Interrupciones en uso

DMA
cat /proc/dma Canales DMA en uso.

CPU
cat /proc/cpuinfo Informacin de procesador

DEVICES
cat /proc/devices Dispositivos de caracteres y bloques utilizados junto a sus identificadores (IDs). lsdev Muestra datos de IRQ, DMA y puertos de E/S de dispositivos reconocidos

KERNEL OPTIONS
cat /proc/cmdline Opciones del ncleo dadas en tiempo de arranque

FILESYSTEMS
cat /proc/filesystems Tipos de sistemas de archivos reconocidos por Linux. 'nodev' indica que no corresponde a ningn dispositivo fsico. 7

Tpico 101: Hardware & Arquitectura

SYSTEM MEMORY
cat /proc/meminfo Informacin de gestin de la memoria del sistema

The /proc file system.


Muestra aspectos internos en funcionamiento del ncleo. La mayora son de slo-lectura. Cada proceso tiene un directorio en /proc (con el nombre de su nmero de proceso: PID). El contenido de este directorio es: cmdline Linea de rdenes que inici el proceso cwd Enlace simblico al directorio actual de trabajo del proceso. environ Variables de entorno del proceso exe Enlace simblico a programa ejecutable (ruta completa) root Directorio raz (root) para el proceso. (puede ser cambiado con la orden chroot) fd/ Descriptores de archivo de los archivos abiertos por el proceso (ej. 0,1,2,...,255. usado en programa 1>&2 , etc.) Parmetros de hardware interrupts IRQ utilizados por los dispositivos ioports Direcciones de E/S utilizados por los perifricos dma Canales DMA utilizados por los perifricos iomem Mapa de memoria de areas reservadas: Video RAM/ROM, Sistema RAM/ROM, memoria PCI, VESA Frame buffer. Otra informacin de hardware cpuinfo Tipo y modelo de procesador, velocidad, tamao de la memoria cach, etc. partitions Contiene una lista de todas las particiones locales conocidas con sus respectivos nmeros de dispositivo mayor y menor. pci 8

Tpico 101: Hardware & Arquitectura Listado de todos los dispositivos PCI y AGP encontrados en el bus por el ncleo. Informacin del ncleo cmdline Parmetros pasados al ncleo durante el arranque. filesystems Lista de sistemas de archivos conocidos por el ncleo (compilados o cargados como mdulos). meminfo Informacin sobre el uso de la memoria disponible en el sistema modules Lista de modulos cargados mounts Lista de sistemas de archivo montados. Tambin se muestran aquellos que hayan sido montados con la opcin -n y no aparecen en /etc/mtab ni en la salida de la orden df(1). version Versin del ncleo. Otros directorios importantes en /proc bus/ Informacin sobre los sistemas de bus presentes en el sistema ide/ Informacin sobre los controladores y dispositivos IDE scsi/ Informacin sobre los controladores y dispositivos SCSI net/ Informacin sobre aspectos de la red como la tabla ARP tabla de rutas, , dispositivos de red, etc. sys/ Contiene varios archivos y directorios que corresponden a variables del ncleo. Algunas pueden ser modificables directamente o va sysctl(8).

Conectar y Usar (Plug and Play)


Una tarjeta PnP tiene una lista de direcciones de E/S, IRQs y DMAs que puede usar si es solicitado. Linux NO es automaticamente compatible con PnP Esto debe ser hecho . manualmente. Dos programas estn disponibles para esto: pnpdump Examina el bus ISA en busca de tarjetas PnP y muestra los posibles valores de configuracin de cada tarjeta PnP encontrada. isapnp

Tpico 101: Hardware & Arquitectura Lee el archivo de configuracin PnP y configura el dispositivo de acuerdo a ello. Proceso manual: 1. Recolectar los posibles valores de configuracin de las tarjetas PnP Examina las . direcciones 0x0273 a 0x03f3 pnpdump > /etc/isapnp.conf 2. Editar el archivo y activar los valores de configuracin deseados de cada tarjeta PnP vi /etc/isapnp.conf 3. Configurar las tarjetas PnP segn /etc/isapnp.conf. Debe ser hecho durante el arranque. isapnp /etc/isapnp.conf Use esta orden bajo Red Hat/SuSE isapnp tools /etc/isapnp.conf Use esta orden bajo Debian Observe lo siguiente en el paso 2 mientras edita el archivo /etc/isapnp.conf: IO ADDRESS: Primera direccin base de E/S posible: Menor direccin base de E/S 0x0240 Ultima direccin base de E/S posible: Mayor direccin base de E/S 0x03e0 Tamao del bloque de direcciones: Nmero de direcciones de E/S requeridas: 32 Vea las direcciones de E/S ocupados en el sistema: cat /proc/ioports Haga una lista de las posibles direcciones de E/S para esta tarjeta. (1era direccin base de E/S posible + Tamao del bloque de direcciones) etc ej. 240, 260, 280, 2A0, 2c0, ..., ..., 3e0 Elija una direccin disponible, escrbalo en la siguiente lnea y descomente la lnea: (IO 0 (BASE 0x340)) IRQ: Proceda de la misma manera para las direcciones IRQ y al terminar descomente la lnea: (INT 0 (IRQ xx (MODE +E))) (xx=chosen IRQ) Finalmente active la tarjeta y descomente la lnea: (ACT Y)

10

Tpico 101: Hardware & Arquitectura

1.101.1 Configuracin fundamental de la BIOS


Descripcin: Los candidatos deberan ser capaces de configurar hardware bsico del sistema mediante el BIOS. Este objetivo requiere un entendimiento de los problemas que pueden ocurrir como el uso de LBA en discos IDE con ms de 1024 cilindros, activar o desactivar perifricos integrados, como as tambien configurar sistemas con o sin perifericos externos como ser el teclado. Tambien incluye la correcta configuracin de IRQ, DMA y direcciones de E/S para todos los puertos y configuraciones administradas por la BIOS y opciones para manejar errores. Peso: 1 Archivos, trminos y utilidades clave: /proc/ioports /proc/interrupts /proc/dma /proc/pci

Propsito de la BIOS
La BIOS es el programa intermedio (en ROM) entre la arquitectura de hardware (placa o tarjeta madre) y el sistema operativo. Linux trata directamente con algn hardware (ej. Controlador IDE) por velocidad y mejor control.

EL programa de configuracin CMOS


Disparado durante el arranque por una tecla o una combinacin de ellas: Ejemplos: DEL, F2, <Ctrl-Alt-ESC>, etc.

Configuracin de disco fijo


Aunque el controlador de disco es accedido directamente por Linux, algunos parmetros de configuracin del disco en la CMOS siguen siendo importantes. Los cilindros de un disco fijo, tienen fsicamente menos sectores al interior del disco que el exterior LBA (Large Block Address) reduce logicamente el nmero de cilindros e incremente el nmero de cabezas. LBA es importante si el nmero de cilindros fsicos es superior a 1024, an si Linux no utiliza la BIOS para acceder al disco. Razones: fdisk(8) lee desde la BIOS los parmetros de configuracin del disco lilo(8) y GRUB(8) son cargados por la BIOS y ambos usan informacin proporcionada por esta.

11

Tpico 101: Hardware & Arquitectura

Manejo de errores de la BIOS


Normally: Halt on all errors El arranque no contina si ocurre algn tipo de error Servidor Linux sin teclado: Halt on all errors but keyboard. El arranque contina an cuando no se encuentre un teclado conectado

Configuracin de perifricos
Desactivar cualquier dispositivo no utilizado. Ej. Puertos COM, ratn, canales IDE si se est usando SCSI, etc.

Reservando IRQs para antiguas tarjetas ISA


Estos valores sern aplicados a tarjetas antiguas, y no sern utilizados por el sistema PnP (Plug and Play).

12

Tpico 101: Hardware & Arquitectura

1.101.3 Configurar Modem y placa de sonido


Descripcin: Asegurarse que los dispositivos cumplan con los requerimientos de compatibilidad (particularmente que un mdem NO sea un win-modem), verificar que el modem y la placa de sonido utilicen direcciones IRQ, DMA y E/S correctas y nicas. Si la placa de sonido es PnP instalar y ejecutar sndconfig e isapnp, configurar modem para dial-up, para conexiones PPP | SLIP | CSLIP configurar el puerto serial para 115.2 Kbps , Peso: 1 Archivos, trminos y utilidades clave: no aplicable

Modems
Verifique la lista de compatibilidad de hardware de su distribucin. Una buena fuente sobre informacin de hardware es el Hardware-HOWTO Los modems normales (compatibles con Hayes) son controlados con ordenes AT Preste atencin a los denominados WinModems estos no son modems hardware reales. Ellos usan controladores Windows para simular el conjunto de rdenes AT. Esta seccin no se aplica a WinModems. Ms informacin al respecto en www.linmodems.org

Tarjetas de Sonido
LPI se concentra en la tcnica de sonido OSS. (Open Sound System) Cada tarjeta de sonido necesita su propio mdulo de ncleo. Programa para configuracin de tarjeta de sonido (RedHat y otros): sndconfig Examina todos los posibles puertos de E/S y se maneja por menues. El puerto estndar de E/S para una tarjeta de sonido es: 0x220 Maneja bastante bien tarjetas PnP y antiguas ISA.

13

Tpico 101: Hardware & Arquitectura

1.101.4 Configurar dispositivos SCSI


Descripcin: Los candidatos deberan ser capaces de configurar dispositivos SCSI utilizando tanto el BIOS como las herramientas que provee Linux. Ellos deberan ser capaces de diferenciar entre los diferentes tipos de SCSI. Este objetivo incluye la manipulacin del BIOS del SCSI para detectar los IDs disponibles y ocupados y configurar el nmero de ID correcto para diferenciar los dispositivos especialmente el dispositivo de arranque. Tambin incluye administrar la configuracin en la BIOS de la PC para determinar la sequencia de inicio deseada si los discos IDE y SCSI son utilizados. Peso: 1 Archivos, trminos y utilidades clave: SCSI ID /proc/scsi/ scsi_info

Notas
SCSI = Small Computer System Interface Propsito: Aprender a configurar los dispositivos SCSI con respecto a la BIOS, SCSI-ID y al arranque. Uso de SCSI: Sigue en la industria de servidores, ofrece confiabilidad, resistencia, caractersticas de enchufado-en-caliente (Hot-Plug). Herramientas: SCSI-ID, /proc/scsi, scsi_info

Arquitectura SCSI
Nmero de dispositivos con SCSI, incluyendo el controlador SCSI mismo: Standard (SCSI 8 bits) : 8 = 7 dispositivos + 1 controlador SCSI Wide (SCSI 16 bits) : 16 = 15 dispositivos + 1 controlador SCSI

Propiedades y reglas de SCSI


El cable para conectar dispositivos es de 50 alambres de ancho No hay bifurcaciones 'T' en el cable Cada extremo del cable debe ser terminado por conectores de 330 Ohms a tierra y 220 Ohms a +5V Longitud mnima de 10cm de cable entre dispositivos SCSI Longitud mxima del cable de 50 alambres: 3 metros (>4 devices Max:1.5 metros) Al final del cable debe haber un dispositivo terminador conectado.

Tipos de SCSI
Standard (SCSI-1): 8 Devices 10 MHz Mximo SCSI-2, FAST-SCSI-2, Wide-SCSI-2 (cable de 68 alambres, bus de 16 bits): Rpido, mejor conjunto de rdenes 14

Tpico 101: Hardware & Arquitectura SCSI-3 aun ms rpido pero sigue en desarrollo, no es importante para LPI

Tabla de velocidad SCSI


Ancho de Bus Wide 16-Bit Ancho del Cable 68 alambres Standard 5 MB/sec 10 MB/sec Fast 10 MB/sec 20 MB/sec Ultra 20 MB/sec 40 MB/sec # de Dispositivos 7+Ctrlr 15+Ctrlr

Standar 8-Bit 50 alambres

Posibles nombres que gustan Ultra-Wide o Fast-Wide, etc. son posibles

Direccionamiento de dispositivos SCSI


SCSI-ID = 0 a 7 0 a 15 El controlador SCSI debe tener la ms alta prioridad, ID: 7 o 15 Si el arranque es desde un disco SCSI entonces el SCSI ID debe ser 0 Cada SCSI-ID puede contener un LUNs (Logical Unit Number) Cada cable SCSI (bus) tambin recibe un nmero (0,1,2 etc) Cada dispositivo SCSI puede ser identificado entonces como sigue: Nmero-de-bus, SCSI-ID, LUN Normalmente 0,x,0 ej. /dev/sda est en 0,0,0

SCSI BIOS en la tarjeta


Separado y desconocido desde la BIOS del sistema Utilizado para arrancar desde discos SCSI y cambiar parmetros del controlador Los controladores baratos usualmente no tienen SCSI BIOS en la tarjeta. Los que cuestan un poco ms si. Los nuevos controladores permiten inclusive asignar SCSI-IDs a los dispositivos mediante software. Papel del controlador: Asignacin de SCSI-IDs a los dispositivos Seleccionar el ratio de transferencia de datos de los dispositivos Seleccionar el disco de arranque

Arrancando desde el disco SCSI


El controlador debe tener SCSI BIOS incorporado En el SCSI BIOS: En la BIOS del sistema: Indicar el disco de arranque Poner la secuencia de arranque a 'SCSI'

SCSI en Linux
/proc/scsi directorio que contiene todos los dispositivos SCSI como sub-directorios. Cada sub-directorio contiene archivos nombrados con el nmero de bus SCSI (0,1,2) Estos archivos contienen una lista de los dispositivos conectados a este bus. 15

Tpico 101: Hardware & Arquitectura El archivo /proc/scsi/scsi contiene la lista de todos los dispositivos SCSI encontrados en el sistema.

Nombres de dispositivo SCSI


Discos fijos: sda, sdb,... en la secuencia que son encontrados Los dispositivos removibles como unidades ZIP y Memoria-Flash USB son colocados en la clase de discos fijos Las unidades de CD-ROM SCSI tiene dos nombres a la vez: srx & scdx (x=0,1,2,3,..) Cada dispositivo tambin es identificado por la tripleta: SCSI-BUS,SCSI-ID,LUN El programa scsi_info muestra informacin individual de un dispositivo: scsi_info /dev/scd0

16

Tpico 101: Hardware & Arquitectura

1.101.5 Configurar diferentes tarjetas de expansin de PC


Descripcin: Los candidatos deberan ser capaces de configurar diferentes placas para los slots de expansin. Ellos, deberan conocer las diferencias entre placas ISA y PCI con sus respectivos problemas de configuracin. Este objetivo incluye la correcta configuracin de IRQ, DMA y puertos de I/O de las placas, especialmente para evitar conflicto entre dispositivos. Tambin se incluye el uso de isapnp si la placa es un dispositivo ISA PnP . Peso: 3 Archivos, trminos y utilidades clave: /proc/dma /proc/interrupts /proc/ioports /proc/pci pnpdump(8) isapnp(8) lspci(8)

Herramientas
/proc/dma /proc/interrupts /proc/ioports /proc/pci Archivos de informacin pnpdump isapnp lspci Programas

PCI
Los dispositivos PCI son identificados por un nico valor ID tal como una direccin MAC en las tarjetas de red. Linux almacena estos PCI IDs en los siguientes archivos: /usr/share/pci.ids SuSE /usr/share/hwdata/pci.ids RedHat & Debian /usr/share/mics/pci.ids Old Debian distributions update-pciids esta orden actualiza la lista desde Internet en /usr/share/mics/pci.ids.new o su equivalente segun la distribucin. 17

Tpico 101: Hardware & Arquitectura Linux soporta dispositivos PCI (Bus ID=00) completamente sin necesidad de configuraciones manuales. AGP es un bus PCI (Bus ID=01) separado, reservado para Tarjetas Grficas, teniendo slo una ranura de expansin (slot). Ha sido creado para no perturbar la transferencia de datos entre el chip grfico y el CPU. El sistema de Bus PCI usa un esquema de direcciones similar al de SCSI: No_Bus:No_Slot:No_Funcin(No_Dispositivo) lspci es utilizado para obtener un listado de todos los dispositivos PCI del sistema. lspci encuentra informacin de los fabricantes en el archivo /usr/share/pci.ids. lspci -n muestra el cdigo numrico de los fabricantes en lugar de tomar las descripciones del archivo pci.ids. Los ncleos posteriores a la versin 2.1.82 tienen ms informacin sobre los dispositivos en el Bus PCI en el archivo /proc/pci. Los puertos seriales conocidos como COM1, COM2, etc. in DOS, son conocidos en Linux como: ttyS0,ttyS1, etc. Los puertos paralelos conocidos como lpt1, lpt2 en DOS, son conocidos en Linux como: lp0, lp1 etc

18

Tpico 101: Hardware & Arquitectura

1.101.6 Configurar Dispositivos de comunicacin


Descripcin: Los candidatos deberan ser capaces de instalar y configurar diferentes dispositivos de comunicacin internos y externos como modems, adaptadores ISDN y conmutadores DSL. Este objetivo incluye la verificacin de los requerimientos de compatibilidad (especialmente si el modem es un winmodem), configuracin necesaria de hardware para dispositivos internos (IRQs, DMAs, puertos de I/O), y la carga y configuracin de controladores. Esto tambin incluye requerimientos del dispositivo de comunicacin y su interfase, como el puerto serie correcto para 115.2 Kbps y la configuracin correcta del modem para conexiones PPP salientes. Peso: 1 Archivos, trminos y utilidades clave: /proc/dma /proc/interrupts /proc/ioports setserial(8)

Herramientas
/proc/dma /proc/ioports /proc/interrupts setserial(8) setserial es parte del paquete setserial en SuSE, RedHat & Debian minicom es uno de los programas para terminales seriales en Linux. setserial /dev/ttySx setserial /dev/cuax Muestra la configuracin de el puerto serial, donde x es el nmero de puerto setserial /dev/ttySx <parametros> Configura el puerto serial de acuerdo a los parmetros indicados. Los parmetros son: port <No_puerto> irq <IRQ> uart <UART_Tipo> Nmero de puerto E/S Nmero de IRQ UART (Universal Asynchronous Receiver Transmitter) Valores posibles son: none, 8250, 16450, 16550, 16550, 16550A, 16650V2, 16654, 16750, 16850, 16950, 16954. none=Desactiva el dispositivo

Muchas aplicaciones antiguas slo conocen hasta 38400 Baudios. Para permitir velocidades ms rpidas aun cuando la aplicacin solicita por 38400 Baudios, setserial cuenta con parmetros extra que configuran banderas del hardware que traducen las solicitudes de 38.4Kb por las aplicaciones a velocidades superiores en el chip UART. Parmetro spd_normal spd_hi Velocidad solicitada por la Aplicacin 38.4Kb 38.4Kb Velocidad UART real 38.4Kb 57.6Kb

19

Tpico 101: Hardware & Arquitectura Parmetro spd_vhi spd_shi spd_warp Velocidad solicitada por la Aplicacin 38.4Kb 38.4Kb 38.4Kb Velocidad UART real 115Kb 230Kb 460Kb

Ordenes AT del modem


Estas son las ordenes de control de un modem compatibles con Hayes. AT ATD <number> ATH0 ATH1 ATX0 ATX1 ATX2 ATX3 ATX4 ATX5 ATX6 ATZ AT&F Sets the baud rate between Modem and PC Dial the Number (Nr.) HangUp Answer the phone (Opposite of HangUp) Dial blind, CONNECT when connection OK Dial blind, CONNECT speed when connection OK Wait for DIALTONE and CONNECT speed when connection OK Dial blind, CONNECT speed when connection OK or BUZY Wait for DIALTONE and CONNECT speed when connection OK Dial blind, CONNECT speed when connection OK, BUSY, VOICE Wait for DIALTONE and CONNECT speed when connection OK, BUSY, VOICE Reset the modem. Reset the internal modem configuration to factory settings.

20

Tpico 101: Hardware & Arquitectura

1.101.7 Configurar dispositivos USB


Descripcin: Los candidatos deberan ser capaces de activar el soporte USB, utilizar y configurar diferentes dispositivos USB. Este objetivo incluye la correcta seleccin del chipset USB y su mdulo correspondiente. Tambi n incluye el conocimiento de la arquitectura bsica de las capas del modelo USB como as tambi n la utilizacin de los diferentes mdulos en las diferentes capas. Peso: 1 Archivos, trminos y utilidades clave: lspci(8) usb-uhci.o usb-ohci.o /etc/usbmgr/ usbmodules /etc/hotplug

Resumen
El mdulos USB principal es usbcore (aunque algunas veces puede incluido en el ncleo) Hay dos tipos de controladores USB: OHCI Open Host Controller Interface (Compaq) UHCI Universal Host Controller Interface (Intel) Todos los dispositivos USB son compatibles con ambos OHCI y UHCI. El uso del juego de chips USB es segn el fabricante de la placa base: OHCI Compaq Ali NEC Opti Chipset lspci less /proc/pci Para reconocer el tipo de controladores USB: Los mdulos USB posibles de usar son: ohci.o, uhci.o or ehci-hcd.o Para cargar el mdulo USB durante el arranque, aada esta entrada a /etc/modules.conf: alias usb uhci Tambin para cargar (post-install) otros submdulos, aada entradas como las siguientes a /etc/modules.conf: alias usb uhci UHCI Intel VIA EHCI (USB 2.0) Intel VIA NEC Philips

21

Tpico 101: Hardware & Arquitectura post-install uhci modprobe printer post-install printer modprobe joydev post-install joydev modprobe hid

El sistema de archivos USBDevFS


Es un sistema de archivos dinmico (igual que /proc) es normalmente montado en /proc/bus/usb. Su entrada en /etc/fstab es como sigue: none /proc/bus/usb usbdevfs defaults 0 0 Despus de montar, el contenido (2 archivos) de /proc/bus/usb se ve as: -r--r--r--r--r--r-1 root root 0 2004-10-18 00:02 devices 1 root root 0 2004-10-18 00:02 drivers

Despus de cargar el controlador (usb-ohci o usb-uhci) el contenido de este directorio crece, para incluir directorios de nombre numrico por cada dispositivo USB (001,002 etc). Los archivos dentro de estos directorios estn en formato formato binario.

Arquitectura de los mdulos USB

hid.o (HID = Human Interface Device) e input.o (Input Core) son slo para teclados USB (usbkbd.o), ratones USB (usbmouse.o) o palanca de juegos USB (Joystick), en otros casos no son necesarios. Otros mdulos USB son: Impresoras : printer.o usb-storage.o Almacenamiento:

Los dispositivos USB pueden ser listados con la orden lsusb.

22

Tpico 101: Hardware & Arquitectura When printer.o is loaded it creates devices /dev/usb/lp0 ..lp1.

Lista de mdulos USB actuales


find /lib/modules/ -name "usb*" -exec basename {} \; usb-ohci.o usb-uhci.o usbcore.o usbserial.o usb-storage.o usb-midi.o usbkbd.o usblcd.o usbmouse.o usbnet.o usbvideo.o usbvnet5.o usbvnet5_2958.o usbvnetr.o

Cargando dinmicamente mdulos USB


Dos sistemas dinmicos estn disponibles para cargar el mdulo USB apropiado cuando un dispositivo USB es insertado. hotplug Abarca todos los dispositivos conectables-en-caliente (hotpluggable): USB, PCMCIA, FireWire(ieee1394) usbmgr Abarca solo dispositivos USB.

hotplug
Durante el arranque el demonio hotplug es iniciado por medio del script /etc/init.d/hotplug. Cuando un nuevo dispositivo es insertado, el ncleo lo percibe y entonces pasa el nombre de un agente como parmetro al demonio listado en el archivo: /proc/sys/kernel/hotplug (normalmente /sbin/hotplug). El ncleo llena entonces la variable de entorno DEVICES con la informacin sobre el dispositivo, y la variable ACTION indicando si el dispositivo fue conectado o desconectado. El demonio hotplug inicia el script agente adecuado. El script agente lee el contenido de las variables DEVICES y ACTION as como tambin (posiblemente) otras variables provistas por el ncleo. Usa tambin el programa usbmodules para indagar sobre el dispositivo insertado. Los 'script agentes' especficos son: USB PCMCIA Firewire (IEEE1394) Network system /etc/hotplug/usb.agent /etc/hotplug/pci.agent (via a bridge) /etc/hotplug/ieee1394.agent /etc/hotplug/net.agent 23

Tpico 101: Hardware & Arquitectura

Archivos involucrados: /lib/modules/*/modules.*map /proc/sys/kernel/hotplug /sbin/hotplug /etc/hotplug/* /etc/hotplug/NAME.agent /etc/hotplug/NAME* /etc/hotplug/NAME/DRIVER /etc/hotplug/usb/DRIVER.usermap /etc/init.d/hotplug Salida de la orden depmod Indica la ruta del programa 'hotplug' Programa hotplug predeterminado Archivos de 'hotplug' Agentes especficos del subsistema 'hotplug' Archivos especficos del subsistema, para agentes Scripts de configuracin de dispositivo, invocados por los agentes Datos de depmod para controladores de usuario (user-mode drivers) Script del sistema para el servicio hotplug. Tambin usado durante el arranque para cargar y configurar dispositivos 'hot-plug' que ya han sido conectados al sistema.

Administrador USB (usbmgr)


Demonio que cargar el mdulo apropiado de acuerdo a 2 parmetros dados por el ncleo: USB-Fabricante-ID y USB-Dispostivo-ID Utiliza los siguientes archivos de configuracin: /etc/usbmgr/usbmgr.conf /etc/usbmgr/preload.conf /etc/usbmgr/host Lista de Fabricante-ID/Dispositivo-ID y nombres de mdulo Lista de mdulos a cargar cuando usbmgr arranca. Lista los nombre de mdulo del controlador USB controller. Cualquiera usb-ohci o usb-uhci.

usbmgr necesita que se reunan las siguientes condiciones: El ncleo debe ser capz de manejar USB (usbcore) USBDEVFS deber ser soportado Los mdules necesarios deben estar disponibles.

24

Tpico 102: Instalacin de Linux & Gestin de paquetes

Tpico 102: Instalacin de Linux & Gestin de paquetes


Peso total para este tpico 1.102.1 1.102.2 1.102.3 1.102.4 1.102.5 o 1.102.6 22

Disear la organizacin del disco............................................................5 Instalar un gestor de arranque................................................................1 Construir e instalar programas desde cdigo fuente..............................5 Gestionar bibliotecas compartidas..........................................................3 Gestin de paquetes en Debian (DEB)....................................................8 Gestin de paquetes en Red Hat (RPM)..................................................8

Resmen
TODO

25

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.1 Diseo de la organizacin del disco fijo


Descripcin: Los candidatos deberan ser capaces de disear un esquema de particionamiento para un sistema de archivos Linux. Este objetivo incluye ubicar sistemas de archivos o espacio swap en particiones o discos separados, y ajustar el diseo segn el propsito de uso del sistema. Tambien incluye ubicar /boot en una particin que sea conforme a los requerimientos del BIOS para poder arrancar. Peso: 5 Archivos, trminos y utilidades clave: / (root) sistema de archivos /var sistema de archivos /home sistema de archivos espacio para swap puntos de montaje particiones cilindro 1024

Jerarqua estandar de archivos (FHS)


Define un estndar para la estructura del sistema de archivos al que se espera se adhieran los sistemas (distribuciones) Linux.

Por qu crear mltiples particiones en Linux ?


Se pueden utilizar varios discos Copias de respaldo sensillas Cuotas de disco activadas por particin Montar particiones en modo slo-lectura para proteccin Posible limitacin del Gestor de Arranque (<1024 cilindros)

Estructura del rbol de directorios


/bin, /dev/, /etc, Mandatorio. Nota: El directorio /root es recomendado en caso de /lib, /sbin que root deba realizar un rescate. /usr /home Puede ser slo-lectura en su propia particin. Recomendado como particin separada. Razones: cuotas, nointerferencia con el resto del sistema, y rpida recuperacin del sistema. Recomendado como particin separada. Razones: cuotas, nointerferencia con el resto del sistema. Altamente recomendado como particin separada. Cuando se llena, no interfiere con el resto del sistema. Configuraciones modificables. Archivos seguro (lock files) para programas y demonios. Archivos de la vitcora del sistema, de demonios y programas.

/tmp /var /var/lib /var/lock /var/log

26

Tpico 102: Instalacin de Linux & Gestin de paquetes /var/run /var/spool /var/tmp PIDs de demonios y programas (si son necesarios). Colas de impresora, correo, etc. Espacio para archivos temporales. Permiso de escritura para todos los usuarios.

Particiones swap
Creado y manejado por: fdisk, mkswap, swapon, swapoff, /etc/fstab Creando un archivo swap (64MiB): dd if=/dev/zero of=/ruta/al/archivoswap bs=1024 count=64000 mkswap /ruta/al/archivoswap 64000 swapon [-p 42] /ruta/al/archivoswap Entrada en /etc/fstab /ruta/al/archivoswap cat /proc/swaps none swap defaults Para ver todas las reas de swap (archivos y particiones)

27

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.2 Instalar un gestor de arranque


Descripcin: El candidato debera ser capaza de seleccionar, instalar y configurar un cargador de arranque. Este objetivo incluye proveer ubicaciones alternativas para bootear y opciones de respaldo en el arranque (por ej: utilizar un disquete de arranque). Peso: 1 Archivos, trminos y utilidades clave: /etc/lilo.conf /boot/grub/grub.conf lilo grub-install MBR super-bloque primera etapa del cargador de arranque MBR (<512 bytes): Etapa 1 Etapa 2 Etapa 3 Partition table and Boot sector

Programa en el MBR o sector-de-arranque, carga el gestor de arranque desde el disco. (realiza un acceso directo al disco) Presenta el men y espera Inicia el sistema operativo seleccionado

LILO
/etc/lilo.conf /boot/boot.b /boot/boot-menu.b /boot/message /boot/boot-bmp.b /boot/map /sbin/lilo Archivo de configuracin Archivo del men de arranque Otros posibles elementos del men

Direccin fsica y tamao del archivo del ncleo. Programa que lee el archivo de configuracin y escribe la primera etapa del cargador al MBR. Usa funciones de la BIOS y crea el archivo /boot/map

Nota: Despus de cualquier cambios al archivos /etc/lilo.conf o cualquier modificacin de la ubicacin o tamao de cualquier archivo en el directorio /boot lilo DEBE ser ejecutado nuevamente. lilo -u Restaura el gestore de arranque previo en el MBR (ej. Windows MBR)

Cdigo que despliega LILO


nada L<NumError> La particin de arranque no est activada o no hay cargador de arranque. La segunda parte de LILO no puede ser cargada y <NumError> es la razn.

28

Tpico 102: Instalacin de Linux & Gestin de paquetes LI La segunda parte de LILO es cargada pero es probablemente invlida. Razn: lilo no fue probablemente ejecutado despus de realizar cambios en /boot o en el archivo de configuracin. La segunda parte de LILO es cargada pero el contenido de /boot/map es incorrecto. Razn: Error del medio o geometra incorrecta del medio. La segunda parte de LILO es cargada pero hay basura. Razn: el archivo /boot/boot.b fue movido o cambiado. La segunda parte de LILO es cargada pero pero el archivo /boot/map tiene basura. Razn: el archivo /boot/map fue movido o cambiado. Todo est bien. LILO fue cargado adecuadamente.

LIL

LIL? LILLILO

Opciones en /etc/lilo.conf
Opciones generales append="reboot=warm" boot=/dev/hda lba32 No revisar la RAM cuando reinicia. Ubicacin donde la etapa 1 de LILO (part1) debe ser escrita. hda=MBR, hda1=Sector de arranque de hda1 El disco tiene ms de 1024 cilindros fsicamente y LILO debera usar modo LBA. Slo es vlido si la BIOS soporta LBA32 Mensage cargado en el MBR con part1 de lilo.conf LILO esperar que el usuario haga su eleccin. Arrancar el sistema predeterminado cuando transcurran 300 = 30 segundos sin intervencin del usuario Ubiacin del ncleo a cargar. Particin que contiene el sistema de archivos raz '/' Ubicacin del archivo que se usa como sistema de archivos temporal en RAM (Ramdrive). Nombre del item en el men. Ubiacin de un S.O. no Linux. Va a esa particin y carga lo que encuentra en el sector de arranque. Normalmente utilizado para arrancar sistemas Windows.

message=/boot/message prompt timeout=300

Secciones individuales del S.O. image = /boot/bzlinuz root = /dev/hda2 initrd = /boot/initrd label = linux other = /dev/hda3

GRUB (GRand Unified Bootloader)


Los discos fijos son enumerados como: (hd0) el primer HD encontrado en el sistema (hd0,0) es la primera particin del primer disco fijo; normalmente /dev/hda1. Men binario NO esttico (/boot/boot.b). En su lugar GRUB utiliza el archivo /boot/grub/menu.lst /boot/grub/grub.conf puede ser usado tambin como archivo de menu/configuracin.

29

Tpico 102: Instalacin de Linux & Gestin de paquetes

Entradas en el archivo de menu/configuracin de GRUB


Opciones generales default=0 Inicia el primer item del men si no hay ninguna seleccin realizada antes de que se cumpla el tiempo de espera. Tiempo de espera de 10 segundos para que el usuario haga un seleccin. Particin y ruta de la imagen que se usa como fondo al presentar el menu. Nombre del tem en el men Dispositivo raz de GRUB El ncleo es /boot/bzlinuz y algunos parmetros como ro y root=/dev/hda1 son pasados al ncleo cuando es iniciado. Ramdrive para usar durante el arranque (si es usado por el ncleo) Usado para intercambiar la asignacin de particiones fsicas. Util para hacer que Windows 98 arranque desde una particin que no es la primera y hacerle creer que si lo es. Fija el dispositivo raz de GRUB sin montarlo. Salta al sector de arranque de la particin y espera encontrar un cargador de arranque. Usualmente empleado para arrancar sistemas Windows. Marcar la particin como activa.

timeout=10 splashimage=(hd0,0)/boot/grub/splash.xpm .gz Secciones individuales del S.O. title linux root (hd0,0) kernel /boot/bzlinuz ro root=/dev/hda1

initrd map (hd0,1) (hd0,0) map (hd0,0) (hd0,1)

rootnoverify (hd0,1) chainloader +1

makeactive

Para arrancar desde un CD/Disquete/HD y utilizar el sistema de archivos raz de otro Linux (ej. /dev/hda4) como su propia raz (/) se debe usar el pmetro de ncleo: root=/dev/hda4

Qu es lo que hace GRUB ?


El archivo de la Etapa 1 (/boot/grub/stage1) es escrita al MBR. Este contiene la direccin fsica del archivo fssys_stage1_5. (fssys=sistema de archivos, por ejemplo /boot/grub/e2fs_stage1_5) Secuencia de arranque de GRUB: MBR (stage1) es cargado stage1 carga el archivo fssys_stage1_5

30

Tpico 102: Instalacin de Linux & Gestin de paquetes fssys_stage1_5 carga el archivo stage2 stage2 carga el archivo del men menu.lst Despus de que la eleccin de un tem del menu es hecha, stage2 carga el ncleo de Linux (vmlinuz) y posiblemente el archivo de Ramdrive initrd

31

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.3 Construir e instalar programas desde el cdigo fuente


Descripcin: Los candidatos deberan ser capaces de compilar e instalar un programa ejecutable desde el cdigo fuente. Este objetivo incluye ser capaz de desempacar un archivo que contiene archivos fuente. Los candidatos deberan ser capaces de realizar pequeas personalizaciones al archivo Makefile, por ejemplo cambiar rutas y agregar directorios include extras. Peso: 5 Archivos, trminos y utilidades clave: gunzip gzip bzip2 tar configure make

Herramientas y archivos utilizados


gzip gunzip bzip2 tar configure Makefile make

Diferencia entre scripts y programas compilados


El CPU slo comprende instrucciones en binario. Los programs deben ser traducidos desde un lenguaje de programacin a binario. Un programa compilado es hecho y el archivo de este programa es binario. Con un script, cada lnea es traducida a binario y entonces es ejecutada.

Verificando la validz del contenido de un paquete


Obtenga el archivo que contiene la cifra de verificacin MD5 del paquete, desde el lugar del cual descarg el paquete. Ponga el archivo del paquete y el archivo de la cifra de verificacin en el mismo directorio y desde all ejecute la siguiente orden md5sum --check <archivo-de-la-cifra-de-verificacin>

Extensiones de archivo estndar para paquetes


Archivos tar Archivos tar comprimidos Archivos comprimidos con la utilidad gzip *.tar *.tar.gz o *.tar.bz2 or *.tgz *.gz

Archivos comprimidos con la utilidad bzip2 *.bz2 32

Tpico 102: Instalacin de Linux & Gestin de paquetes

Desempaquetando archivos
Archivos comprimidos tar (un nuevo directorio va ser creado en el directorio destino): cd <directorio-destino> tar vxzf <archivo>.tar.gz tar vxjf <archivo>.tar.bz2 Archivos tar (empaquetados): tar fcx tarfile.tar Archivos comprimidos: gunzip <archivo>.gz bunzip2 <archivo>.bz2 bzip2 -d <archivo>.bz2 --> --> --> archivo (el <archivo>.gz es eliminado) archivo (el <archivo>.bz2 es eliminado) archivo (el <archivo>.bz2 es eliminado) or or zcat <archivo>.tar.gz | tar xvf bzcat <archivo>.tar.bz2 | tar xvf -

Empaquetando archivos
Creando archivos tar empaquetados: tar vcf nuevo-archivo.tar /dir/a/empaquetar Creando archivos tar empaquetados y comprimidos: tar vczf nuevo-archivo.tar.gz Comprimiendo archivos: gzip archivo bzip2 archivo ----> ----> <archivo>.gz <archivo>.bz2 (el <archivo> es eliminado) (el <archivo> es eliminado) /dir/a/empaquetar tar vcjf nuevo-archivo.tar.bz2 /dir/a/empaquetar

Proceso de compilacin
cd <directorio-de-codigo-fuente> ./configure Este script estudia el entorno del sistema y crea el archivo Makefile make o make all Lee el archivo Makefile e inicia la compilacin de los fuentes. make clean Elimina todos los archivos binarios que resultaron de la compilacin de modo que la prxima ejecucin de make empiece en limpio. make install Instala los archivos compilados y posiblemente otros archivos en el sistema. Normalmente esto es slo posible ejecutar como root. Nota: make examina las marcas de tiempo de los varios archivos involucrados para determinar que archivos binarios deberan ser o no recompilados. Observa si los archivos del cdigo fuente han sido modificados desde la ltima compilacin.

33

Tpico 102: Instalacin de Linux & Gestin de paquetes Modificando el archivo Makefile manualmente Cambios al archivo Makefile deberan ser hechos normalmente para ajustar las rutas de directorio donde se instalarn los programas. Estos parmetros modificables se ubican normalmente al principio del archivo Makefile. Se encuentran en el formato normal de asignacin de variables del intrprete de rdenes: variable=valor

34

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.4 Administrar bibliotecas compartidas


Descripcin: Los candidatos deberan ser capaces de determinar de que biliotecas compartidas dependen e instalan cuano son necesarias los programas ejecutables. Los candidatos deberan ser capaces de saber donde se almacenan las bibliotecas del sistema. Peso: 3 Archivos, trminos y utilidades clave: ldd ldconfig /etc/ld.so.conf LD_LIBRARY_PATH Las bilbiotecas son compartidas en la RAM entre programas que se estn ejecutando. As que slo una copia de la librera compartida es necesaria para ser cargada en la RAM par todos los programas que la usan.

Secuencia de eventos
bash le dice al ncleo que inicie un programa El ncleo inicia el Enlazador de Bibliotecas Dinmico (Dynamic Library Linker) ld.so ld.so busca todas las bibliotecas necesarias para el programa en el siguiente orden: Mira en la lista de rutas que aparecen en la variable de entorno LD_LIBRARY_PATH Mira en las rutas listadas en el cach de bibliotecla /etc/ld.so.cache Mira en los directorios /lib and /usr/lib ld.so se carga a si mismo ld.so carga el programa en memoria y pasa el control al programa

Herramientas y archivos utilizados


LD_LIBRARY_PATH Varibale de entorno que contiene una lista de rutas donde se debe buscar las bibliotecas. Directorios estndar donde la mayora de las bibliotecas son instaladas. Programa que no pierde de vista todas las bilbiotecas del sistema. Cuando una librera est instalada en una ubicacin diferente a una de las ubicaciones estndar, entonces se necesita hacer lo siguiente: Aadir la ruta a esa librera en el archivo /etc/ld.so.conf Ejecutar ldconfig. Esto actualiza la cach de rutas a libreras: /etc/ld.so.cache /etc/ld.so.conf /etc/ld.so.cache Archivo de configuration de ldconfig Cache de rutas a libreras

ldd /path/to/program Lista todas las bibliotecas que un programa necesita /lib /usr/lib /usr/local/lib ldconfig

35

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.5 Utilizar Administracin de paquetes Debian


Descripcin: Los candidatos deberan ser capaces de realizar tareas de administracin de paquetes utilizando el administrador de paquetes Debian. Este objetivo incluye ser capaz de utilizar comandos y herramientas interactivas para instalar, actualizar o desinstalar paquetes, como as tambi n buscar paquetes que contengan archivos o software especfico (como asi tambien paquetes que pueden o no estar instalados). Estae objetivo tambin incluye ser capaz de obtener informacin sobre un paquete como versin, contenido, dependencias, integridad del paquete y estado de instalacin (si est o no instalado). Peso: 8 Archivos, trminos y utilidades clave: unpack configure /etc/dpkg/dpkg.cfg /var/lib/dpkg/* /etc/apt/apt.conf /etc/apt/sources.list dpkg dselect dpkg-reconfigure apt-get alien TODO

36

Tpico 102: Instalacin de Linux & Gestin de paquetes

1.102.6 Utilizar el Administrador de paquetes de Red Hat (RPM)


Descripcin: Los candidatos deberan ser capaces de realizar administracin de paquetes bajo distribuciones Linux que utilicen RPM para la distribucin de paquetes. Este objetivo incluye ser capaz de instalar, re-instalar, actualizar y remover paquetes, como as tambien obtener el estado y la informacin de los paquetes. Este objetivo tambi n incluye otener informacin como ser versin, estado, dependencas, integridad y firmas. Los candidatos deberan ser capaces de determinar que archivos un paquete provee, como tabien encontrar de qu paquete proviene un archivo. Peso: 8 Archivos, trminos y utilidades clave: /etc/rpmrc /usr/lib/rpm/* rpm grep

Formato del nombre-de-archivo de paquetes RPM


NombrePaquete-Version.Arquitectura.rpm

Contenido de los paquetes RPM


Informacin acerca del paquete Lista de los archivos a instalar Lista de dependencias 4 Scripts: Antes de instalar, Antes de desinstalar, Despus de instalar, Despus de desinstalar Archivos a instalar

Base de datos RPM


/var/lib/rpm/* /usr/lib/rpm/* rpm --rebuilddb Directorio de la base de datos RPM de paquetes instalados (en formato binario) Directorio de herramientas RPM necesarias para manejar paquetes RPM Reconstruye la base de datos RPM

Sintaxis
rpm accin [opciones] nombre-de-paquete[.rpm]

37

Tpico 102: Instalacin de Linux & Gestin de paquetes

Accin
Formato corto -i Formato largo --install Descripcin Instala el paquete. Trabaja slo cuando no hay otra de versin anterior del paquete previamente instalada. Actualiza el paquete. Trabaja como instalar pero tambin borra una versin anterior del paquete. Actualiza el paquete. Trabaja slo cuando una versin anterior del paquete est previamente instalada. Desinstala (borra) el paquete.

-U

--upgrade

-F

--freshen

-e

--erase

Optiones de instalacin
Formato corto Formato largo --nodeps --noscripts --test --excludedocs --replacepkgs --replacefiles --oldpackage --force Descripcin Instala sin verificar dependencias. No se corrern los scripts de Pre/PostInstalacin. No instala, solamente simula la instalacin. Instala pero sin documentacin. Instala todo aun si algunos paquetes estn ya instalados. Sobrescribe archivos previamente instalados si estos existen. Permite instalar una versin anterior (downgrading) del paquete. Instala sin importar que. Puede ser visto lo mismo que: --replacepkgs --replacefiles --oldpackage

Opciones de desinstalacin
Formato corto Formato largo --nodeps --noscripts --test Descripcin Desinstala sin verificar dependencias. No se corrern los scripts de Pre/PostInstalacin. No desinstala, solamente simula la desinstalacin.

38

Tpico 102: Instalacin de Linux & Gestin de paquetes Formato corto Formato largo --allmatches Descripcin Desinstala todos los paquetes cuyos nombres coinciden con el patrn. En este caso no se van a producir errores coincide con 2 o ms paquetes.

Consulta de paquetes
Use la opcin -q o --query ms otras opciones de consulta listadas abajo. Si la consulta es hecha sobre un paquete instalado, el nombre del paquete se indica slo sin necesidad del nmero de versin o revisin o la extensin .rpm. Si la consulta es hecha sobre un paquete en forma de archivo RPM, entonces el nombre del archivo RPM incluyendo la extensin .rpm debe ser dado como nombre del paquete. Formato corto -q[optiones] i l c d Formato largo --query --info --list --configfiles --docfiles --provides R --requires --changelog --scripts --dump --filesbypkg --last --state Descripcin Pregunta si el paquete de nombre indicado est instalado (sin .rpm en el nombre) Informacin de la cabecera del paquete. Lista de todos los archivos. Lista de los archivos de configuracin. Lista de los archivos de documentacin. Programas/Bibliotecas provistas por el paquete. Lista los archivos de los cuales este paquete depende. Muestra el registro de cambios (Changelog) en el paquete. Muestra los 4 scripts de Instalacin/Desinstalacin. Lista de todos los archivos y sus atributos. Igual que --list pero aadiendo el nombre de paquete por lnea Fecha de la ltima instalacin del paquete. Como --list pero indica el estado de los archivos: normal, no instalado o remplazado Extrae temes especficos de informacin de la cabecera. Ej. rpm -q --qf %{Description} apache Muestra slo la parte que corresponde a la descripcin del paquete. Ej. rpm -qa --qf "%{NAME}\n"|sort|less Lista slo los nombres de todos los paquetes instalados.

--qf %{QUERYTAG} --queryformat %{QUERYTAG}

39

Tpico 102: Instalacin de Linux & Gestin de paquetes Formato corto Formato largo --querytags Descripcin Lista los posibles QUERYTAGs que se pueden utilizar en --queryformat.

Opciones de consulta de paquetes (combinado con la opcin -q)


Formato corto a f p Formato largo --all --file archivo --package --whatrequires Descripcin Consulta todos los paquetes instalados Consulta que paquete instalado es dueo del archivo indicado (indicar la ruta absoluta) Hace la consulta sobre un paquete especfico no instalado (archivo RPM) Consulta que paquetes instalados dependen de este. rpm -q --whatrequires --qf "%{NAME}\n" apache|less Muestra todos los nombres de paquetes que dependen del paquete apache. Programa o biblioteca (incluyendo la ruta absoluta) Consulta todos los paquetes instalados que proveen este programa o biblioteca. rpm -q --whatprovides --qf "%{NAME}%{VERSION}-%{RELEASE}\n" /bin/sed Muestra los paquetes que proveen /bin/sed. La misma salidaque: rpm -qf /bin/sed Todos los paquetes instalados que pertenecen al grupo indicado Nota: rpm -qa --qf "%{GROUP}\n" | sort -u | less Lista los nombres de grupo al que pertenecen los paquetes instalados.

--whatprovides

g group

--group grupo

Ejemplos
rpm -qil NombrePaquete Informacin del paquete y la lista de los archivos instalados del paquete. rpm -qa | sort | less Muestra todos los paquetes instalados rpm -qai | grep -2 "^Release" | less Igual que el anterior pero muestra informacin ms completa. rpm -hiv Paquete.rpm Instala el paquete y muestra una barra de progreso (#) rpm -hiv --replacefiles Paquete.rpm

40

Tpico 102: Instalacin de Linux & Gestin de paquetes Instala sobre el paquete existente mostrando una barra de progreso (hash #) rpm -hUv Paquete.rpm Atualiza mostrando una barra de progreso (hash #) rpm -hUv --force Paquete.rpm Actualiza y sobrescribe el paquete existente aun si hay un conflicto o problema de dependencias. rpm -qf /algun/archivo Dice a cual paquete pertenece este archivo (use una ruta absoluta) rpm -qdf /algun/archivo Dice que archivos de documentacin vienen con este paquete (use una ruta absoluta)

Consultando paquetes RPM que no estn instalados


rpm -qpi Paquete.rpm Muestra informacin de la cabecera de este paquete rpm -qpl Paquete.rpm Lista de todos los archivos que son instalados por este paquete

Ejemplos avanzados
rpm -qa --qf "%{NAME} : %{SUMMARY}\n" | sort | less Para mostrar una lista de todos los paquetes previamente instalados junto a un resumen. rpm -qai | awk -F: ' /^Name|^Version/ {print $1,$2} /^Version/ \ {print ""}' | cut -b-30 | grep -1 $1 Para buscar paquetes instalados previamente por un patrn dado: rpm -qp --filesbypkg *.rpm | grep filename Para buscar entre archivos de paquetes RPM no instalados por un nombre de archivos dado.

Verificando integridad de paquetes


rpm -V NombrePaquete Verifica la integridad del paquetes indicado rpm -Va Verifica la integridad de todos los paquetes instalados El resultado de las dos anteriores rdenes va mostar el siguiente resultado: Una lnea por archivo es mostrado. Cada lnea contiene un campo de estado (8 letras), un tipo de archivo (1 letra) y un nombre archivo. Ej. S.5....T c /etc/samba/smbpasswd 41

Tpico 102: Instalacin de Linux & Gestin de paquetes Significado del campo de estado: . S U M G 5 T L D OK, todo en orden El tamao del archivo ha sido cambiado El propietario (dueo) del archivo ha sido cambiado Los derechos o permisos de acceso han sido cambiados El grupo del archivo ha sido cambiado La cifra de comprobacin MD5 no coincide Las marcas de tiempo han sido cambiadas Fallo en la llamada a la funcin del sistema readlink Los nmero Mayor/Menor del archivo de dispositivo ha sido cambiado

Significado del tipo de archivo <espacio> c ? Archivo normal Archivo de configuracin No se pudo revisar (posiblemente debido a una falla de acceso para lectura)

Prueba de firma PGP y GPG


Sintaxis: rpm --checksig Paquete.rpm El resultado debera ser: Paquete.rpm md5 gpg OK ^^^^^^^^^^

Extracto de la pgina del manual de RPM


QUERYING AND VERIFYING PACKAGES
rpm {-q|--query} [select-options] [query-options] rpm {-K|--checksig} [--nogpg] [--nopgp] [--nomd5] PACKAGE_FILE ... rpm {-V|--verify} [select-options] [--nodeps] [--nofiles] \ [--nomd5] [--noscripts]

INSTALLING, UPGRADING, AND REMOVING PACKAGES


rpm {-i|--install} [install-options] PACKAGE_FILE ... rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... rpm {-F|--freshen} [install-options] PACKAGE_FILE ... rpm {-e|--erase} [--allmatches] [--notriggers] [--repackage] [--nodeps] [--noscripts] \ [--test] PACKAGE_NAME ...

42

Tpico 102: Instalacin de Linux & Gestin de paquetes

MISCELLANEOUS
rpm rpm rpm rpm {--initdb|--rebuilddb} {--querytags|--showrc} {--addsign|--resign} PACKAGE_FILE ... {--setperms|--setugids} PACKAGE_NAME ...

SELECT-OPTIONS
[PACKAGE_NAME] [-a,--all] [-f,--file FILE] [-g,--group GROUP] [-p,--package PACK-AGE_FILE] [--querybynumber NUMBER] [--triggeredby PACKAGE_NAME] [--whatprovides CAPABILITY] [--whatrequires CAPABILITY]

QUERY-OPTIONS
[--changelog] [--filesbypkg] [--provides] [--scripts] [-c,--configfiles] [-d,--docfiles] [--dump] [-i,--info] [--last] [-l,--list] [--qf,--queryformat QUERYFMT] [-R,--requires] [-s,--state] [--triggers,--triggerscripts]

INSTALL-OPTIONS
[--allfiles] [--force] [--ignoreos] [--noorder] [--percent] [--repackage] [--badreloc] [--excludepath OLDPATH] [--excludedocs] [-h,--hash] [--ignoresize] [--ignorearch] [--includedocs] [--justdb] [--nodeps] [--noscripts] [--notriggers] [--oldpackage] [--prefix NEWPATH] [--relocate OLDPATH=NEWPATH] [--replacefiles][--replacepkgs] [--test]

Nota: Las opciones para construir paquetes no se han includo aqu. Vea la pgina del manual para mayor informacin. Otra fuente de informacin son: http://www.rpm.org Los programas kpackage, KpackViewer y kpm

43

Tpico 103: Ordenes GNU & Unix

Tpico 103: Ordenes GNU & Unix


Peso total para este tpico 1.103.1 1.103.2 1.103.3 1.103.4 1.103.5 1.103.6 1.103.7 1.103.8 31

Trabajo en la lnea de rdenes................................................................5 Procesar flujos de texto usando filtros....................................................6 Realizar gestin bsica de archivos........................................................3 Uso de flujos, redirigirlos y tuberas.......................................................5 Crear, monitorear, y terminar procesos..................................................5 Modificar la prioridad de ejecucin de procesos.....................................3 Buscar en archivos de texto usando expresiones regulares....................3 Realizar operaciones bsicas de edicin de archivos con vi....................1

Resmen
TODO

44

Tpico 103: Ordenes GNU & Unix

1.103.1 Trabajo en la lnea de rdenes


Descripcin: Los candidatos deberan ser capaces de interactuar con intrpretes de rdenes y utilizar instrucciones en la lnea de rdenes. Esto incluye escribir rdenes vlidas y secuencias de rdenes; definir, referenciar y exportar variables de entorno, usar la historia de rdenes y sus mecanismos de edicin, invocar rdenes en la ruta (path) y fuera de la ruta de rdenes (path), usar sustitucin de rden, aplicar rdenes recursivamente atravz de un rbol de directorios y usar la orden man para descubrir informacin sobre rdenes. Peso: 5 Archivos, trminos y utilidades clave: . bash echo env exec export man pwd set unset ~/.bash_history ~/.profile Formato de una rden (orden, opciones y argumentos) Forma de una opcin: corta (-) o larga (--) Las opciones de forma corta admiten combinaciones Introduccin de rdenes Las que estn en la ruta de rdenes (PATH) Las que no estn en la ruta de rdenes (PATH) '.' como parte de la ruta y ./orden En que lugar estoy ?: pwd Indicador o prompt ($PS1) y sintaxis de orden incompleta ($PS2) Introduccin de secuencia de rdenes Con ';' y '&'

Variables del intrprete (locales) y del entorno (exportadas)


Variables exportadas (variables de entorno)
env printenv export declare -x variable[=valor] Lista todas las variables del entorno Igual que env Lista todas las variables exportadas (entorno) Define una variable de entorno 45

Tpico 103: Ordenes GNU & Unix export variable[=valor] Define una variable de entorno

Fijando y removiendo variables


set set variable=valor unset variable Lista todas las variables locales y de entorno incluyendo funciones Fija la variable de entorno y le asigna un valor Remueve una variable de entorno

Variables de Slo-lectura (variables que no pueden ser cambiadas o removidas)


readonly readonly variable Lista todas las variables de slo-lectura Pone la variable en modo de slo-lectura

$TERM (tipo de terminal presente)


screen dumb linux xterm Consola en modo 'screen' Desde cron Desde tty1-tty6 Terminal en Xserver

Base de datos con informacin del tipo de terminal /etc/termcap Archivo antiguo, sigue siendo utilizado por SuSE /etc/terminfo/* Nuevos archivos utilizados por Debian

Sustitucin de orden
`orden` Antigua sintaxis $(orden) nueva sintaxis Ejemplo: echo "Mi directorio actual es `pwd`" ls -la /lib/modules/$(uname -r)/*

Historia de rdenes y edicin


Navegacin en la historia de rdenes
set +o history Desactiva la funcin de historia de rdenes 46

Tpico 103: Ordenes GNU & Unix set -o history $HISTFILE $HISTFILESIZE $HISTSIZE history history 10 fc -l -10 fc -l patrn <Ctrl>-r history -c !! !n !-n !cadena !? cadena <Ctrl>-p <Ctrl>-n <Alt>-< <Alt>-> Activa la funcin de historia de rdenes Variable que contiene el nombre del archivo de historia. Normalmente es ~/.bash_history Variable que contiene el mximo nmero rdenes que el archivo de historia puede guardar. Valor predeterminado 500 Variable que contiene el mximo nmero de rdenes en la historia. Valor predeterminado 500 Muestra la historia de rdenes completa Muestra las ltimas 10 lneas de la historia de rdenes Muestra las ltimas 10 lneas de la historia de rdenes Busca en la historia el patrn y muestra resultado Bsqueda en sentido inverso en la historia Borra la historia de rdenes Repite la ltima orden Repite la orden de la lnea n en la historia Repite la orden n lneas atrs en la historia Repite la ms reciente orden que empieza con cadena Repite la ms reciente orden que contiene la cadena Lnea anterior en la historia (tambin flecha del cursor arriba) Lnea siguiente en la historia (tambin flecha del cursor abajo) Ir al principio de la historia Ir al final de la historia

^cadena1^cadena2 Sustitucin rpida de cadena1 por cadena2

Edicin en la lnea de rdenes


Teclas de edicin como en E-macs: biblioteca readline <Ctrl>-l <Ctrl>-b <Ctrl>-f <Ctrl>-a <Ctrl>-e <Ctrl>-k <Ctrl>-d <Ctrl>-w <Alt>-d <Ctrl>-y Borra la pantalla Mueve el cursor a la izquierda (tambin flecha izquierda) Mueve el cursor a la derecha (tambin flecha derecha) Mueve el cursor al comienzo de la lnea (tambin tecla Inicio) Mueve el cursor al final de la lnea (tambin tecla Fin) Borra el texto desde el cursor al final de la lnea Borra el caracter en la posicin del cursor (tambin tecla Supr) Borra desde el cursor hasta el comienzo de la palabra actual Borra desde el cursor hasta el final de la palabra actual Pega el texto previamente borrado

47

Tpico 103: Ordenes GNU & Unix

Aplicando rdenes recursivamente (-r,-R,--recursive)


Orden ls chown chmod chgrp grep cp rm Formato corto -R -R -R -R -r -r y -R -r y -R Formato largo --recursive --recursive --recursive --recursive --recursive --recursive --recursive

man e info
man [n] orden Invoca la pgina del manual de la orden indicada. n representa la seccin de las pgina del manual (1 a 9). Secciones posibles: 1 2 3 4 5 6 7 8 9 Programas ejecutables u rdenes Llamadas al sistema (funciones realizadas por el ncleo) Llamadas a bibliotecas (funciones provistas por bibliotecas de programas) Archivos especiales (usualmente encontrados en /dev) Convenciones y formatos de archivos. Ej. /etc/passwd Juegos Miscelneos (incluyendo macros, protocolos de red, cdigo de caracteres), Ej. man(7), groff(7) Ordenes de Administracin del Sistema (usualmente slo para root) Rutinas del ncleo [no estndar]

48

Tpico 103: Ordenes GNU & Unix

1.103.2 Procesar flujos de texto usando filtros


Descripcin: Los candidatos deberan ser capaces de aplicar filtros a flujos de texto. Las tareas incluyen enviar archivos de texto y flujos de salida a travs de utilidades de texto para modificar la salida, y usar rdenes UNIX estndar encontradas en el paquete GNU textutils. Peso: 6 Archivos, trminos y utilidades clave: cat cut expand fmt head join nl od paste pr sed sort split tac tail tr unexpand uniq wc

Lista de rdenes
cut expand unexpand fmt head join nl od paste pr split cat tac tail tr Extrae columnas/campos de archivos de texto Expande Tabulaciones a Espacios en archivos de texto Opuesto a expand Reformatea prrafos en archivos de texto Muestras las primeras n lneas de un archivo de texto Une lneas de texto por campos comunes en archivos de texto Numera lneas en archivos de texto Muestra el contenido del archivo en Octal, Hexadecimal o Decimal. Escribe una a una las lneas correspondientes a 2 archivos de texto Formatea archivos de texto de forma adecuada para impresin Divide archivos grandes en mltiples archivos pequeos Concatena archivos / Muestra el contenido de archivos Muestra el contenido de archivos de manera invertida (de fin a inicio) Muestra las ltimas n lneas de un archivo de texto Convierte o borra caracteres

49

Tpico 103: Ordenes GNU & Unix wc xargs sed sort grep more less uniq Cuenta el nmero de caracteres, palabras y lneas en un archivo texto Extiende el resultado de una orden en una secuencia de argumentos Editor de flujos de texto Ordena el contenido en archivos de texto Filtra/extrae lneas de un archivos de texto Muestra el contenido de archivos por pgina Muestra el contenido de archivos por lneas (adelante/atrs) Descarta lneas sucesivas idnticas

Ejemplos de uso
cut -dx -fy
cut -d: -f1,6 /etc/passwd (extrae campos 1 y 6) Extrae columnas del archivo: campo(y), separador(x)

expand
expand /etc/init.d/at > ~/atnew Expande (convierte) TABs a espacios en archivos de texto

unexpand
unexpand -a /etc/services > ~/serv ; vi ~/serv Opuesto de expand: Convierte espacios a TABs en archivos de texto

fmt
fmt -w50 /usr/share/doc/packages/apache/ABOUT_APACHE Reformatea el archivo de texto. Cada lnea debe tener al menos un espacio.

head [-|+][n]
head -40 /etc/services Muestra las primeras 40 lneas del archivo. Si no se indica la cantidad de modo predeterminado es 10.

join
join -t: -11 -21 /etc/passwd /etc/shadow Une lneas de datos en archivos con campos comunes

nl
nl -ba /etc/inittab

50

Tpico 103: Ordenes GNU & Unix Enumera las lneas vacas tambin Opciones predeterminadas: v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn Ejemplos nl -s" - " /etc/services Enumera las lneas agregando " - " despus del nmero de lnea nl -bp"^#" /etc/inittab Enumera slo las lneas que empiezan con '#'

od -bih -t x
Muestra el contenido del archivo en Octal (-b), Decimal(-i) o Hexadecimal.(-h). Ejemplo: od -h /bin/ping x = Tipo de formato -a igual que -t a, selecciona caracteres -b igual que -t oC, selecciona bytes en octal -c igual que -t c, selecciona caracteres ASCII o '\' escapes -d igual que -t u2, selecciona decimales cortos sin signo -f igual que -t fF, selecciona nmeros flotantes -h igual que -t x2, selecciona hexadecimal cortos -i igual que -t d2, selecciona decimal cortos -l igual que -t d4, selecciona decimal largos -o igual que -t o2, selecciona octal cortos -x igual as -t x2, selecciona hexadecimal cortos Nota: -x no es lo mismo que -tx

paste
Ejemplo 1: 51

Tpico 103: Ordenes GNU & Unix paste /etc/passwd /etc/shadow Ejemplo 2: cut -d: -f1 /etc/passwd > file1 cut -d: -f3 /etc/passwd > file2 paste -d: file1 file2 > file3

pr
pr /etc/services | less

split -lx -by[b|k|m]


Divide un archivo en mltiples archivos de (x) lneas, (y) bytes, kilobytes o megabytes. Sintaxis: split [opciones] archivo prefix Ejemplo 1: split -l100 /etc/services serv Crea los archivos servaa servbb etc. Para obtener el archivo original nuevamente: cat serv?? > services2 Ejemplo 2: split -b1440k /bin/rpm rpms (para copiar a disquetes). Crea rpmsaa rpmsab etc. Para obtener el archivo original nuevamente: cat rpms?? > rpm2

cat
Ejemplo 1: cat -n /etc/hosts Muestra todas las lneas del archivo enumerndolas (-n) Ejemplo 2: cat -b /etc/hosts Enumera slo las lneas no vacas

tac
tac /etc/passwd Muestra el contenido del archivo desde la ltima lnea a la primera, es decir al revs. Compare con: cat /etc/passwd

tail [-|+][n]
Ejemplo 1: 52

Tpico 103: Ordenes GNU & Unix tail -30 /etc/services Muestra las ltimas 30 lneas. Si no se indica n de modo predeterminado es 10 Ejemplo 2: tail +100 /etc/services Omite las primeras 100 lneas y muestra el resto del archivo hasta el final Ejemplo 3: tail -fs5 --retry /var/log/httpd/error_log Lee las ltimas 10 lneas del archivo cada 5 segundos y se mantiene reintentando an si el archivo no est disponible.

tr -d
tr "a-z" "A-Z" < /etc/motd Convierte letras minsculas a maysculas (a-z A-Z) tr -d "#" < /etc/services | less Borra todos los caracteres #

wc -l|-w|-c
wc /etc/motd Sin opciones muestra el nmero de lneas (-l), el nmero de palabras (-w) y el nmero de caracteres (-c)

xargs
Lee lneas de texto desde una tubera y las convierte en parmetros para pasarlos a una orden especfica, como mximo 64kb por orden lanzada. find /etc -name *.conf | xargs cat > /tmp/confs Encuentra todos los archivos .conf en /etc y acumula sus contenidos en un solo archivo llamado /tmp/confs.

sed
sed 's/#/;-/g' /etc/services Busca el caracter # y reemplaza todas sus ocurrencias (g: sustitucin global) por los caracteres ;sed '12,$s/Versions/Revisions/g' Empieza la sustitucin global(g) en la lnea 12 hasta el final del archivo ($)

sort -ky[n] -tx


Ordena archivos de texto por un campo(y), el separador de campo(x) predeterminado es uno o mas espacios. ls -la | sort -k5n

53

Tpico 103: Ordenes GNU & Unix Ordena numricamente(n) por tamao de archivo: campo nmero 5

grep [-virns]
Extrae todas las lneas de texto donde el patrn es [no es] encontrado grep -ins "^f.p.*SSL" /etc/services Muestra todas las lneas donde el patrn (ignorando maysculas/minsculas:-i) es encontrado con su nmero de lnea correspondiente (-n) y sin mensajes de error (-s). ps -ax | grep httpd | grep -v grep Muestra todas las instancias de procesos donde aparece httpd excluyendo (-v) la propia orden grep httpd

more
more -30 /etc/services Muestra el archivo de 30 en 30 lneas al presionar la barra espaciadora, muestra la siguiente lnea si se presiona Enter.

less
less -X +G /etc/services Ir al final de la lnea (+G) y dejar la pantalla tal como est (-X) cuando salga de less. less -phttps /etc/services Cargar el archivo e ir a la primera ocurrencia del patrn https

uniq
Filtra lneas consecutivas repetidas en un archivo rpm -qa --qf "%{LICENSE}\n" | sort | uniq | less o rpm -qa --qf "%{LICENSE}\n" | sort -u | less Muestra todos los tipos de licencias usadas por los paquetes instalados

awk -Fx
Herramienta avanzada de reconocimiento y procesamiento de patrones awk -F: '{ print $1,"\t- ", $3 }' /etc/passwd Toma como separador de campos ':' (x) e imprime los campos 1 y 3 separados por un tabulador (\t) seguido de un guin.

54

Tpico 103: Ordenes GNU & Unix

1.103.3 Realizar gestin bsica de archivos


Descripcin: Los candidatos deberan ser capaces de usar las rdenes bsicas de UNIX para copiar, mover, y borrar archivos y directorios. Las tareas incluyen operaciones avanzadas de manejo de archivos tales como copiar mltiples archivos recursivamente, borrar directorios recursivamente y mover archivos que cumplen determinado patrn de comodn (wildcard). Esto incluye utilizar especificaciones simples y avanzadas de comodines para referirse a archivos, as como tambin utilizar la orden find o locate y accionar en archivos basados en su tipo, tamao o fecha y hora. Peso: 3 Archivos, trminos y utilidades clave: cp find mkdir mv ls rm rmdir touch file globbing

cd
cd /<directorio> Cambia al directorio utilizando la ruta absoluta cd <directorio> Cambia al directorio utilizando una ruta relativa cd ~foo Cambia al directorio de trabajo (home) del usuario foo

ls
ls [directorio|archivo] Lista el contenido del directorio o muestra informacin del archivo ls -lai /etc Listado en formato largo de los archivos en /etc, incluyendo nmero de nodos-i y archivos ocultos

cp
cp origen destino Copia archivos o directorios cp origen1 origen2 ... . Copia todos los archivos al directorio actual (.) cp /dev/null nuevoarchtemp Crea un nuevo archivo vaco 55

Tpico 103: Ordenes GNU & Unix

mv
mv origen destino Mueve o renombra archivos o directorios mv -f archivo1 archivo2 -f es la opcin predeterminada. Permite sobrescribir si el archivo2 ya existe mv -i archivo1 archivo2 Solicita confirmacin antes de sobrescribir

mkdir
Crea directorios. Opciones: -p|--parents Crea los directorios padres (ruta completa) necesarios, existan o no -m 755 Establece los permisos de acceso indicados

rmdir
Borra directorios. Opciones: -p|--parents Borra los directorio padre especificados en la lnea de rdenes. Los directorios padre deben estar vacos (no contener archivos).

touch
Cambia las marcas de tiempo (fecha y hora) de un archivo. Tambin puede ser utilizado para crear archivos vacos: touch archivo1

Nombrando archivos con comodines (globbing)


* ? [...] [......] [!...]

Encontrando archivos con find


Vea la pgina del manual de la orden find

56

Tpico 103: Ordenes GNU & Unix

1.103.4 Uso de flujos, redirigirlos y tuberas


Descripcin: Los candidatos deberan ser capaces de redirigir flujos de E/S y conectarlos de modo que se puedan procesar eficientemente datos de texto. Las tareas incluyen redirigir entrada estndar, salida estndar y error estndar, entubar la salida de una orden como entrada de otra orden, usar la salida de una orden como argumentos para otra orden y enviar la salida estndar a ambos la pantalla y a un archivo. Peso: 5 Archivos, trminos y utilidades clave: tee xargs < & << > & >> | ` `

E/S Estndar
STDIN Descriptor de archivo 0. Los programas obtienen datos de entrada desde este archivo, al menos que se indique otra cosa. STDOUT Descriptor de archivo 1. Los programas envan datos de salida a este archivo, al menos que se indique otra cosa. STDERR Descriptor de archivo 2. Los programas envan mensajes de error a este archivo, al menos que se indique otra cosa.

Tuberas ('|')
(pipes en ingls) Enva la salida de la primera orden como entrada de la segunda orden. Nota: '|' redirige solamente STDOUT y NO STDERR prog1 2>&1 | prog2 Redirige STDOUT y STDERR

| xargs
Usa la salida de un programa como una lista de argumentos para otro programa [prog1] | xargs prog2 Lo mismo que: [prog2] $(prog1) La diferencia es que xargs entregar los argumentos en volmenes de 64kBytes a prog2 y ejecutar prog2 mltiples veces hasta que todos los argumentos (salida de prog1) sean utilizados. Ejemplo: 57

Tpico 103: Ordenes GNU & Unix find /etc -name "issue*" 2> /dev/null | xargs grep -c "Linux" Imprime una cuenta del nmero del nmero de veces que los archivos coincidentes con /etc/issue* contienen la palabra Linux. find devuelve una lista de archivos que coinciden con /etc/issue*, y xargs enva cada uno de estos nombres de archivo convertido en un parmetro para la orden grep. grep correr tantas veces como haya nombres de archivo que coincidan.

Redirigir
> >> << < 1> 2> &> 2>&1

>
Si el archivo existe lo sobrescribe, en otro caso crea un nuevo archivo, entonces procesa la orden, y luego escribe la STDOUT de la orden en el archivo. sed 's/#/;/g' archivo1 > archivo1 Ojo: Sobrescribe archivo1 con un archivo vaco !!! >nuevoarchivo Igual que: touch nuevoarchivo

>>
Similar a >, pero aade la salida al final del archivo si este existe

<
Redirige STDIN desde un archivo en lugar de leer desde el teclado. prog < archivo1 Lee su entrada desde archivo1.

<<
'documento-aqu' (documento en lnea) prog << EOF El texto va aqu... EOF prog toma como entrada el texto que aparece entre la primera marca EOF y la ltima marca EOF. La marca puede ser cualquier secuencia de caracteres. Ej.: END, DOC, XYZ

Combinando salidas
prog 2>&1 1>archivo prog &>archivo Ambas rdenes combinan STDOUT y STDERR para ser enviados a archivo 58

Tpico 103: Ordenes GNU & Unix

tee
programa | tee archivo Redirige la salida del programa a ambos STDOUT y archivo prog1 | tee archivo1 | prog2 | tee archivo2 | prog3 > archivo3 entrega el mismo resultado que las siguientes rdenes desconectadas: prog1 > archivo1 prog2 < archivo1 > archivo2 prog3 < archivo2 > archivo3

59

Tpico 103: Ordenes GNU & Unix

1.103.5 Crear, monitorear, y terminar procesos


Descripcin: Los candidatos deberan ser capaces de gestionar procesos. Esto incluye saber como ejecutar trabajos en primer y segundo plano, llevar un trabajo desde segundo plano a primer plano y viceversa, iniciar un proceso que se va ejecutar sin estar conectado a una terminal y sealizar un programa para que contine corriendo despus de cerrar una sesin. Las tareas tambin incluyen monitorear procesos activos, seleccionar y ordenar procesos para mostrar, envo de seales a los procesos, matar procesos e identificar y matar aplicaciones X que no terminaron despus de que la sesin X fue cerrada. Peso: 5 Archivos, trminos y utilidades clave: & bg fg jobs kill nohup ps top PID: Identificador de proceso, un entero nico de 16-bits dado a un proceso por el ncleo cuando se inicia. PPID: Identificador del proceso padre El PID de su proceso padre.

Ordenes para ver procesos


ps Muestra la tabla de procesos Ejemplos: ps waux Muestra todos los procesos en formato ancho con el nombre de usuario ps caux Muestra todos los procesos con nombre de usuario y la verdadera orden. Prctico para usar con la orden killall. ps -fe Muestra todos los procesos (-e) con listado completo (-f) ps -la Todos los procesos (-a) excluyendo lderes de sesin ps -eo "%p &P %n %y %x %c" Formatea la salida de la forma: PID PPID NICE TTY TIME %p %P %n %y %x pstree Muestra los procesos en forma de rbol 60 COMMAND %c

Tpico 103: Ordenes GNU & Unix top Muestra interactivamente los procesos 'ms hambrientos'

Sealizando procesos activos


kill SIGxxx Enva una seal a un proceso Ejemplo: kill SIGHUP 1329 lo mismo que: kill HUP 1329 kill -1 1329 nohup programa Ejecuta programa con inmunidad a la seal HUP (lo ignora si recibe esta seal). STDOUT y STDERR es enviado a ./nohup.out o $HOME/nohup.out kill -l Muestra un listado de seales posibles

Terminacin de procesos
kill [-9] Matar brutalmente un proceso killall Mata muchos procesos que tienen el mismo nombre con una sola orden xkill Programa X para matar un proceso que es dueo de una ventana pkill Vea la pgina del manual de pkill skill [seal] [opcion] parametro Permite el envo de seales a mltiples procesos al mismo tiempo. Opciones & parmetros de skill: -t terminal Afecta a los procesos que estn corriendo en una terminal especfica. (ttyx o pts/x) -u nombre_usuario1 [nombre_usuario2....] Afecta a los procesos que pertenecen a uno o ms usuarios. -p PID1 [PID2 ...] Afecta a los procesos que tienen los PID(s). -c nombre_orden 61

Tpico 103: Ordenes GNU & Unix Afecta a los procesos cuya orden es igual a nombre_orden Ejemplos: skill -KILL -v pts/* Mata y lista (-v) todos los procesos en el nuevo estilo de dispositivos PTY skill -STOP viro leya davem Detiene procesos de 3 usuarios: viro, leya y davem

Control de trabajos y '&'


bg [%n] Reanudar en segundo plano el trabajo n o el trabajo actual detenido fg [%n] Llevar a primer plano el trabajo n o trabajo actual en segundo plano jobs [opcin] Muestra el estado de todos los trabajos Opciones: -n Estado desde el ltimo cambio de trabajo -r Listado de trabajos corriendo solamente -s Listado de trabajos detenidos solamente -l Muestra el estado de todos los trabajos y sus ID de proceso -p Muestra el ID de proceso de todos los trabajos jobs -x orden args Ejecuta la orden despus de que todas las especificaciones de trabajo que aparecen en ARGS se hayan substituido por el identificador del proceso lder de ese grupo de trabajo. kill [-seal] %n Enva una seal especfica al trabajo n (seal predeterminada 15) stop %n Detiene el trabajo n stty [-]tostop Permite/Evita que trabajos en segundo plano generen salida suspend Suspende la ejecucin del intrprete de rdenes actual 62

Tpico 103: Ordenes GNU & Unix wait Espera a que todos los trabajos en segundo plano se completen wait %n Espera a que el trabajo n en segundo plano se complete Ctrl-z Detiene el trabajo actual disown [opcin] [%n] Remueve el ltimo trabajo en segundo plano activo (+), o el trabajo %n. Opciones -a Remueve todos los trabajos en segundo plano -r Remueve solo los trabajos en ejecucin -h Remueve el trabajo activo (+) desde el intrprete slo cuando el intrprete es cerrado Formato de nombres de trabajo %%, %+ trabajo actual %n trabajo n %trabajo anterior %cadena trabajo cuyo nombre enpieza con cadena %?cadena trabajo cuyo nombre coincide en alguna parte o todo de cadena

63

Tpico 103: Ordenes GNU & Unix

1.103.6 Modificar la prioridad de ejecucin de procesos


Descripcin: Los candidatos deberan de ser capaces de gestionar la prioridad de ejecucin de procesos. Las tareas incluyen ejecutar un programa con alta o baja prioridad, determinar la prioridad de un proceso y cambiar la prioridad de procesos en ejecucin. Peso: 3 Archivos, trminos y utilidades clave: nice ps renice top Posibles valores para nice: 19 (baja) a 20 (alta) Los usuarios solo pueden cambiar a una menor prioridad que la actual del proceso Normalmente la prioridad cuando se inicia un programa es: 0 nice Inicia el trabajo con una prioridad pre-definida nice --8 prgm Inicia prgm con prioridad 8 nice -11 prgm Inicia prgm con prioridad 11 nice -n -12 prgm Inicia prgm con prioridad -12 renice Cambia la prioridad de un proceso en ejecucin renice -6 1247 Cambia la prioridad del proceso con PID 1247 a 6 renice snice Cambia la prioridad de mltiples procesos en ejecucin por categora. Sinopsis: snice [nueva_prioridad] [opciones] categora ej. snice +7 seti crack Baja la prioridad de seti y crack snice -17 root bash Da mayor prioridad al intrprete de rdenes del usuario root. 8 1247 Cambia la prioridad del proceso con PID 1247 a 8

64

Tpico 103: Ordenes GNU & Unix

1.103.7 Buscar en archivos de texto usando expresiones regulares


Descripcin: Los candidatos deberan ser capaces de manipular archivos y datos en texto usando expresiones regulares. Este objetivo incluye crear expresiones regulares simples que contengan varios elementos notationales. Tambin incluye utilizar herramientas de expresiones regulares para para realizar bsquedas a travs del sistema de archivos o del contenido de un archivo. Peso: 3 Archivos, trminos y utilidades clave: grep regexp sed grep Busca patrones en un texto. Sintxis: grep "expreg" archivo Vea tambin: grep -F, grep -E sed Edita un texto utilizando patrones. Los rangos son declarados como start, end sed '1,$s/^\#/##/' Sustituye desde la lnea 1 hasta el final ($) del documento sed -f sedscr archivo1 Use las rdenes sed del archivo sedsrc sed -e 'orden1' -e 'orden2' archivo1 Mltiples rdenes sed 's/patrn/remplazo/g' Sustitucin global (g) sed '/patrn/d' Elimina las lnea que coinciden, o tambin grep -v "patrn" sed 's/^\(.*\) \(.*\)/\1_\2/' Utilizando las variables(\1 \2) El ltimo ejemplo inserta el caracter '_' entre las primeras 2 palabras en todas las lneas. Expresiones Regulares (expreg) Smbolos: . * ^ $ \< \> \b \B [..] \ (..) {..} + ? |

65

Tpico 103: Ordenes GNU & Unix

1.103.8 Realizar operaciones bsicas de edicin de archivos con vi


Descripcin: Los candidatos deberan ser capaces de editar archivos de texto utilizando el editor vi. Este objetivo incluye navegacin en vi, modos bsicos de vi, insertar, editar, borrar, copiar y encontrar textos. Peso: 1 Archivos, trminos y utilidades clave: vi /, ? h,j,k,l G, H, L i, c, d, dd, p, o, a ZZ, :w!, :q!, :e! :! Accin Buscar Repetir bsqueda Ir en bsqueda Movimiento de cursor Tipear /<patrn> ?<patrn> / ? n N l h k j w,W b,B e 0 $ Ir a 0 $ H L :1 G 23G Edicin <esc> Comentarios Busca el <patrn> hacia adelante Busca el <patrn> hacia atrs adelante atrs Avanza a la siguiente ocurrencia encontrada Retroce a la anterior ocurrencia encontrada adelante atrs arriba abajo Adelante, una palabra Atrs, una palabra Al final de la palabra actual Al principio de la lnea Al final de la lnea Al principio de la lnea Al fina de la lnea Parte superior de la pantalla Parte inferior de la pantalla Primera lnea ltima lnea Salta la lnea 23 Modo Orden

66

Tpico 103: Ordenes GNU & Unix Accin Tipear i :sp Borrar & Porta papeles <Ctrl>w w x d dl dk d0 d$ c ch cj C dd 3dd yy nyy p,P Inicio de edicin (modo insercin) i, a, A o, O Comentarios Modo Insertar Divide la pantalla en 2 (ventanas) Cambia a otra ventana Borra el caracter sobre el cursor (Supr) Borra el caracter o lnea actual dependiendo de siguiente movimiento del cursor Borra el caracter a la derecha. Igual que x Borra la lnea actual & una lnea encima Borra desde el cursor hasta el comienzo de lnea. Borra desde el hasta el final de la lnea. Lo mismo que d pero empieza a insertar despus Borra 1 caracter atrs y cambia a modo insercin. Borra la lnea actual y cambia a modo insercin. Borra hasta el final de la lnea y cambia a modo insercin. Borra la lnea actual Borra 3 lneas (incluyendo la lnea actual) Copia la lnea actual al portapapeles Copia n lneas al portapapeles Pega desde el portapapeles antes (p) y despus (P) de la posicin actual del cursor Inserta texto antes, despues del cursor y al final de la lnea Abre una nueva lnea para insertar texto abajo, encima del Deshace la ltima accin en modo orden. Deshace la ltima accin en modo insercin. Guarda el archivo y sale del editor Guarda el archivo, Guarda el archivo(sobrescribe) Guarda el archivo como nombre (puede sobrescribir) Guarda el archivo como nombre (no sobrescribir) Muestra el archivo siguiente, anterior Muestra el nombre del archivo actual Abre un nuevo archivo si el actual ha sido guardado. Abre un nuevo archivo aun cuando el actual no haya sido guardado. Lee e inserta el contenido de archivo en la posicin actual del cursor Ejecuta en un shell la instruccin orden (orden) y vuelve a la edicin del documento.

Copiar al portapapeles y Pegar

Deshacer acciones u, <Ctrl>r <Alt>u Guardar/cambiar :wq :x ZZ archivo :w :w! :w! nombre :x nombre :n :f :e :N archivo

Abrir/Leer/Salir

:e! archivo :r archivo :! orden

67

Tpico 103: Ordenes GNU & Unix Accin Tipear :e! :q! :1,$s/patrn /remplazo/g :rango! orden_de_shell Comentarios Abre la ltima versin guardada de este archivo Salir sin guardar Igual que en sed Ejecuta el rango de texto a travz de la rden de shell (filtro) y remplaza el original con los resultados.

Sustituciones Ejecutando una orden

68

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS


Peso total para este tpico 1.104.1 1.104.2 1.104.3 1.104.4 1.104.5 1.104.6 1.104.7 1.104.8 24

Crear particiones y sistemas de archivos................................................3 Mantener la integridad de los sistemas de archivos...............................3 Controlar el montar y desmontar sistemas de archivos..........................3 Gestionar cuotas de disco.......................................................................3 Usar permisos para controlar el acceso a archivos.................................5 Gestionar propiedad de archivos.............................................................1 Crear y cambiar enlaces rgidos y simblicos.........................................1 Buscar archivos del sistema y colocar en su ubicacin correcta.............5

Resmen
I-nodos
A fixed number of inodes are created when a filesystem is created depending on the size of the hard disk. Directories are files (type 'd') containing filenames and their respective inodes. Storage element on disk are called clusters under MSDOS, and called blocks underLinux The normal size of blocks is1024 Bytes Other possible sizes are512, 1024 & 2048 Bytes Each Linux filesystem partition contains: 1 Boot block 1 SuperBlock inodes area Data area

Content of boot Block


Boot sector normally used to store a Boot Manager

Content of Super Block (partial)


Depending on filesystem, includes: Number of blocks in filesystem Size of Blocks Address of first free Data Block Address of first free iNode Various status flags tune2fs -l /dev/hda2 Full content of superblock of partition.

69

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

Content of Normal inodes


Type and access rights Number of hard links UID GID Filesize in bytes mtime (last content modified) ctime(last properties modified) atime(last time accessed) Address of Block 0 .... Address Address Address Address of of of of Block 9 single-indirection block double-indirection block triple-indirection block Block Block Block Block containing data listing up to 128 Data Blocks listing up to 128 Single-indirection Blocks listing up to 128 Double-indirection Blocks

Block 0 to 9: Single-indirection block: Double-indirection block: Triple-indirection block:

EXT2 Filesystem
The main difference between other filesystems and the EXT2 is the content of the inodes which are slightly different to accommodate future expansion and special features. Content of EXT2 inodes: permissions Nr. of Hard links size modification time(mtime) deletion time(dtime) flags(attributes) file ACL fragment fr. size frag. nr addr. 1. block data 3. block data 5. block data 7. block data 9. block data 11. block data simple indirect triple indirect reserved owner(UID) group(GID) properties change time(ctime) access time(atime) blockcount file version (NFS) dir ACL reserved 2. block data 4. block data 6. block data 8. block data 10. block data 12. block data double indirect reserved reserved

Some differences between EXT2 and normal filesystem


Deletion Time entry: Helpful for un-deleting files Field for 12 attributes(flags): A,a,c,d,i,S,s,u. 70

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Useful are: Append (+a) Allows only to append to it via redirection(>>) Immutable (+i) Not changeable, no new hardlinks, not deletable Safe-delete (+s) Fills file with '0s' before deleting it. chattr attribute filename Changes the file's attributes. Root only chattr +i file Turns attribute i ON chattr -i file Turns attribute i OFF lsattr filename Lists a file's attributes File Version Entry: Can be used by NFS server. File ACL and Dir ACL: (Access Control List) for better access control. Support for fragmented files 12 Direct Block Addresses instead of 10 (standard) The Superblock has multiple backups of itself at the start of some block groups. I found between 6 to 10 copies (backups) in 3 to 10 GB Partitions Ext2 superblock has extra entries: Valid-Flag Entry: if ON means the filesystem was not unmounted properly. e2fsck uses this flag to know if it should do a full check. e2fsck -f forces the full check. Max-Mounts before full check and mount-count Entries: Used by e2fsck. If mountcount=Max-Mounts before full check then e2fsck does a full check at boot time. Percent of full partition space reserved for root Entry: Normally 5%. tune2fs can manipulate these above superblock entries. Warning: Partition should NOT be mounted as ReadWrite if changing any of these entries.

Journaling Filesystems
EXT3: Reiserfs: Xfs: Is an EXT2 filesystem with a journal file and journalling functions. Stores a report of all transactions bigger than 1 block. Up to 10 times faster than EXT3 when reading. Ported from IRIX system. Meant for handling very large files. Max 9,000 Peta Bytes. (9 mega mega mega bytes!) 71

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.1 Create partitions and filesystems


Descripcin: Candidates should be able to configure disk partitions and then create filesystems on media such as hard disks. This objective includes using various mkfs commands to set up partitions to various filesystems, including ext2, ext3, reiserfs, vfat, and xfs. Peso: 3 Archivos, trminos y utilidades clave: fdisk mkfs

Notes
Max number of Primary partitions per hard disks: 4 Max number of extended partitions per hard disk: 1 Maximum number of logical partitions per hard disk: 11 Partitions names: hda----IDE-Ctrl1------hdb master slave hda1 (pri/ext) hda2 (pri/ext) hda3 (pri/ext) hda4 (pri/ext) hda5 (logical) hda6 (logical) .......... hda15 (logical) hdc----IDE Ctrl 2-----hdd master slave

Partitioning
fdisk -l Display all hard disks and partitions recognized in the system. fdisk /dev/hda Partition hard disk hda. fdisk commands:

72

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Command (m for help):m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Creating a new partition: n --> primary-->..... Changing its partition system id: t--->l(list)-->83(linux) or 82(swap) List partitions: p Shows the partition table When all finished:(warning: last change to verify and correct if needed ) w Writes the partition table on disk!!! Note: Linux does not need the activation of the bootable flag, but Windows does. So if Windows is installed and the flag is on for its partition, then leave it there.

Creating a filesystem.
mkfs -t filesystem [options] device [blocks] or mke2fs [options] device [blocks] (for ext2 filesystem) Possible commands and their synonyms: mke2fs mkfs.ext3 mkdosfs mkfs.xfs mkfs.bfs, filesystems: ext2,ext3,vfat,msdos,reiserfs,xfs,minix,bfs,xiafs Options: -b Block size. Valid values: 1024, 2048, 4096 = mkfs.ext2 = mkfs -t ext2 = mkfs.ext2 -j = mkfs -t ext3 = mkfs.msdos = mkfs.vfat = mkfs -t vfat = mkfs -t xfs mkfs.minix,, mkfs.xiafs

73

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS -c Before creating the filesystem, check the device for bad blocks -i n Specify the number(n) of bytes per inode. Min = Block size. This helps to calculate the number of inodes to create. Number of i-nodes is dependent on the size of partition. -N n Specify the absolute number(n) of i-nodes to create. device: /dev/xxxx blocks: Optional. Size in blocks of the filesystem to create. If not given the size is auto detected. mkreiserfs options device or mkfs -t reiserfs " " " or mkfs.reiserfs " " " For making a reiser filesystem. tune2fs -j device Converts an ext2 to ext3 filesystem. xxxx=hda1.... hdc4 etc.

" "

74

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.2 Maintain the integrity of filesystems


Descripcin: Candidates should be able to verify the integrity of filesystems, monitor free space and inodes, and repair simple filesystem problems. This objective includes the commands required to maintain a standard filesystem, as well as the extra data associated with a journaling filesystem. Peso: 3 Archivos, trminos y utilidades clave: du df fsck e2fsck mke2fs debugfs dumpe2fs tune2fs

Disk Usage
du du is recursive by default. du -sh /root Display amount of space used by /root directory du -h --max-depth=0 /home Amount of space used by /home (non recursive)

Disk Free
df List (in kilobytes) free & used space on mounted partitions df -h Same as above but in human readable format (K,M,G) df -i /dev/hda3 Show number of free inodes on hda3 Note: df -i doesn't show inode info for reiserfs or XFS, since they create inodes dynamically.

File system check


fsck Check file system Shortcut aliases for fsck: e2fsck = fsck.ext2 reiserfsck For EXT2 and EXT3 For Reiserfs

75

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS fsck.minix fsck.msdos fsck.vfat fsck.xfs For For For For minix Ms DOS FAT DOS VFAT XFS

Note: fsck should only be run on a non-mounted or read-only mounted filesystem. Syntax: fsck options filesystem options: (mostly for the ext2/ext3 filesystem) -A -f -p -n -y Checks all filesystems listed for check in /etc/fstab Force checking even if the Valid-Flag is not set(filesystem ok) Auto Repair without asking NO-Simulation. No writing of any changes on disk YES- Answer yes to any questions coming up. Dangerous!

File system debugging


debugfs Interactive command driven debugging program. Created to fully control and manipulate the ext2 filesystems. Default is in read-only mode. -w option overrides this. Command help shows all valid commands.

File system info dump


dumpe2fs Displays lots of information about the structure of the ext2 filesystem. Incl: Superblock content, free inodes categorized per block groups Location(offsets) of the superblock backups, etc. Can be useful to be saved in a file and used to recover a damaged system.

File system tweaking


tune2fs Allows manipulation of some of the parameters of the ext2 filesystem located in the superblock. Here are a few examples: tune2fs -l /dev/hda5 List the content of the superblock tune2fs -j /dev/hda3 Converts the ext2 filesystem to ext3 tune2fs -c 30 /dev/hda2 Change the max-mount-count to 30 tune2fs -C 0 /dev/hda9

76

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Reset the number of mounts counter to 0. Extra examples: dumpe2fs /dev/hda7 | grep '[mM]ount count' dumpe2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09 Mount count: 7 Maximum mount count: 20 tune2fs -C 9 /dev/hda6 tune2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09 Setting current mount count to 9

77

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.3 Control mounting and unmounting filesystems


Descripcin: Candidates should be able to configure the mounting of a filesystem. This objective includes the ability to manually mount and unmount filesystems, configure filesystem mounting on bootup, and configure user mountable removeable filesystems such as tape drives, floppies, and CDs. Peso: 3 Archivos, trminos y utilidades clave: /etc/fstab mount umount Syntax of mount command mount -t <fstype> Example: mount mount -a Try to mount all the devices listed in fstab as it happens at boot time. /etc/fstab file format Device order /dev/hda1 /dev/hdb1 /dev/hdb3 /dev/cdrom /dev/floppy /dev/hdc1 Default options rw,suid,dev,exec,auto,nouser,async,atime (async=buffered) List of all options auto exec sync atime dev suid user rw remount umask= Notes: noauto noexec async noatime nodev nosuid nouser ro Mounting at boot time ? Execute binaries found on device ? Buffered data when writing ? Update inode access time when accessed ? Accept special character and block devices ? Allow suid on mounted file system ? Allow user to mount device ? Read/Write(rw) or Read only(ro) ? Remount the already mounted device. Sets the umask for writing on the partition (good for vfat) Mount point /boot / swap /cdrom /floppy /windows Files system ext2 ext2 swap iso9660 auto vfat Options defaults defaults defaults ro,noauto,user noauto,user user,umask=000 Dump 1 0 0 0 0 0 fsck 1 2 1 0 0 0 /dev/hdc /cdrom <SourceDevice> <MountPoint>

78

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS The option user implies: noexec,nosuid and nodev unless overridden by subsequent contradictory options. Normal options for vfat Partition: user,umask=000 The option mount -w ... is the same as mount -o rw Almost all options can also be entered using mount -o. Example: mount -o ro,umask=000 -t vfat /dev/hdd /windows Display already mounted devices mount Most complete info cat /etc/mtab Not always refreshed immediately cat /proc/mounts Always current df -h Mounted devices and space used/free

79

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.4 Managing disk quota


Descripcin: Candidates should be able to manage disk quotas for users. This objective includes setting up a disk quota for a filesystem, editing, checking, and generating user quota reports. Peso: 3 Archivos, trminos y utilidades clave: quota edquota repquota quotaon

Resmen
The user is allowed to cross the soft limit for the length of time limited by the grace period, after which he's not allowed to write anything on the partition. The hard limit may never be exceeded by the user. The quota limits may be expressed in number of 1k blocks or in number of inodes (total number of files and directories) or both.

Procedure for installing quotas


Edit /etc/fstab and enter usrquota,grpquota in options field for filesystem /dev/hda3 /home Remount the filesystem mount -o remount /dev/hda3 Initialize the quota databases files(aquota.user,aquota.group) quotacheck -avugm Set quota for each user: edquota -u paul or edquota paul Edit grace period for all the users: edquota -tu Turn quotas ON: quotaon -u /dev/hda3 Check quota for user: quota paul Create a quota report for all users: repquota -u /dev/hda3 Create a quota report for all groups: ext2 defaults,usrquota,grpquota 1 1

80

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS repquota -g /dev/hda3 Turn quotas OFF(when needed) quotaoff -u /dev/hda3

Detailed preparation of quotas


Enter the following options in /etc/fstab for the partitions that must use quotas. /dev/hda2 /srv/www ext2 defaults,usrquota,grpquota /dev/hda3 /home Remount the filesystems: mount -o remount /srv/www mount -o remount /home Enter the following command to verify existing used space by each user and group: quotacheck -avugm This command will also update two files in the /home directory: quota.group, and quota.user if version 2 of quotas is used then the two files will be: aquota.group, and aquota.user Start editing the quota for each user: edquota -u john or edquota john Edits the filesystem quota for the user john. The quota editor(vi) will appear and will allow changes to the soft and hard quota for user john. Note: The value 0 for soft or hard quota means N O L I M I T. +----------------------------------------------------------------------+ | Filesystem blocks soft hard inodes soft hard | | /dev/hda7 3288 4000 6000 649 2000 3000 | +----------------------------------------------------------------------+ This above example means that john: Already uses 3288 blocks(kb) of data on /dev/hda7 in 649 inodes (files) The soft quota is set to 4000 kB and hard to 6000 kB The soft limit is set to 2000 inodes and hard limit to 3000 inodes edquota -tu Edits grace period for all users. It is not possible to set grace period for individual users (month(s),day(s),hour(s),min(utes),sec(onds)) ext2 defaults,usrquota,grpquota 1 1 1 1

81

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS +----------------------------------------------------------------------+ | Filesystem Block grace period Inode grace period | | /dev/hda7 7days 5days | +----------------------------------------------------------------------+ To copy the quota for other users with the same limit values, easiest way is: edquota -p john patrick This command will give patrick the same quota limits as john. To verify the status of the quota for the user john use the commands: su quota john The result: +------------------------------------------------------------------+ | Disk quotas for user john (uid 5001): | | Filesytem blocks quota limit grace files quota limit grace | | /dev/hda7 3288 4000 6000 649 2000 3000 | +------------------------------------------------------------------+ This means that the user john has 649 files using 3288 Kb of hard disk space. His soft limit is 4000 Kb or 2000 inodes and hard limit is 6000 kb or 3000 inodes

Repquota
Repquota produces summarized quota information for a file system. Here is a sample of the output that repquota gives: # repquota -a *** Report for user quotas on device /dev/hda7 Block grace time: 7days; Inode grace time: 5days Block limits File limits User used soft hard grace used soft hard root -- 175419 0 0 14679 0 0 john +6000 4000 6000 650 2000 3000 uucp -729 0 0 23 0 0 user1 -- 13046 15360 19200 806 1500 2250 repquota -g /home Report of groups quota repquota -u /home (same as repquota /home) Report of users quota

grace

Quotaon and Quotaoff


quotaon -u /dev/hda2 turns ON quota accounting in kernel for users(-u)

82

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS quotaoff -u /dev/hda2 turns it OFF. Actually both files are similar. They are executed at system startup and shutdown.

Files involved with disk quotas


quota (1) Display disk usage and limits. quota reports the quotas of all filesystems listed in /etc/mtab. For mounted NFS filesystems , a call to rpc.rquotad on the server machine is performed to get the information. Set disk quotas with one command without editing like edquota Edit user quotas Turn filesystem quotas on and off Scan a file system for disk usage, create and check the files aquota.user and aquota.group Summarize quotas for a filesystem

setquota (8) edquota (8) quotaoff (8)/ [quotaon] quotacheck (8) repquota (8)

83

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.5 Use file permissions to control access to files


Descripcin: Candidates should be able to control file access through permissions. This objective includes access permissions on regular and special files as well as directories. Also included are access modes such as suid, sgid, and the sticky bit, the use of the group field to grant file access to workgroups, the immutable flag, and the default file creation mode. Peso: 5 Archivos, trminos y utilidades clave: chmod umask chattr

File type
These are displayed against the left margin in ls -l listings l d b c p s Regular files Symbolic Links (eg. /sbin/init.d/rc2.d......all files) Directories and sub-directories Block Device Files (eg. /dev/hda1...) Character Device Files (eg. /dev/tty1....) FIFO Named pipes (eg. /dev/log, /dev/xconsole) ???? (eg. /var/spool/postfix/private/bounce...)

File and directory names that start with a Dot (.) are hidden from display by certain programs like ls etc.

Files and directory access rights


Access rights are restrictions applied to the content of a file or directory. They dont restrict the deletion of a file or directory. Only the parent directory's access rights controls that.

Changing a file's access rights


Syntax: chmod [-R] [ugoa][+=-][rwx stXugo] or [0000 to 7777] file Examples: chmod u+w,g-x,o=wx file1 chmod 750 file2 chmod 4755 program1 SUID=ON chmod u+s,g+s,o+t program2 SUID=ON, SGID=ON, StickyBit=ON 84

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS chmod -R u=rwX,g=rX,o=rX dir1 Recursively set 755 for directories and 644 for files.

Directory access rights


The read (r) without the search (x) access rights for directories makes no sense and the read is ignored. Any file in a directory set to write access for everybody can be erased by anybody, regardless of who the current user is. Extra access rights SUID (s) 4 SGID Sticky (s) Bit (t) 2 1 r 4 user w 2 x 1 r 4 group w 2 x 1 r 4 others w 2 x 1

SUID and SGID for programs (-rwsrwsrwx) (-rwSrwSrwx) SUID=ON: Effective user is the owner of the program SGID=ON: Effective group is the group owner of the program SGID for Directories Forces subdirectories and files created in it to have the same group as the directory's group independent of the creating user's group. Subdirectories created within this directory will inherit the same SGID. Sticky Bit for Directories Files in the directory can only be deleted by their owner even if the directory is set to write access for all. Sticky bit is normally set on /tmp to prevent another user's processes from deleting your files. Note 1: Normally any file (belonging to the user or not) under a directory set to write access for group or others can be erased by any user. Note2: The owner of the directory can erase any file in it even if the sticky bit is set. Sticky Bit for programs: Allows a running program to be stored in ram (buffers) until the system goes down. Advantage: Disadvantage: Programs load faster.. Uses lots of RAM

Note: Sticky bit for programs is obsolete. Linux has never used it and no modern Unix has used it for years swap memory does the same thing more effectively chmod o+t Sets the sticky bit result = (-rwxrwxrwt) or (-rwxrwxrwT) chmod u+t Sets the SUID result = (-rwsrwxrwt) or (-rwSrwxrwT) chmod u+t 85

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Sets the SGID result = (-rwxrwsrwt) or (-rwxrwSrwT) Note: When adding a sticky-bit to a file/dir with an x for Others, the sticky-bit is displayed as t otherwise as T if the x was not present. The same applies to SUID and SGID (-rwSrwSrwT)

Attributes (chattr & lsattr)


Setting the 'append only' attribute on a directory or file. chattr +a filename or directoryname User must necessarily not be root A file with this attribute may be appended to, but may not be deleted, and the existing contents of the file may not be overwritten. If a directory has this attribute, any files or directories within it may be modified as normal, but no files may be deleted. Setting the 'immutable' attribute on a directory or file. chattr +i filename or directoryname User must be root A file or directory with this attribute may not be modified, deleted, renamed, or (hard) linked Display Attributes of files and directories lsattr List the special attributes of files and directories Attributes list A a c Atime record is not modified. Prevents too much disk access for laptops. Still in testing mode Sets it to append mode only (can not erase it) Only root can set this attribute The kernel compresses this file before writing to disk, and decompresses it when reading it from disk. NOT Implemented yet by kernel Will not be backed up by the program "dump" Cannot be modified, erased, renamed or hard linked. Only root can change this attribute When this file is erased, the blocks it used are over-written with '0' to prevent recovery at a later date. Any change to this file will be immediately written to the disk instead of in the file system buffer. (equivalent to 'sync' mount option) When this file is deleted, its content are saved. It can therefore be undeleted later. NOT implemented yet by kernel.

d i s S u

umask for new files and directories Sets default access rights for newly created files and directories: 86

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS New file access rights New directory access rights Examples: umask 22 135 216 New files (access rights 666) -rw-r--r--rw-r---w-r--rw---New Directories (access rights 777) -rwxr-xr-x -rw-r---w-r-xrw---x = 666 !| umask (!|=Logical NOR) = 777 !| umask

Note: umask specifies which attributes will NOT be applied

87

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.6 Manage file ownership


Descripcin: Candidates should be able to control user and group ownership of files. This objective includes the ability to change the user and group owner of a file as well as the default group owner for new files. Peso: 1 Archivos, trminos y utilidades clave: chown chgrp chmod

chown
Changes user and group ownership of a file or directory Syntax chown [options] [user][:group] filename chown [options] [user][:group] dirname Examples: chown user:group filename Change user and group ownership of file chown user filename Change user ownership of file chown user. filename Change user and his group ownership of file chown user: filename Change user and his group ownership of file chown .group filename Change group ownership of file Important Options:(from man page) -R recursive Recursively affects all files and directories inside directory trees --dereference Affect the referent of each symbolic link, rather than the symbolic link itself. -h, --no-dereference Affect symbolic links instead of any referenced file. (available only on systems that can change the ownership of a symlink) --from=CURRENT_OWNER:CURRENT_GROUP Change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute. -f, --silent, --quiet 88

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Suppress most error messages -c, --changes Like verbose but report only when a change is made --reference=RFILE Use RFILE's owner and group rather than the specified OWNER:GROUP values. -v, --verbose Output a diagnostic for every file processed IMPORTANT: root is the only user allowed to change ownership(chown) of files or directories.

chgrp
Change group ownership of a file or directory Syntax: chgrp [options] newgroup filename Examples: chgrp -R ftp /srv/www Changes recursively all the files and directories inside the dir. /srv/www to be owned by group ftp chgrp -R --reference=/home/hans /srv/ftp Changes recursively the group ownership of all the files and directories contained in /srv/ftp to the group owning the directory /home/hans Options: -R, --recursive Operate on files and directories recursively --dereference Affect the referent of each symbolic link, rather than the symbolic link itself -h, --no-dereference Affect symbolic links instead of any referenced file (available only on systems that can change the ownership of a symlink) -f, --silent, --quiet Suppress most error messages --reference=RFILE Use RFILE's group rather than the specified GROUP value -v, --verbose Output a diagnostic for every file processed -c, --changes Like verbose but report only when a change is made

89

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

chmod
Change the access rights of a files or directories TODO

90

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.7 Create and change hard and symbolic links


Descripcin: Candidates should be able to create and manage hard and symbolic links to a file. This objective includes the ability to create and identify links, copy files through links, and use linked files to support system administration tasks. Peso: 1 Archivos, trminos y utilidades clave: ln Creating a Symbolic link: ln [options] -s source destination or cp -s source destination Examples: ln -s /bin/cat /home/hans/bin/cat Creates a new symbolic link called /home/hans/bin/cat pointing to /bin/cat Creating a Hard Link: Hard links are new files which have the same inode ln source destination or cp -l source destination Examples: ln /bin/ping /home/hans/bin/ping Creates a new hard link called /home/hans/bin/ping pointing to /bin/ping Options: -f, --force Remove existing destination files -i, --interactive Prompt whether to remove destinations -s, --symbolic Make symbolic links instead of hard links --target-directory=DIRECTORY Specify the DIRECTORY in which to create the links -v, --verbose Print name of each file before linking Important Notes: Although the man page says that it is possible to make a hard link to a directory, in reality it is not possible ... yet. Better to use the bind option when mounting: mount /SourceDir /MountPoint -o bind 91

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Hard links are limited to the same partition as the original file Symbolic links are NOT limited to the same partition as the original file cp source destination Copies the referenced file (the file that the sym link points to) when the source is a symbolic link. Example: cp linktest3 linktest5 (linktest3 is a symbolic link to linktest) Copies the content of linktest to linktest5 as a normal file. The second field of the command ls -l filename shows how many files are hard linked to that inode. ls -l linktest* -rw-r--r-- 3 michel -rw-r--r-- 3 michel -rw-r--r-- 3 michel video video video 0 2003-11-20 08:45 linktest 0 2003-11-20 08:45 linktest2 0 2003-11-20 08:45 linktest3

The command stat filename also shows how many files are hard linked to that inode. stat linktest File: `linktest' Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 305h/773d Inode: 876319 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 500/ michel) Gid:( 33/ video) Access: 2003-11-20 08:45:10.000000000 +0100 Modify: 2003-11-20 08:45:10.000000000 +0100 Change: 2003-11-20 08:45:22.000000000 +0100

92

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS

1.104.8 Find system files and place files in the correct location
Descripcin: Candidates should be thoroughly familiar with the Filesystem Hierarchy Standard, including typical file locations and directory classifications. This objective includes the ability to find files and commands on a Linux system. Peso: 5 Archivos, trminos y utilidades clave: find locate slocate updatedb whereis which /etc/updatedb.conf

find
Recursively searches the filesystem to find files Syntax: find startdirectory [search_criteria_options] [-exec command \;] Examples: find . type d -maxdepth 1 Finds all directories located in the current directory cd /etc/ ; find . -name "*XF*" Recursively finds all files in directory /etc whose names include the pattern 'XF' find /opt/kde -maxdepth 2 -type f -name "*edit" Searches /opt/kde and subdirectories up to 2 levels deep for files whose names end with the word 'edit' find . -follow -cmin -5 Search the current directory for files whose properties were changed less than 5 minutes ago Timestamp syntax: -cmin +5 -amin -6 -mmin +8 -ctime +5 -atime -7 -mtime -3 Properties of file changed more than 5 minutes ago Content of file accessed less than 6 minutes ago Content of file modified more than 8 minutes ago Properties of file changed more than 5 days ago Content of file accessed less than 7 days ago Content of file modified less than 3 days ago

find /etc -type f -name '*.conf' -exec grep -H "hosts" {} \; Searches the /etc directory for files with the extension .conf. Executes grep on those files looking for the string hosts. When found, also displays the filename it was found in.

93

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS find /etc -type f -name '*.conf' -ok grep -H "hosts" {} \; Same actions as above except that -ok option asks find to prompt for confirmation (with y) of the command before executing it.

locate
Locate files in the whole system using a database of filenames. Syntax: locate filename Searches the locate database for the filename This database is in /var/lib/locatedb It is updated via the command: updatedb [options] The configuration file for updatedb is /etc/updatedb.conf Options: -d path, --database=path Instead of searching the default file name database, search the file name databases in path, which is a colon-separated list of database file names. You can also use the environment variable LOCATE_PATH to set the list of database files to search. The option overrides the environment variable if both are used. -e, --existing Only print out such names that currently exist (instead of such names that existed when the database was created). Note that this may slow down the program a lot, if there are many matches in the database. -i, --ignore-case Ignore case distinctions in both the pattern and the file names.

slocate
Secure version of locate Secure Locate provides the same features as locate but it will also store file permissions and ownership so that users will not see files they do not have access to. Syntax: slocate [options] filename The slocate database is not the same as the locate database. It needs to be built by issuing the slocate command with proper options: Database Build Options: -u Create slocate database starting at path / -U <dir> Create slocate database starting at path <dir> -e <dir1,dir2,...> 94

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Exclude directories from slocate database -f <fstype1,...> Exclude files on specific file systems from the slocate database. -c Parse /etc/updatedb.conf when updating the slocate database. -l <level> Security level: 0 Turns security checks off. This will make searches faster. 1 Turns security checks on. This is the default. -o <file>, --output=<file> Specifies the database to create. -v, --verbose Verbose mode. Display files when creating database. Slocate Search Options: -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. -d <path>, --database=<path> Specifies the path of databases to search.

whereis
Search for a program and possibly its man pages from a predefined path. Syntax: whereis filename Searches a predefined (hard coded) list of directories for the filename and man pages. They must be in the path predefined during compilation of whereis program.

which
Search for the first occurrence of a program in the PATH. Syntax: which filename

95

Tpico 104: Dispositivos, Sistemas de archivos Linux, FHS Searches the PATH for the first occurance of the filename. The filename can be a list of files. type -p filename Same as above which filename

96

Tpico 110: El sistema X Window

Tpico 110: El sistema X Window


Peso total para este tpico 1.110.1 1.110.2 1.110.4 13

Instalar & Configurar XFree86...............................................................5 Configurar un gestor de visualizacin.....................................................3 Install & Customize a Window Manager Environment............................5

Resmen
TODO

97

Tpico 110: El sistema X Window

1.110.1 Instalar & Configurar XFree86


Descripcin: Los candidatos deberan ser capaces de instalar y configurar X y un servidor de Fuentes X. Este objetivo incluye verificar que la tarjeta de video y el monitor son soportados por el servidor X as como personalizar y poner a punto X para la tarjeta de video y el monitor. Tambin incluye la instalacin de un servidor de Fuentes X, instalacin de fuentes, y la configuracin de X para usar el servidor de fuentes (puede requerir la edicin manual de /etc/X11/XF86Config en la seccin Files). Peso: 5 Archivos, trminos y utilidades clave: XF86Setup xf86config xvidtune /etc/X11/XF86Config /etc/.Xresources ~/.Xresources

El Servidor X
El servidor-X brinda una pantalla vaca donde se mostraran los programas que soportan el protocolo-X y se controlaran mediante el ratn y el teclado. El servidor-X toma control de la tarjeta grafica, monitor, ratn y teclado locales; y posiblemente otros dispositivos como joystick, tablero grfico, etc. El servidor-X es un servicio de red para clientes locales o remotos (progamas-X). El servidor-X ha sido desarrollado para varias plataformas de hardware. La mayora de las aplicaciones del servidor-X son propietarias. El XFree86 es software libre, y es el que se explica a continuacin: La versin 3 de XFree86 contiene varios servidores X ejecutables para las diferentes resoluciones y profundidades de color. La versin 4 de XFree86 selecciona la resolucin correcta y la profundidad de color, as hay un solo ejecutable durante la ejecucin.

El archivo XF86Config
/etc/X11/XF86Config es el archivo principal de configuracin de XFree86. Ruta de bsqueda de XF86Config: Cuando se inicia X como un usuario normal: /etc/X11/$XF86CONFIG /usr/X11R6/etc/X11/$XF86CONFIG Entonces la ruta comn de bsqueda Cuando se inicia X como un usuario privilegiado (root). $XF86CONFIG /etc/X11/$XF86CONFIG /usr/X11R6/etc/X11/$XF86CONFIG $HOME/XF86Config Entonces la ruta comn de bsqueda Ruta comn de bsqueda:

98

Tpico 110: El sistema X Window /etc/X11/XF86Config-4 /etc/X11/XF86Config /etc/XF86Config /usr/X11R6/etc/X11/XF86Config.<hostname> /usr/X11R6/etc/X11/XF86Config-4 /usr/X11R6/etc/X11/XF86Config /usr/X11R6/lib/X11/XF86Config.<hostname> /usr/X11R6/lib/X11/XF86Config-4 /usr/X11R6/lib/X11/XF86Config Nota: En las 2 rutas anteriores /X-Rootdir normalmente es /usr/X11R6/ Dependiendo de la versin 3 y versin 4 la distribucin de los archivos de configuracin del Servidor-X se realiza en diferentes lugares. Las direcciones y nombres usualmente usados son: Version 3 Version 4 /etc/XF86Config /etc/X11/XF86Config /etc/X11/XF86Config /etc/X11/XF86Config-4

Los programas de configuracin de XFree86


Estos son algunos programas de ayuda que escriben un archivo XF86Config xf86config Primer programa de configuracin en modo texto. Proporcionado y mantenido por el equipo de desarrollo de XFree86. Pertenece a los paquetes estndar del Servidor-X. Programa de configuracin en modo grafico (640x480 - VGA a 16 colores). Tambin proporcionado y mantenido por el equipo de desarrollo de XFree86. Programa de configuracin en modo grfico. Ms complejo y orientado a administradores avanzados. Proporciona la posibilidad de probar dinmicamente algunas de las configuraciones presionando el botn Aplicar. Proporciona auto deteccin de tarjetas grficas. Tambin proporcionado y mantenido por el equipo de desarrollo de XFree86. Pogramas de configuracin en modo grfico de SuSE para XFree86 versin 3. Proporciona deteccin automtica de tarjetas grficas. Pogramas de configuracin en modo grfico de SuSE para XFree86 versin 4. Proporciona deteccin automtica de tarjetas grficas. Programa de configuracin en modo texto de Red Hat . Una versin mejorada de xf86config. Hace auto deteccin de tarjetas grficas. Trabaja en modo interactivo o en modo de instalacin automtica. Programa de instalacion en segundo plano del sistema de Debian. No es un programa iniciable por el usuario. Para reconfigurar el servidor-X ejecute: dpkg-reconfigure xserver-xfree86

XF86Setup

xf86cfg

SAX

SAX2

Xconfigurator

dexconf

99

Tpico 110: El sistema X Window Todos los programas de configuracin anteriores hacen 2 cosas. Configuracin del archivo XF86Config. Crear un enlace simblico al Servidor-X configurado (Solamente Versin 3)

Organizacin del archivo XF86Config


Secciones: Files ServerFlags Module InputDevice Device VideoAdaptor Monitor Modes Screen ServerLayout DRI Vendor Keyboard Pointer Ubicacin de las fuentes Banderas del servidor Carga dinmica de modulo Descripcin del dispositivo de entrada (Versin 4) Descripcin de dispositivos grficos Descripcin del adaptador de video Xv Descripcin del monitor Descripciones de los modos de video Configuracin de la pantalla Organizacin general del servidor Configuracin especfica de DRI Configuracin especfica del vendedor Configuracin del teclado (Versin 3) Configuracin del ratn (Versin 3)

Ejecutando el Servidor-X
Cree un enlace simblico al Servidor-X configurado Versin 3 /usr/X11R6/bin/X ==> /var/X11R6/bin/X ==> /usr/X11R6/bin/XF86_Servertype Versin 4 /usr/X11R6/bin/X ==> /var/X11R6/bin/XFree86 Inicie el servidor X y el gestor de ventanas: startx (script) Afinar bien la configuracin del monitor: Manualmente con los botones del monitor Va el programa xvidtune

Controlando la configuracin del Servidor-X


Configuraciones dinmicas: El Servidor-X puede ser controlado dinmicamente (no permanentemente) con la orden xset

100

Tpico 110: El sistema X Window xset r rate 250 30 Cambia inmediatamente el retardo del teclado (250 ms) y la tasa de repeticin (30/s) Configuraciones controladas por el usuario: El Servidor-X puede tambin ser controlado para proporcionar ciertas configuraciones cuando se inician los programas del cliente-X usando el archivo ~/.Xresources. Nota: En SuSE ~/.Xresources es un enlace simblico a ~/.Xdefaults Secuencia para leer los archivos de recurso: Los archivos de configuracin global para cada programa-X separado, son los primeros en leerse del directorio /usr/lib/X11/app-defaults/* y entonces el archivo ~/.Xresources es leido. Los recursos de cualquier usuario y maquina especifica pueden ser especificados configurando la variable de entorno XENVIRONMENT con el nombre del archivo de recursos a ser cargado por todas las aplicaciones. Si esta variable no esta definida, el archivo llamado ~/.Xdefaultshostname es buscado en su lugar, donde hostname es el nombre del la maquina anfitriona donde se ejecuta la aplicacin.

Formato para los archivos de recursos


~/.Xresources X-ProgramName*attribute: value Exjemplo: (las lneas comentadas empiezan con el caracter '!') xterm*background: LightYellow2 xterm.eightBitInput: true ! xterm*font: -adobe-courier-bold-r-normal--14-140-75-75-m-90iso8859-1 Estos parmetros pueden ser sobre escritos iniciando el programa-X con argumentos. xterm -fn 9x15bold -geometry 100x40+30+40 -bg LightYellow2 \ -T "Test_Xterm" -sb -rightbar

Las fuentes de X11 y el servidor de fuentes


Las fuentes son listadas en el archivo XF86Config por la palabra clave FontPath en la seccin Files FontPath "/usr/X11R6/lib/X11/fonts/TrueType" FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled" El servidor de fuentes tambin puede ser listado pero DEBE ser el primero en la lista: FontPath "unix/:7100" Servidor de fuentes en la conexin Unix local corre en el puerto 7100

xset
Cambia temporalmente la configuracin de la opcin FontPath del Servidor-X mientras se ejecuta: 101

Tpico 110: El sistema X Window xset +fp /usr/X11R6/lib/X11/fonts/TrueType xset fp+/usr/X11R6/lib/X11/fonts/TrueType Aade un FontPath xset -fp /usr/X11R6/lib/X11/fonts/TrueType xset fp-/usr/X11R6/lib/X11/fonts/TrueType Borra un FontPath

Configurando un servidor de fuentes (xfs)


xfs es el Servidor de Fuentes estandard el cual escucha por pedidos en el puerto 7100. (no confudir el nombre del servidor de fuentes (xfs) con el del sistema de archivos de SGI (XFS)) note la letra mayscula. Configuraciones del cliente en el archivo de configuracin XF86Config: FontPath "unix/:7100" Servidor de fuentes local en una conexin Unix FontPath "tcp/algun.servidor.com:7100" Servidor de fuentes remoto Archivo de configuracin de xfs: /etc/X11/fs/config /etc/X11/xfs.conf Iniciando el Servidor de Fuentes como demonio: xfs -config /etc/X11/fs/config -daemon Ejemplo del archivo de configuracin xfs:

102

Tpico 110: El sistema X Window no-listen = tcp port = 7100 client-limit = 10 clone-self = on use-syslog = on deferglyphs = 16 catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled, /usr/X11R6/lib/X11/fonts/75dpi:unscaled, /usr/X11R6/lib/X11/fonts/100dpi:unscaled, /usr/X11R6/lib/X11/fonts/japanese:unscaled, /usr/X11R6/lib/X11/fonts/baekmuk:unscaled, /usr/X11R6/lib/X11/fonts/Type1, /usr/X11R6/lib/X11/fonts/URW, /usr/X11R6/lib/X11/fonts/Speedo, /usr/X11R6/lib/X11/fonts/CID, /usr/X11R6/lib/X11/fonts/PEX, /usr/X11R6/lib/X11/fonts/cyrillic, /usr/X11R6/lib/X11/fonts/latin2/misc, /usr/X11R6/lib/X11/fonts/latin2/75dpi, /usr/X11R6/lib/X11/fonts/latin2/100dpi, /usr/X11R6/lib/X11/fonts/latin2/Type1, /usr/X11R6/lib/X11/fonts/latin7/75dpi, /usr/X11R6/lib/X11/fonts/kwintv, /usr/X11R6/lib/X11/fonts/truetype, /usr/X11R6/lib/X11/fonts/uni, /usr/X11R6/lib/X11/fonts/ucs/misc, /usr/X11R6/lib/X11/fonts/ucs/75dpi, /usr/X11R6/lib/X11/fonts/ucs/100dpi, /usr/X11R6/lib/X11/fonts/hellas/misc, /usr/X11R6/lib/X11/fonts/hellas/75dpi, /usr/X11R6/lib/X11/fonts/hellas/100dpi, /usr/X11R6/lib/X11/fonts/hellas/Type1 # in decipoints default-point-size = 120 default-resolutions = 75,75,100,100 # font cache control, specified in KB cache-hi-mark = 2048 cache-low-mark = 1433 cache-balance = 70

Formato de los nombres de fuente


Autor Peso Ancho Pixels Res-X Espaciado Estndar-ISO | | | | | | | -b&h-lucida-medium-r-normal-sans-18-180-75-75-p-106-iso8859-1 | | | | | | | Fuente Atributo Estilo Puntos Res-Y Ancho Opciones (i * =Italica) (1/72 in) Promedio (r =roman)

Instalando nueves fuentes


Las nuevas fuentes necesitan algo de preparacin antes de que puedan ser utilizadas. 103

Tpico 110: El sistema X Window Adems de los archivos de fuente (con extensiones .bdf, .snf y .pcf) ubicados en el directorio de fuentes, algunos archivos extra necesitan atencin: fonts.dir Contiene el nmero de fuentes disponible en este directorio (en la primera lnea) y una lnea por cada fuente con su descripcin. El formato es: Primera lnea: Nmero de fuentes listadas en el archivo (ej. 439) Resto del archivo: Archivo-de-fuente Descripcin-de-fuente Ejemplo: 439 putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-adobe-standard putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-iso10646-1 putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-iso8859-1 ... Para crear este archivo se debe correr el programa mkfontdir Sintaxis: mkfontdir /ruta/al/directo/fuente Tipos de fuente vlidos: PCF (.pcf), SNF (.snf) y BDF (.bdf) fonts.alias Lista con entradas creadas manualmente asignando un nombre no existente de fuente a otra existente. Formato: alias nombre-fuente-existente Ejemplo: fixed iso8859-1 variable 5x7 5x8 x9 6x10 6x12 iso8859-1 6x13 iso8859-1 6x13bold iso8859-1 ... fonts.scale Lista de fuentes que son escalables. El formato es: Primera lnea: Nmero de fuentes listadas en el archivo (ej. 439) Resto del archivo: Archivo-de-fuente Descripcin-de-fuente Ejemplo -misc-fixed-medium-r-semicondensed13-120-75-75-c-60-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1 -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1 -misc-fixed-medium-r-normal8-80-75-75-c-50-iso8859-1 -misc-fixed-medium-r-normal9-90-75-75-c-60-iso8859-1 -misc-fixed-medium-r-normal10-100-75-75-c-60-iso8859-1 -misc-fixed-medium-r-semicondensed12-110-75-75-c-60-misc-fixed-medium-r-semicondensed13-120-75-75-c-60-misc-fixed-bold-r-semicondensed13-120-75-75-c-60-

104

Tpico 110: El sistema X Window 439 putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-adobe-standard putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-iso10646-1 putbi.pfa -adobe-Utopia-bold-i-normal0-0-0-0-p-0-iso8859-1 ...

105

Tpico 110: El sistema X Window

1.110.2 Configurar un gestor de visualizacin


Descripcin: Los candidatos deben ser capaces de configurar y personalizar un gestor de visualizacin (display manager). Este objetivo incluye activar/desactivar el gestor de visualizacin y cambiar el mensaje de saludo. Este objetivo incluye cambiar cambiar los bitplanes determinados. Tambin incluye configurar el gestor para ser usado por las estaciones X. Este objetivo cubre los gestores de visualizacin XDM (X Display Manager), GDM (Gnome Display Manager) y KDM (KDE Display Manager). Peso: 3 Archivos, trminos y utilidades clave: /etc/inittab /etc/X11/xdm/* /etc/X11/kdm/* /etc/X11/gdm/*

Iniciando una sesin X


Una sesin X puede ser iniciada de 2 maneras: 1. Ingresar desde una terminal (basada en texto) y entonces ejecutar el script startx. startx in turns starts xinit. Archivo de configuracin de xinit: $HOME/.xinitrc si se encuentra, en otro caso: /var/X11R6/lib/xinit/xinitrc 2. Via un gestor de visualizacin X (XDM): El ingreso del usuario se hace en modo grfico. El gestor de visualizacin es iniciado durante el arranque (nivel de ejecucin 5) en segundo plano como demonio y proporciona ingreso grfico a los usuarios. Nota: Para esto necesitamos asegurarnos que el nivel de ejecucin predeterminado est puesto a 5 en el archivo /etc/inittab.

Gestores de visualizacin
Los gestores de visualizacin populares son: Nombre Directorio del archivo de config. xdm kdm gdm /etc/X11/xdm/ kde_rootdir/share/config/kdm/ gnome_rootdir/gdm/ kde_rootdir Directorio raz principal para el entorno de escritorio KDE. Para KDE3 es: /etc/opt/kde3 gnome_rootdir Descripcin Proporcionado por XFree86 Proporcionado por KDE Proporcionado por Gnome

106

Tpico 110: El sistema X Window Directorio raz principal para el entorno de escritorio Gnome. For Gnome 2 es: /etc/opt/gnome Propiedades de los gestores de visualizacin kdm est basado en xdm y usa muchos de sus archivos de configuracin. gdm es un nuevo desarrollo y de esta manera es independiente de xdm.

Configuracin xdm
xdm es un programa tradicional de X11 y ofrece slo un logo, fondo de pantalla y campos de ingreso (para cuenta de usuario y contrasea). Los parmetros para cambiar este comportamiento estn en: /etc/X11/xdm/Xresources Ejemplo: xlogin*greeting: xlogin*namePrompt: xlogin*fail: xlogin*login.greetFont: iso8859-1 xlogin*login.promptFont: iso8859-1 xlogin*login.Font: iso8859-1 xlogin*logoFilename xlogin*borderWidth xlogin*useShape: xlogin*greetColor: xlogin*failColor: xlogin*borderWidth: xlogin*frameWidth: xlogin*innerFramesWidth: xlogin*Foreground: xlogin*Background: xlogin*shdColor: xlogin*hiColor: Welcome at CLIENTHOST \040\040\040\040\040\040\040Login: Login incorrect *-FAMILY-bold-SLANT-normal--*-140-*-*-*-**-FAMILY-bold-r-normal--*-120-*-*-*-**-FAMILY-medium-r-normal--*-120-*-*-*-*/xxxxx.xpm true CadetBlue red 0 5 2 black #c0c0c0 #828282 #e0e0e0

xdm ejecuta cada vez un script llamado /etc/X11/xdm/Xsetup que presenta una ventana de ingreso. Ah podemos correr programas que cambian el fondo de pantalla, etc. Algunos ejemplos de tales programas son: xpmroot , xsetbg, etc /usr/sbin/xpmroot /etc/X11/xdm/background.xpm

Configuracin kdm
kdm trabaja de manera muy similar a xdm y usa muchos de sus archivos de configuracin: /etc/X11/xdm/ El archivo principal de configuracin de kdm es: kde_rootdir/share/config/kdm/kdmrc Los retratos de los usuarios mostrados en el ingreso de KDM son (formatos vlidos: .xpm 107

Tpico 110: El sistema X Window or .png) kde_rootdir/share/apps/kdm/pics/users/username.png El predeterminado es default.png

Configuracin gdm
gdm tiene sus propios archivos de configuracin separados de xdm/kdm. El archivo principal de configuracin es: gnome_rootdir/gdm/gdm.conf Mtodo de configurar gdm.conf: manual (editor) y (mucho mejor) a travz del programa de configuracin: gdmconfig Otras herramientas para configurar los retratos individuales de los usuarios mostrados en el ingreso por gdm: gdmphotosetup

Corriendo Terminales X usando xdm/kdm


Nota 1: El nmero de puerto del visualizador (:2 etc) puede ser elegido en y desde el cliente por tanto tiempo como el mismo puerto no sea escogido mltiples veces en el mismo anfitrin cliente. Este nmero puede tambien ser por ejemplo :2.0 que significa se usar la primera tarjeta grfica (0). Dado que mayormente ste es el caso slo utilizamos :2 y as es suficiente. Nota 2: Para que los cambios a estos archivos de configuracin tengan efecto, kdm/xdm necistan ser reiniciados.

Activando XDMCP (XDM Control Protocol)


Editar /etc/X11/xdm/xdm-config, y aadir el caracter '!' al principio de la siguiente lnea (normalmente es la ltima lnea): !DisplayManager.requestPort: 0 Editar el archivo /etc/opt/kde3/share/config/kdm/kdmrc: para habilitar Xdmcp y restringir el apagado del sistema slo al usuario Root [Xdmcp] Enable=true [X-*-Core] AllowShutdown=Root

Permitir el acceso por medio de la red


Editar /etc/X11/xdm/xaccess:

Para consulta directa desde un cliente


En el servidor: Introducir o activar (remover el caracter '#') las siguientes lneas: * #Allow any host to remotely login

108

Tpico 110: El sistema X Window *.linux.local myhost.linux.local #allow only myhost to remotely login El cliente usa una orden como X -query kdmserver :1 #Allow any host from my domain

Para consultas indirectas o de difusin desde los clientes


En el servidor: Introducir o activar (remover el caracter '#') las siguientes lneas: * *.linux.local myhost.linux.local El client usa la orden: X -broadcast :2 X -indirect kdmserver :2 CHOOSER BROADCAST CHOOSER BROADCAST CHOOSER BROADCAST

Para ingreso X no atendido


xdm/kdm activamente inician el contacto con el cliente. El cliente no tiene que hacer una peticin: El slo necesita iniciar su servidor X en el puerto de visualizacin adecuado si es necesario. En el servidor: Editar el archivo kde_rootdir/share/config/kdm/Xservers introducir la siguiente lnea: XTerminalName:2 foreign donde XterminalName=nombre del anfitrin o direccin IP del cliente. El cliente usa la orden: X :2

Configuracin de XDMCP en gdm


Use el programa gdmconfig ---> Sub-menu Expert ---> Activate XDMCP Editar el archivo gnome_rootdir/gdm/gdm.conf 109

Tpico 110: El sistema X Window Habilitar el Xdmcp: [xdmcp] Enable=true

110

Tpico 110: El sistema X Window

1.110.4 Instalar & personalizar un manejador de ventanas


Descripcin: El candidato debe poder modificar a nivel global de sistema un entorno de escritorio y/o un manejador de ventanas, para comprender y demostrar los procedmientos de personalizacin del men de manejador de ventanas y/o menes del panel de escritorio. Este objetivo incluye seleccionar y configurar la terminal-X deseada (xterm, rxvt, ater, etc.), verificar y resolver problemas de dependencia de bibliotecas para las aplicaciones X, exportar el Visualizador-X- a la estacin de trabajo del cliente. Peso: 5 Archivos, trminos y utilidades clave: .xinitrc .Xdefaults xhost variable de entorno DISPLAY

Manejador de ventanas
El manejador de ventanas permite que las ventanas de la aplicacin puedan ser movidas, redimensionadas o iconizadas, Muchos muestran un barra para el ttulo de la ventana, algunos tambin muestran un men, o permiten arrastrar-y-soltar (drag & drop) entre aplicaciones. Manejadores de ventana comunes twm mwm olwm fvwm kwin windowmaker, etc Archivos de configuracin de algunos manejadores de ventanas: Son diferentes para cada uno pero sew ve que muchos tiene un archivo de la forma .xxxxrc. Estos estn normalmente en el directorio base del usuario ($HOME). Ejemplos: .mwmrc .fvwm2rc .olwmrc etc.

Configuracin de Clientes X (programas X)


Muchos clientes X aceptarn la mayora de los siguientes parmetros estndar de X11: xterm -T "Title" -fn 9x15 -display :0 -geometry 100x40+30+40

-geometry
Esta opcin posiciona y dimensiona la vetana cuando un cliente X se inicia Sitxis: 111

Tpico 110: El sistema X Window -geometry <Hsize>x<Vsize><Hpos><Vpos> <Hsize> y <Vsize> son nmeros en caracteres <Hpos> '+' es derecha, '-' es izquierda (en pixeles). Ej. +10 es 10 pixels a la derecha <Vpos> '+' es abajo, '-' es arriba (en pixeles). Ej. +10 es 10 pixels desde abajo Ejemplos: -geometry 1x1+0+0 1 caracter horizontal, 1 caracter vertical, esquina superior izquierda -geometry 5x20-10+30 5 caracteres de ancho (horizontal), 20 caracteres de alto (vertical), Posicionado en la esquina superior derecha 10 pixeles horizontalmente a la izquierda 30 pixeles verticalmente abajo (inferior) Nota: La geometra tambin puede ser fijada individualmenete para clientes X editando el archivo ~/.Xresources. Eejmplo: Xterm*geometry: 90x30

Seleccionando un tipo de letra para los Clientes X


-fn fontname
Especifica el tipo de letra a usar en la ventana Esta es una lista corta de algunos tipos de letra de tamao fijo: 7x14 6x10 6x13 8x13 9x15 10x20 xterm -fn 10x20 xterm -fn -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1 Nota: Los tipos de letra tambin pueden ser fijados individualmente para clientes X en el archivo ~/.Xresources Xterm*font: 90x30

Archivo ~/.Xresources o ~/.Xdefaults


Nota: En SuSE ~/.Xresources es un enlace simblico a ~/.Xdefaults Sintaxis del archivo: Programa*Recurso: Valor Ejemplos de como fijar valores para Xterm en ~/.Xresources:

112

Tpico 110: El sistema X Window xterm*background: xterm*Foreground: xterm.eightBitInput: xterm*multiScroll: xterm*jumpScroll: xterm*font: 90-xterm*ScrollBar: xterm*SaveLines: xterm*VisualBell: xterm.eightBitOutput: Xterm*geometry: xrdb -merge .Xresources LightYellow2 Blue true on on -adobe-courier-bold-r-normal14-140-75-75-mon 2000 true true 90x30

Actualizando los cambios hecho en el archivo ~/.Xresources sin reiniciar el servidor X:

Iniciando una sesin X con startx


Ingrese desde un terminal virtual (basado en texto) y entonces corra el script startx. startx que a su turno inicia xinit. xinit inicia el Servidor X, entonces incia el script xinitrc ($HOME/.xinitrc si se encuentra, /var/X11R6/lib/xinit/xinitrc en otro caso) Contenido del script xinitrc: Se cargan las definiciones de teclas para todo el sistema. La definiciones estn en: /etc/X11/Xmodmap y ~/.Xmodmap Se cargan las definiciones de recursos para todo el sistema. Las definiciones estan en: /etc/X11/Xresources, ~/.Xresources, ~/.Xdefaults Aqu un usuario puede iniciar programas que introduzca manualmente El manejador de ventanas elegido es iniciado

Iniciando una sesin X con xdm/kdm/gdm


Cuando un usuario hace su ingreso via un manegador de despliegue (display manager), un proceso similar a starx ocurre, la diferencia es que el script ejecutado ser: /etc/X11/xdm/Xsession y ~/.Xsession (si existe) Nota: Algunas distribuciones estn ejecutando ~/.xinitrc desde Xsession para mantener consistentemente el mismo entorno.

113

Tpico 110: El sistema X Window

X11 en la red
Preparando el cliente X
Puesto que casi todos los Clientes X pueden usar el argumento -display :xx, podemos iniciar un programa cliente y enviar su salida a cualquier servidor X existente que vaya a permitir la conexin. Todos los programas cliente X necesitan saber donde est localizado el servidor X con el que intentarn hospedar el programa. Esta informacin es dada al programa cuando lo iniciamos ya sea por medio del argumento anterior (-display :x.x) o por medio de la variable de entorno DISPLAY. Para hacer eso, la siguiente orden prepara el contenido de esta variable: export DISPLAY=X-ServerHost:xx entonces corra el programa cliente X.

Preparando el servidor X
De modo predeterminado los Servidores-X slo permiten que programas del usuario local sean mostrados. Para que otros usuarios o hosts tengan permitido mostrar sus programas Cliente-X en l, el Servidor-X necesita que se le notifique hacerlo. La notificacin es hecha con la rden xhost. Sintaxis: xhost [+|-] ClientHostName Ejemplos: xhost + localhost Permite que otros usuarios Clientes-X en el host local usen este ServidorX. xhost + Permite a todos desde cualquier hosts usar este Servidor-X. Peligroso ! xhost + myfriend Permite que los programa Cliente-X en el host myfriend usen este Servidor-X. xhost bugger Impide que el host bugger use este Servidor-X. Nota 1: Slo el dueo del proceso Servidor-X est permitido de usar la orden xhost.

Permitiendo acceso permanente a un Servidor-X


Hay dos mtodos regulares para permitir acceso permanente a una lista de hosts al Servidor-X local: 1. Editar el archivo e introducir la orden xhost para todos los hosts permitidos en ~/.xinitrc script, o 2. Crear un archivo llamado /etc/Xn.hosts e introducir todos los hosts permitidos a usar el Servidor-X local. (n=nmero de despliegue del Servidor-X.) 114

Tpico 110: El sistema X Window

Revisando dependencias de biblioteca para los programas Cliente-X


En el tema de dependencias de bibliotecas no hay diferencia entre los programas normales y los programas Cliente-X. El programa ldd hace el trabajo.

115

Glosario de trminos

Glosario de trminos
This list contains the complete list of terms assumed by LPI tests. Knowledge of these terms will be important in preparing for LPI exams, but no exam question should depend on knowledge gleaned solely from this list. Note that the list will be updated occasionally (so it is not yet exhaustive). If you have any additions or comments, please let us know. The purpose of this list is to delineate the terms (jargon and acronyms) that will be used in the LPI Linux certification exams. Before writing or reviewing items, please review this list (and check it out periodically afterwards as updates occur). Any jargon term or acronym which does not appear on this list, or is in the "deprecated alternatives" column, should NOT be used in an LPI test. If this is not perfectly clear or if you need help deciding whether something is jargon or an acronym, please contact an appropriate LPI coordinator, the list maintainer or us. Other useful and authoritative glossaries of terms can be found in these RFC's: RFC1208: A Glossary of Networking Terms RFC1983: Internet User's Glossary RFC2828: Internet Security Glossary (also see http://freesoft.org/CIE/RFC/Orig/rfc2828.txt) For explanation of PC hardware components, see: http://www.pcguide.com/ref/ Term *NIX Deprecated Alternatives Comment A term for any operating system resembling UNIX(R)(TM), including Linux and a large number of free and commercial systems; also UN*X. So-called Thin Ethernet, using RG-58 coax cables and BNC connectors to construct a chain of cables, which must be terminated by resistors; supports a maximum (theoretical) transmission of 10 Mbit/s. The older Thick Ethernet, which used vampire taps into a single cable; supports a maximum (theoretical) transmission of 10 Mbit/s. Ethernet over UTP cables, using hubs to produce a star topology; supports a maximum (theoretical) transmission of 10 Mbit/s. Ethernet over UTP cables, using hubs to produce a star topology; supports a maximum (theoretical) transmission of 100 Mbit/s. To connect to and utilize a device (computer, printer) or file. The symbol or number that refers to a user for accounting purposes.

10Base2

10Base5

10BaseT

100BaseT

access account

116

Glosario de trminos Term address [1] Deprecated Alternatives Comment A location in memory; specifically, the I/O-port used by a device to communicate with the processor. A unique identifier assigned to an interface on a network-attached device such as a network interface card. Notice: a host can have multiple interfaces, hence multiple addresses. The name|number|both given to a computer, device or resource so it can be identified, found and accessed on a network. (to make it work. ;-) To control the operation and use of a computer or other device; the task of a system administrator. A formal Descripcin of a procedure that, when suitable input is entered, will generate output as a result that satisfies specific requirements. Within a shell, a substitute word for a command string (e.g.: alias dir = "ls --color"). An additional IP address on an interface. Refers to another name given to an e-mail account, in order to accept mail for one e-mail address and forward it to another. the Alternative key on a keyboard Refers to a physical measure that can take any value within a continuous range; e.g., the voltage used to encode loudness when transmitting a signal over a conventional copper telephone line. cf. digital. A standards body responsible for many protocols. A specification which allows simple access to functionality of a library or other system resources when writing a program; operating system functionality is made available through an API. A program that runs on top of an operating system. The name of the top layer of both the sevenlayer ISO/OSI model, and the four-layer TCP/IP protocol stack; although some of the functionality of the session and presentation layers of the former may be assigned to the latter. It includes protocols such as telnet, FTP HTTP SMTP etc. , , , A backup of data to be preserved.

address [2]

address [3]

administer

algorithm

alias [1] alias [2] alias [3]

ALT analog

ANSI API

American National Standards Institute Application Programming Interface

application application layer

archive [1]

117

Glosario de trminos Term archive [2] Deprecated Alternatives tarball Comment A file that contains one or more components and an index (e.g. in tar, cpio, rpm or deb format). A piece of information passed to a command or function (usually typed in behind it), that modifies its behaviour, or that is operated upon by the command or function. e.g. in `cat motd`, "motd" is the argument. cf. parameter. See RFC826. A low-level protocol which, given an IP address on the local network, returns the Ethernet MAC address of the corresponding interface. cf. RARP . A specification of characters widely used in the UNIX world and beyond. The ratio between the width and the height of a pixel on a computer display. A program that compiles programs written in assembly language into object code. A low-level computer language that can be translated directly to the object code of the computer processor. A popular 16-bit interface standard that extends the ISA bus of the IBM PC-AT to attach peripherals; it has evolved through over 5 generations; the original ATA is better known as IDE. An enhancement of the ATA protocol to be able to connect CD drives etc. This list was compiled by (in alpha order): Les Bell, David DeLano, Alan Mead, Tom Peters, Richard Rager. A state of process execution which does not produce output to the terminal (execution may stop if the process tries to write to the terminal); it is common to run system processes and long running user applications in the background; cf. foreground [1]. A copy of essential data stored on- or off-site as insurance against failures of system hardware, software or user. To make a backup. taking two discrete values (e.g. bits), as opposed to decimal (= taking ten discrete values).

argument

ARP

Address Resolution Protocol, arp

ASCII

American national Standard Code for Information Interchange

aspect ratio assembler assembly language ATA assembler

AT Attachment

ATAPI Authors

AT Attachment Packet Interface Super heroes, men and women of gold

background [1]

backup [1] (noun) backup [2] (verb) binary [1] (adj)

118

Glosario de trminos Term binary [2] (noun) Deprecated Alternatives Comment A file that is not intended to be read by humans but by applications or the operating system; especially in plural ("binaries") for compiled sources; cf. text. A simple, low-level operating system which supplies a uniform API to higher-level operating systems; BIOS is generally implemented in ROM of some sort. The smallest entity of information: can have one of two states (0-1, on-off, open-closed, etc.). The number of bits available for each display pixel to code for visual appearance (color, proximity, etc.). A device that exchanges data with the operating system in sizable blocks (e.g., 512 bytes) at a time. Software, usually installed on the MBR of Intel machines, which exists to load the operating system kernel and begin its functioning. To cause the operating system to begin to function. Takes its name from "pulling oneself up by the bootstraps", a whimsical analogy applied to the BIOS loading itself and then running the "boot loader". (Also reboot). See RFC951; cf. DHCP . A device that propagates packets between two computer networks; it operates at the second, data link layer within the ISO/OSI model, and broadcasts packets based on the address, but does not do routing. cf. repeater, router. A frame or datagram addressed to all interfaces on a network. A variant of UNIX originally developed at the University of California, Berkeley. The BSD TCP/IP stack is the model for most subsequent TCP/IP implementations. temporary storage; cf. cache A mailing list for discussions regarding network security (daemons, programs, operating systems, routers). To run a sequence of compile and link steps to produce a new version of an executable program. A cable for transmitting signals between various components within one computer system.

BIOS

Basic Input/Output Operating System

bit

bitplanes

bit planes, bit-planes

block device

boot loader

boot

BOOTP bridge

broadcast (noun) BSD

Berkeley Systems Distribution

buffer BUGTRAQ

build

bus

119

Glosario de trminos Term byte C C++ cache Deprecated Alternatives Comment A data type of 8 bits. A compiled computer language closely associated with UNIX. An object-oriented computer language derived from C, that needs a compiler. Any readily accessible storage area used to keep data handy which is (somehow) indicated to be needed again shortly; the purpose being to speed up the access of that data and improve system performance. Specifically: the fast computer memory that is used as a buffer for data and program instructions between the CPU and the slower main memory (cf. RAM). A domain name server that does not have any domains files. A commercial Linux distribution.

caching-only DNS Caldera OpenLinux card CD-ROM

Caldera, OpenLinux, CSOL

CERT

cf.

CGI CHAP char character character device child process

Any device that can be plugged into a computer expansion slot. Compact Disc Read Only A removable medium of considerable Memory popularity which comes in several variations, the most popular being ISO9660. Computer Emergency A team of people that study Internet security, Response Team and provide incident response services; see http://www.cert.org/ "confer", which means "consult" in the meaning of "also see" or "compare". N.B.: Avoid this. Use only in parenthetical examples (cf. e.g., i.e.) but avoid "cf." by putting examples in text like this. Also see "e.g.", "i.e.". Common Gateway A standard for allowing server applications to Interface be executed as part of a HTTP request. Challenge Handshake Authentication Protocol character C data type (usually one byte) used to store letters (cf. character). char A letter or sign usually represented by 1 byte in ASCII code. A device which exchanges data with the operating system in one character (or byte or even word) at a time. Any process created by another, so-called parent process; usually used in reference to a particular parent process.

120

Glosario de trminos Term CIDR CIFS Deprecated Alternatives Classless Inter-Domain Routing Common Internet File System Comment See RFC1519; cf. variable length subnet mask Microsoft's successor to SMB, a suite of protocols for sharing file and print services (among Windows machines or UN*X machines running CIFS servers like Samba). In reference to a drive being mounted, clean means that the drive was unmounted properly and thus (theoretically) does not need to be checked; otherwise a drive is dirty A computer or process which connects to and receives a service from a server computer or process. Cable with inner and outer conductors used for TV cables and for Ethernet LANs, where the computers usually have T-joints to attach to a single chain of cables which needs to be terminated by resistors. A table used to encode a palette of colors for images. An interactive user interface which allows commands to be given to a computer program or shell through a text-based terminal (or terminal emulator in a window within a graphical user interface). A program which examines program source code and translates it into an equivalent object code file; cf. interpreter. Removal of redundant information from a file or data stream, to reduce its size, the storage space it needs, or the time needed for transmission. Lossy compression actually discards information that is considered not essential, and is only appropriate for data like images or sound. A digital, electronic, general-purpose, programmable, information processing automate. The primary, directly attached, user interface of a computer. Some system administration functions may only be performed at a console. A collection of buttons, switches, lights or display used to configure and control a router, printer, computer or other device. The content of memory written to a file on disk (usually called "core") when a program crashes. damaged (said of a file or disk contents)

clean

client

coax

co-axial cable

colormap

color map, color-map, color table command line CLI interface

compiler

compression

computer

console

control panel

core dump

coredump

corrupted

121

Glosario de trminos Term CPU Deprecated Alternatives Central Processing Unit Comment The main component that makes a computer work; these days usually a "micro-processor" on a single silicon chip (cf. processor). To gain access to a computer system without proper authorization (e.g. by guessing a legitimate user's password), and possibly interfere with its normal operation or integrity. Someone who tries to crack; cf. hacker. A software program used to crack, for instance by guessing passwords. A sudden stop of normal operation. Supposedly, the original hard drives would sometimes experience a catastrophic failure in which the read/write heads would crash into the media, possibly sending the media flying; hence a crash is a unintentional termination of software or hardware due to some failure or error - especially a termination in a final, catastrophic, or unpleasant way. SLIP with added VJ compression of IP headers. See RFC1144. the Control key on a keyboard

crack

cracker [1] cracker [2] crash

crack

CSLIP CTRL current working directory cylinder

Compressed Serial Line IP cwd

daemon data

A number of tracks located at the same radius on the several surfaces of a hard disk. A hard disk with four platters has eight surfaces, so that at each position of the read-write heads, eight tracks can be read without head movement and these eight tracks form a cylinder. A program that runs in the background to offer system services. "that which is given", for instance as input to a computer; cf. information.

122

Glosario de trminos Term data link layer Deprecated Alternatives Comment Layer two of the ISO/OSI seven-layer model. Responsible for establishing an error-free communication path between network nodes over the physical link layer, it frames messages for transmission, checks the integrity of received messages, manages access to and use of the media, and ensures proper sequencing of transmitted data. These functions are generally provided by a network card driver. The IEEE in its 802.x series of standards splits this layer in two: the LLC layer and the underlying MAC layer. A usually large collection of ordered and readily accessible data. A program to manage a database and extract information from it. packet, especially as used in UDP (Note: not IP-specific - other protocols use the term datagram in their documentation). A GNU/Linux distribution built by a volunteer organization. The value of a parameter that a program uses if it is not explicitly given a value. the Delete key on a keyboard remove or erase a file|character|directory . A state in which other libraries|programs| packages are required to make a program work. A USA government-sanctioned standard for the encryption of data now considered insecure to high-end brute force attacks. The screen from which all programs are started and run on X. A "peripheral" piece of hardware that is an optional part or can be attached to a computer (even one that is actually housed within the computer's casing): interface cards, drives, printers etc. The software interface used within Unix (Linux) to represent a computer peripheral: interface cards, drives, printers, etc.; see the /dev/ directory .

database [1] database [2] datagram

Debian default DEL delete dependency

DEBorah & IAN (Murdock)

DES

Data Encryption Standard

desktop device [1]

device [2]

123

Glosario de trminos Term DHCP Deprecated Alternatives Dynamic Host Configuration Protocol Comment Provides for automatic downloading of IP address and other configuration data from a server to a client. Allows for reuse of IP addresses so that the number of hosts can exceed the number of available IP addresses. See RFC2131, cf. BOOTP .

dial-in, dial-up, Refers to a connection dial-out (adj) made over the Public Switched Telephone Network (PSTN), as opposed to a permanent, or leased-line, connection. die To cease execution, especially in a final or complete manner. digital Refers to an entity that can assume only a limited number of discrete states and not an arbitrary value; e.g. binary. cf. analog. directory A special type of file which contains information about other files, such as file name, location, permissions, size etc. dirty not clean disk Rotating magnetic media which supports direct or random access; cf. floppy disk, hard disk. display screen A human readable device to display text, graphics or other data. distribution A (usually) complete collection of software needed to operate a computer including the Linux kernel and various utilities and applications. DMA Direct Memory Access A hardware protocol which allows a special controller circuit (DMA controller) to transfer a block of data from a peripheral device's buffer memory directly to main memory without CPU involvement; cf. PIO. DNS Domain Name System A hierarchically-structured distributed directory service which translates humanintelligible names like www.lpi.org into the corresponding IP addresses. See RFC's 1034 and 1035 and also 1032 and 1033. documentation domain name DNS, nameserver server domain [1] One or more computer networks that serve an organizational group. domain [2] The name assigned to a network domain.

124

Glosario de trminos Term drive Deprecated Alternatives Comment Any device that can store and retrieve data in a relatively permanent fashion on media (which may be removable or built into the device).

driver dynamic e.g.

"for example" (Latin: "exemplum gratii"). N.B.: Avoid this. Use only in parenthetical examples (e.g., like this) but avoid "e.g." by putting examples in text like this. Do not confuse with "i.e.". Also see "cf.". Enhanced IDE Western Digitals proprietary extension of the IDE interface standard with ATA-2 and ATAPI features, used to connect hard drives and CDROMS to a PC. To simulate the actions of a device or program so that the simulation can actually perform the same functions as the original. A program that emulates the functions of some device or other program. A collection of variables associated with a process so that it knows about the user preferences and configuration of the system; they are inherited by a child process. The variables that define an environment. easy to use by humans the Escape key on a keyboard A type of LAN computer network interface using coax (10Base2 or 10Base5) or UTP cables (10BaseT or 100BaseT). The specifications are described in IEEE standard 802.2 . cf. MAC. To set to work (a program); cf. run. Permission set on a file on a Unix filesystem so that it may be run as a program by the "operating system. A file that is a binary or a script that can be run as a program (may assume execute permission).

editor EIDE

e-mail emulate

email, electronic mail

emulator environment

environment variables ergonomic ESC Ethernet

envars, environmental variables

event execute execute permission executable

export

125

Glosario de trminos Term FAT Deprecated Alternatives File Allocation Table Comment A simple filesystem using a table to index files on a block device (floppy or hard disk). It comes in the varieties of FAT-12 (MS-DOS), FAT-16 (MS-DOS, MS-Windows 3.x) and "FAT32" (MS-Windows 9x). A proposed standard for the location of files on a Unix system. See http://www.pathname.com/fhs/. A named sequence or stream of bytes at a known location in storage. The data structures placed on a logical disk or partition (by mkfs) which allow the operating system to record information about files stored there. To remove unwanted data. A gateway that restricts data communication between the "inside" network and the Internet "outside" the firewall. used with numbers that may represent a fraction; cf. integer A magnetic storage medium with a flexible disk inside; cf. hard disk. A device that can read and write floppy disks. The shape of each of the letters in a character set. The context in which a process is having access to a terminal for output, i.e. is not running in the background. The color of text on a computer display (as opposed to the text's background). Refers to the window 'in front of' all others and with which the user is interacting. When an executing process creates an exact executing duplicate (except for the different PID) of itself; see child process, spawn. Specification regarding how data are stored. To apply the requisite format to storage media in preparation to making a filesystem. The act of receiving an e-mail and then resending it to another destination. A packet as assembled and transmitted over the physical layer of a network (e.g. Ethernet, Token Ring, etc.). Not costing anything.

FHS

Filesystem Hierarchy Standard

file filesystem file system

filter firewall

floating-point (adj) floppy disk floppy drive font foreground [1]

floppy, diskette floppy

foreground [2] foreground [3] fork (verb)

format [1] (noun) format [2] (verb) forwarding frame

free [1]

126

Glosario de trminos Term free [2] Deprecated Alternatives Comment Not inhibited. As applied to source code it allows modification, study and adaptation, not inhibited by excessively restrictive commercial license terms. cf. GPL, Free Software Foundation. Free Software Foundation: a tax-exempt charity that raises funds for work on the GNU project; see http://www.fsf.org. A standard for the location of files on a Linux system; replaced by the FHS. A protocol for transferring files over the Internet and the software to accomplish the transfer. See RFC959. A device or relay mechanism that connects two or more computer networks and which directs packets between the networks in an internet. In common usage today, a gateway is a general-purpose computer with a generalpurpose operating system [e.g. Linux] which *may* be performing other functions, and in that role it operates at the third, network layer in the ISO/OSI model; while a router is a special-purpose computer with a special purpose operating system [e.g. IOS], generally from a specialist supplier [e.g. Cisco]). cf. bridge. 1000 (or rarely 1024) MB (1,000,000,000 or 1,048,576,000 or 1,073,741,824 bytes) Group ID A variable, configuration section, procedure etc. having a scope which is unlimited (i.e., applies everywhere unless contradicted locally) A Free Software Foundation project to build Unix(R)(TM)-compatible utilities and programs exclusively based on free program source code. A license for distribution of free software which permits copying, modification and redistribution. It was created by the Free Software Foundation for its projects like GNU, and has been applied to Linux as well. See http://www.gnu.org/copyleft/gpl.html images, pictures; in contrast to text

FSF

FSSTND FTP

FileSystem StaNdarD File Transfer Protocol

gateway

GB GID global

giga-byte, gigabyte, Giga-Byte, GigaByte, Gb

GNU

GNU's Not Unix

GPL

General Public License

graphics

127

Glosario de trminos Term Deprecated Alternatives graphical user GUI interface Comment An interactive interface using a graphics display. N.B.: refer to a "graphical user interface" only if there actually is a graphical interface (like X), and do not use it for interactive programs on text terminals (based on ncurses or slang). Use "interactive interface" as a catch-all. cf. command line interface. Refers to a list of one or more users having the same access rights; see /etc/groups . To accomplish a result in an unorthodox way. Someone who hacks: a title assigned to people with remarkable computing skills; cf. cracker. cf. crash A computer device that uses solid disks as magnetic medium to store data. cf. floppy disk. In Unix filesystems, an entry in a directory that points to a file in another directory on the same disk or partition, and shares the inode of that file; cf. symbolic link. All physical parts making up the computer ("the parts that can be kicked" ;-) ISO/IEC 3309 standard; relevant in PPP . Refers to a computer language with a higher level of abstraction from the computer architecture than a low-level language. Any computer attached to an IP-based internet, especially computers that can act as a server to a client program or computer. A series of documents, each on a particular topic, which form a significant portion of the documentation for Linux. HOWTO's originated with, and are generally published by, the Linux Documentation Project. A standard for specifying the structure of a document indicated by tags in the document text; used on the World Wide Web with HTTP . The succession of application layer protocols used for communication between a WWW browser and a WWW server. See RFC2616. Generally, a device connected to several other devices; specifically in computer networks, a repeater in the center of a network with star topology, usually with 10BaseT or 100BaseT Ethernet.

group hack hacker hang hard disk

hard link

hardware HDLC high-level (adj) High-level Data Link Control

host

HOWTO

HTML

HyperText Markup Language HyperText Transfer Protocol

HTTP

hub

128

Glosario de trminos Term i.e. Deprecated Alternatives Comment "that is" (Latin: "id est"). N.B.: Avoid this. Use it only in parenthetical asides (i.e., asides like this one) and then only to clarify a point. Do not confuse with "e.g.". Also see "cf.". Input/Output Internet Control Message Protocol A required protocol (RFC792) for the notification of errors between gateways and hosts on IP-based internets. It operates at the level of the IP protocol in the internet layer. Interestingly, although ICMP is required (*must* be implemented), hosts and gateways are not required to generate ICMP messages, and hosts are not required to respond or react to incoming ICMP messages (in fact, mostly, they don't, relying on higher-level protocols like TCP to simply time-out and retransmit, so you can't say that ICMP _handles_ errors). Also, because IP is a packet-oriented connectionless protocol, there's no concept of duration of transmissions. IDentifier A popular interface to attach hard drives to PC's, where the electronics of the controller are integrated with the drive instead of on a separate PC card; also see ATA. A programming environment integrated into an application; rare on Linux.

I/O ICMP

ID IDE

Integrated Drive Electronics

Integrated Development Environment idle IEEE

IDE

IMAP [1] IMAP [2]

implement include file

information inode input

inactive; waiting for a task or a wake up call Institute of Electrical and USA based, international organization of Electronics Engineers professional engineers; also an important standards body Interactive Mail Access See RFC1203 Protocol Internet Message Access See RFC2060 on IMAP4 (beats me why Protocol there's two names for the same thing, with the same acronym yet). To create an actual object (program, device) that conforms to abstract specifications. A file which contains constants and parameters, possibly shared between two or more programs, and included into the source code when these programs are compiled. info Something worth knowing, in contrast to just plain data. In Unix filesystems, a block of administrative data for a file on the disk partition. Any data that are entered into a running program, or into a file. 129

Glosario de trminos Term install Deprecated Alternatives Comment Transferring a new program to a computer's permanent storage (e.g., hard disk) and performing any necessary configuration or administration. A data type used to represent a whole (integer, non-fraction) number within a limited range. correctness Adjective, meaning: having the property to be able to interact, i.e. respond to stimulation from the outside. Used in the context of programs or interfaces. An interface between a computer and a user which allows them to interact and exchange input and output (commands and data). A connection (through a hardware device or through a software program) between different components of a computer system (usually performing some kind of translation between protocols internal to the components); used especially in the contexts of network communication, or communication between computer systems and their users. The worldwide distributed network of computers linked by the Internet Protocol. The network layer in the TCP/IP protocol stack: this alternative name may be used to distinguish it from the underlying network access (physical) layer. cf. Internet Protocol. A company which provides connections to the Internet. A program which examines a script or program source code and executes it, line by line; cf. compiler. A network (usually a LAN) based on IP but, unlike the Internet, allows only restricted access. induce execution of; call The memory address peripheral devices use to communicate with the CPU; see /proc/ioports . The network layer protocol used on IP-based internets. See RFC791. An increasingly obsolete PC bus standard.

integer

integrity interactive

interactive interface interface

CLI and|or GUI

Internet internet layer

internet, (the) net

Internet service provider interpreter

ISP IAP Internet Access , , Provider

interrupt intranet

invoke ioport

address

IP IRQ ISA

Internet Protocol Interrupt ReQuest Industry Standard Architecture

130

Glosario de trminos Term ISDN Deprecated Alternatives Integrated Services Digital Network Comment

ISO job k KB kbit/s Kbyte/s

kernel

key [1] key [2] key [3]

keyboard LAN

LDP library LILO

link

A baseband protocol used by telephone companies to offer one, two or more Bchannel (Bearer channel) lines of 64 Kbit/s each on a single copper pair of up to 5.5 km length. Each B-channel can be used to provide a high-quality voice line, or fax or data services. International Standards One of several bodies which exist to promote Organization standards, including computer standards. A task which has been sent to the background or has been submitted for later execution. K, kilo a factor of 1000, but with computers usually 1024 (2^10) kilo-byte, kilobyte, kb, kB 1024 bytes kilobit per second, kbps, Data transfer rate in units of 1000 bits per Kbps, Kbit/s second. kilobyte per second, Data transfer rate in units of 1024 bytes per kbps, Kbps, KBps, KB/s, second. kbyte/s The core of an operating system, which provides multitasking (process creation, interprocess protection, interprocess communication), memory management, and basic I/O management. A token which is used to encrypt plain text or decrypt cipher text in an encryption system. A database field which may be used as the basis of a query. A marked switch on a keyboard which used to be a common computer input device before they were eaten by mice ;-). An input device having many keys marked with letters and other symbols. Local Area Network A small network, usually with one or a few segments, which supports broadcasting and direct connections between hosts; e.g. Ethernet, Token Ring, Appletalk and ARCNet; cf. WAN. Linux Documentation Project A collection of (often related) subroutines to be linked to a program. LInux LOader A boot loader: a program that loads the kernel so Linux can boot; can also boot other operating systems. To bind a program to the subroutines it references (calls). These are typically located in object modules or libraries. 131

Glosario de trminos Term Linux Deprecated Alternatives Linux Is Not UniX? Comment A Unix-like operating system first developed, still maintained by, and named after Linus Torvalds. It is freely available under the General Public License. But if you didn't know all that already, what are you doing here? An IEEE network standard (#802.2) that fits within the ISO/OSI Layer 2: data link layer, on top of the MAC sub-layer. It deals with error detection, flow control, and frame formats. To transfer from disk into memory. within easy reach, on the local area network, not remote. record of activities In the jargon of electronics engineers: the electronic components and circuitry of a device. This use of the term should be avoided because of the confusion with the conventional meaning of: abstract formal reasoning, which is involved in computer programming.

LLC

Logical Link Control

load local logfile log logic

login logoff logon logout loopback low-level (adj)

LPI

Linux Professional Institute Media Access Control

MAC

Mail User Agent

message user agent, MUA, UA, user agent

Refers to a computer language in which statements are similar to instructions for the processor (or: in which statements are more like object code than in a high-level language). Non-profit organization founded to create a widely supported certification program for Linux; see http://www.lpi.org/ A layer of IEEE network standards (#802.x) that fits within the ISO/OSI Layer 2: data link layer, below the LLC sub-layer. It deals with access methods, error detection, and transmission unit formats. Well-known IEEE MAC specifications are Ethernet in its various incarnations (#802.2) and Token Ring (#802.5?). An end-user program used to access, process, read, archive, compose and send e-mail messages. See RFC1711. Such e-mail programs often include some "MTA" functionality, in particular the ability to use SMTP to send e-mail to an outgoing mail server, and POP3 or IMAP4 protocol to download mail from an inbound mail server. cf. Message Transfer Agent. 132

Glosario de trminos Term maintain manual [1] (noun) manual [2] (adj) man page Deprecated Alternatives Comment

manual page

masquerade

MB Mbit/s MBR

mega-byte, megabyte, meg, Mb Megabit per second, Mbps Master Boot Record

media memory

A document, often of book-length, discussing the design or operation of a software package or device. by hand (as opposed to some more automated means) Standard Unix manual page (usually available on the computer system in nroff format, called with the command `man`). To pretend to be another host for the purposes of sharing one IP address among several local hosts hidden to the outside world for reasons of resource shortages or security. cf. NAT 1000 (or sometimes 1024) KB (1,000,000 or 1,024,000 or 1,048,576 bytes). Data transfer rate in units of 1,000,000 bits per second. An area of the outermost cylinder of a PC hard disk which contains the partition table. This contains four entries identifying the types, starting cylinder and sizes of up to four partitions on the hard disk. One of the entries is flagged as 'active'; this marks the partition from which the machine will boot. (Floppy disks don't have an MBR, since they don't have a partition table. Instead, they just have a boot sector (same as a logical disk), which contains a Media Descriptor Table (MDT) and bootstrap loader. The MDT describes the format of a floppy disk or logical disk). The physical device by which data are transmitted or (more commonly) stored. The place where a computer stores data and| or programs for direct access by the CPU: RAM or ROM (and also cache memory), not disks.

menu

133

Glosario de trminos Term Deprecated Alternatives Message mail transfer agent, mail Transfer Agent transport agent, message transport agent, MTA, MDA, mail delivery agent, message delivery agent Comment (by L.B.?) A program which routes e-mail based on the RFC822 header and invokes the correct delivery agent, especially SMTP (RFC821) in order to route the mail towards its ultimate destination. For example: exim, qmail, sendmail, smail. Also see RFC1711 and Mail User Agent. The term "Mail Transport Agent" is used in the online "Network Administrator's Guide" to refer to rmail, which, of course, is used to process incoming mail from UUCP before passing it onto sendmail. This usage is at least confusing, if not incorrect. On MDA (Message Delivery Agent): This one really has me going. I'm not sure whether it is: "A protocol, or its implementing program, responsible for transferring messages from one host to another. For example, SMTP ."; or: "A program responsible for delivering mail to the correct user mailbox on a host. For example, sendmail." I've been researching this in my paper library and on the net for the last half hour, and have not come up with any consistent or reasonably definitive examples. Personally, but based on what evidence I can't remember, I lean to the first definition, but Aileen Frisch uses the second in her "Essential System Administration" book. Hold on - after a search at http://www.imc.org , I've discovered RFC 1711, which defines MTA and UA, but has no mention of (M)DA. I think this one is what we in Australia would call "a furphy". - Hence the use of "MDA" is to be AVOIDED. A slimmer, more focused document otherwise like a HOWTO. MOdulator/DEModulator A device that converts between digital signals from the computer and analog signals for communication over a telephone line. An input device which allows pointing to, selecting and activating objects, usually displayed in a graphical user interface. A 32-bit operating system from Microsoft(C)(R)(TM).

mini-HOWTO modem

monitor mouse

MS-Windows NT

NT, Windows NT

134

Glosario de trminos Term MTU Deprecated Alternatives Maximum Transfer Unit Comment

Maximum size of an IP packet that will be accepted for transmission without fragmenting it into smaller datagrams. Usually an optimal size is determined automatically; typical sizes are 296 bytes (40 header + 256 data for phone lines), and 1500 bytes (the maximum for ethernet connections). NAT Network Address A generic Descripcin of the process whereby Translation the IP address of a host on a private internet is translated into an IANA-assigned unique address on the wider Public Internet. This can be accomplished by several techniques: masquerading, circuit-level gateways such as SOCKS, transparent proxying or applicationlevel gateways. N.B. "take good notice" (Latin: "nota bene"). NetBEUI NetBIOS Extended User The current implementation of the NetBIOS Interface protocol used in MS-DOS, MS-Windows and OS/2. NetBIOS over A layer of code which implements the TCP/IP NetBIOS API, but utilizing TCP and UDP datagrams, which are of course encapsulated in IP datagrams. Since IP is routable, this overcomes the most significant limitation of NetBIOS. See RFC's 1001, 1002, 1088. NetBIOS Network BIOS A lightweight transport protocol developed by Sytek, IBM and Microsoft for use on personal computers. NetBIOS defines three things: the protocol on the wire (datagram formats); the code which implements the protocol; the API used to employ the protocol. The major example of an application which uses the NetBIOS API is Microsoft Networks, the workstation and server code implemented in MS-DOS 3.0 and later, OS/2 and various Windows incarnations - though other applications do exist. NetBIOS employs name registration and broadcast discovery, rather than addressing, and is consequently a nonroutable protocol. cf. SMB, NetBIOS over TCP/IP . netmask network mask: the network part of an IP address; cf. variable length subnet mask network An interconnected set of hosts and other network devices which share a common physical layer such as Ethernet, X.25, etc.; cf. LAN, WAN.

135

Glosario de trminos Term network access layer Deprecated Alternatives Comment

The lowest layer of the TCP/IP protocol stack, also known as the "physical" or "hardware" layer. Consists of the cables, connectors and associated hardware such as driver chips to implement a network such as Ethernet or Token Ring, as well as the drivers for the hardware. It approximately spans the lowest two layers of the theoretical ISO/OSI network protocol stack: the physical and data link layers. network NIC, Ethernet card, LAN An expansion board allowing a computer to interface card adapter access a network. network layer The layer of a network protocol stack that is concerned with addressing and delivery of datagrams across a network or internet. It is layer three in the IS O/OSI seven-layer model. In the TCP/IP protocol stack, the main network layer protocol is the Internet Protocol (IP); therefore this layer is also known as internet layer. NFS Network File System A protocol (developed by Sun Microsystems) enabling a UN*X machine to mount a remote disk area as part of its local filesystem; widely considered of questionable security. NIS Network Information Protocols to provide network services (such as System authentication) for NFS. object code machine code Instructions that can be executed by the computer processor. offline off-line not connected to a computer system or network; cf. online online [1] on-line connected to a computer system or network; cf. offline online [2] on-line stored on and accessible through a computer system or network operating OS Central set of programs that manage the system various components and devices of the computer, and its interaction with application programs and users; e.g. MS-DOS, MSWindows NT, MacOS, Unix, Linux. OSI Open Systems The concept of a "stack" of protocols (hence Interconnection "TCP/IP stack" as in "This damn Microsoft TCP/IP stack is so broken...") is due to the OSI seven-layer model, even though TCP/IP has only about four distinct layers (certain layers are combined). See physical, data link, network, transport, session, presentation, and application layers (OSI model); network access, internet, transport, and application layers (TCP/IP stack).

136

Glosario de trminos Term outbound output owner package Deprecated Alternatives Comment

packet

Any data that are generated by a process. The account that has its UID number associated with a file. A set of related files and programs; especially a single archive file (tar, rpm) that contains them. A quantum of data transmitted over a network; specifically: a unit of TCP traffic carrying the information necessary to deliver itself, especially using the UDP protocol (datagram). Password Authentication Protocol Several bits at the same time, over time (over multiple wires). A variable with a specific value that has a meaning or function, which belongs to a program function or command; cf. argument. A process that started one or more other, socalled child processes. An arbitrary region of a storage device (almost always a hard drive) created by partitioning software before data were stored. Specifically on IBM PC-compatibles: one of up to four distinct areas on a hard drive which can be dedicated to different operating systems. One of the partition types, "extended", supports further "partitioning" into a maximum of four logical disks. To make a partition. A token which authenticates a user at login time.

PAP parallel parameter

parent process partition [1] (noun)

partition [2] (verb) password paste patch level path PC

Personal Computer

PCI peripheral

Peripheral Components Interface

A computer designed to be used by one individual at a time; specifically, one compatible with the architecture of the original IBM microcomputer. A PC bus to connect cards to the processor, replacing the original ISA bus. A device that is an optional attachment to the core components of a computer (CPU and memory).

permission

137

Glosario de trminos Term physical layer Deprecated Alternatives Comment The lowest layer of the seven-layer ISO/OSI network protocol stack. Consists of the cables, connectors and associated hardware such as driver chips to implement a network such as Ethernet or Token Ring. The corresponding layer of the TCP/IP protocol stack is also known as "hardware" or network access layer and has a wider scope. A numerical identifier used to track processes by the kernel. A technique whereby the CPU executes a tightly coded loop in which it copies data from a peripheral device's buffer memory and writes it back out to main memory; used with earlier versions of ATA, but replaced by DMA. A data structure which connects a file handle in one process to a file handle in another; by convention stdout of one process to stdin of the next. Established on the shell command line by the '|' symbol. picture element: a dot, a grid point on a computer display, the smallest entity that can be drawn on a computer display IP protocol over a parallel cable (between two machines physically connected and not too distant). Set of Python scripts to offer a web-interface to manage the LPI test objectives. See http://www.lpi.org/cgi-bin/poms.py. Protocol to retrieve mail from a mail server. See RFC1939 (POP3). Various software servers typically have names derived from 'pop' like ipop3d, ipop2d, and popper. The name given to an individual, numbered "slot" which is available to Internetworking software. For example, HTTP servers generally listen to port 80. See /etc/services ; also see ioport. To adapt a computer program to operate in a new computing environment and|or in a new programming language.

PID PIO

process ID Programmed I/O

pipe

pixel

PLIP

Parallel Line IP

PnP POMS

Plug and Play Program Objective Management System Post Office Protocol

POP

port [1] (noun)

port [2] (verb)

POSIX compliant

138

Glosario de trminos Term Postscript Deprecated Alternatives Comment A page Descripcin language developed and marketed by Adobe Inc. Widely implemented in laser printers, especially where high-quality output is required (e.g. photo typesetters) and, under Linux, widely emulated in software for non-Postcript printers. The PID of a process' parent process (cf. PID, parent , child process). A physical layer protocol (RFC1661) which can be used to encapsulate IP and other network protocols, making it an excellent way of extending LAN protocols to dial-in users. PPP comprises an HDLC-like framing protocol (RFC1662), a link control protocol, and a family of network control protocols, each of which corresponds to a network protocol which PPP can encapsulate. PPP can also use PAP or CHAP (RFC1994) for authentication. The sixth layer of the ISO/OSI seven-layer model, which specifies character representation (e.g. ASCII) and graphics formats, such as NAPLPS (North American Presentation Layer Protocols). In TCP/IP the , presentation layer is subsumed into the application layer, but perhaps the closest equivalent standards are ASN.1, ANSI and HTML/XML. A running program; an instance of program execution. The main component that makes a computer work; these days usually a "micro-processor" on a single silicon chip (cf. CPU) A sequence of instructions for the computer that implements an algorithm, especially when stored in a file in the form of either directly-executable object code, or source code for an interpreter or compiler. When loaded into memory and executed, the objectcode program typically becomes a process. An indication produced by a shell or application program that it is ready for further user commands or input. A definition of data structures and formats to be exchanged by two programs over a network.

PPID PPP

Parent Process ID Point-to-Point Protocol

presentation layer

priority process processor

program

prompt

protocol

139

Glosario de trminos Term proxy server Deprecated Alternatives Comment

queue

RAM

RARP

A computer process, usually as part of a firewall, that relays a protocol between client and server computer systems, by appearing to the client to be the server and appearing to the server to be the client (adapted from RFC2828). A data structure which implements a first-in, first-out list; e.g. print queue, which contains a list of jobs to be printed in order. Random Access Memory Volatile, writable memory that a computer uses as its main memory. Comes in flavors like EDO, ECC, SDRAM, etc. which are not equivalent but from the perspective of a sysadmin are very similar under normal use. cf. ROM. Reverse Address A low-level protocol which, given a hardware Resolution Protocol, rarp (Ethernet MAC) address on the local network, returns the corresponding IP address. cf. ARP .

read permission README

readme

Red Hat redundant

RedHat, RH

regular expression

repeater

An important document that usually comes with a software package to call attention to important issues; usually has its name in capitals, so that it appears at the top of a directory listing. A commercial Linux distribution. superfluous; said of information in the contexts of compression, or the preservation of data integrity. A formal expression of a string pattern which can be searched for and processed by a pattern-matching program such as vi, grep, awk or perl. A device that propagates signals between cables; in case of computer networks it operates at the first, physical layer within the ISO/OSI model, and does not do packet filtering or makes routing decisions. cf. hub, bridge, router.

resolution resource restore return RFC

Request For Comments

Despite the name, a "de facto" official specification of Internet protocols and standards. See http://www.rfc-editor.org/ or http://www.cis.ohiostate.edu/hypertext/information/rfc.html .

140

Glosario de trminos Term ROM Deprecated Alternatives Read Only Memory Comment Computer memory, usually involving some enduring medium like a silicon chip or a burnt laser disc which can be read but not altered; this is inconvenient when the data can change and, just to be confusing, some special ROMs can be modified under certain circumstances. cf. RAM. The administrative account (UID 0) on a *nix system that has all privileges; cf. superuser. The top-most or first or originating node or object (e.g.: root directory, "/"). The path across one or more networks from one host to another. To examine the destination network IP address in a datagram, and by consulting a table, direct the datagram to the next router along the path to the destination, or to the destination itself. A gateway which directs IP datagrams between networks in an internet; it operates at the third, network layer in the ISO/OSI model, and assumes that the address implies a particular path (the route) to reach the destination. In common usage today, a gateway is a general-purpose computer with a general-purpose operating system [e.g. Linux] which *may* be performing other functions; while a router is a special-purpose computer with a special purpose operating system [e.g. IOS], generally from a specialist supplier [e.g. Cisco]). cf. bridge. A system which eases installation, verification, upgrading, and uninstalling Linux packages. See the HOWTO for more information. To let it work (a program); cf. execute. Mode of operation of a Unix system, offering different services on each level; see /etc/inittab . A computer program that is written in an interpreted programming language, and therefore stays in human-readable text format; cf. executable, binary.

root [1] root [2] route [1] (noun) route [2] (verb)

router

RPC RPM

Remote Procedure Call Red Hat Package Management

run runlevel

run-level

scan script

141

Glosario de trminos Term SCSI Deprecated Comment Alternatives Small Computer Systems A multi-drop bus cable architecture Interface particularly suitable for both internal and external attachment of mass storage devices such as hard drives, tape drives and CDROMS. A (limited) length of cable - segments can be joined by repeaters (rare), bridges (common), routers or switches (which are hardware logic bridges and routers). One bit after another, over time (over a single wire). A process, or a host computer, which provides a particular service to client processes; e.g. web server, print server. A process which accepts requests and returns responses in an almost endless loop; a daemon. The fifth ISO/OSI layer is the session control layer. It establishes and controls systemdependent aspects of communications sessions between specific nodes in the network. It bridges the gap between the services provided by the transport layer and the logical functions running on the operating system in a participating node. In the TCP/IP network stack, there is no session control layer, and its functions are partially implemented in the transport layer and partially in the application layer. Set Group ID, sgid A program which mediates between the user and the operating system, typically accepting commands and invoking the corresponding programs. In the UNIX world, the term shell is conventionally applied to command-line driven interfaces with scripting capabilities, such as bash, csh and zsh; however, graphical shells exist, such as Windowmaker, KDE and GNOME. A logical interrupt to a process, which the process must generally deal with synchronously. A form of interprocess communications. single user mode, runlevel 1

sector segment

serial server

service

session layer

SGID shadow shell

shutdown signal

single mode

142

Glosario de trminos Term SLIP Deprecated Alternatives Serial Line IP Comment A way of encapsulating IP datagrams for transmission over asynchronous modem connections. See RFC1055, "A Non-Standard for Transmission of IP Datagrams over Serial Lines"; cf. PPP A Microsoft protocol developed to transport originally MS-DOS, later OS/2 and MSWindows, API calls and their arguments across a NetBIOS LAN; primarily used under Linux as a protocol for file and print sharing with Windows machines A conversational protocol used by mail servers for delivery of e-mail over the Internet. See RFC821. The relative amount of useful information in a signal, as compared to the noise it carries. A TCP application layer connection. computer programs The plain text (usually typed in by a human) specifying the detailed operation of a program, written in a programming language. It needs to be processed by a compiler to produce a program that can be run (executed) by the computer. The files containing the source code for a program or program system, from which the executable program or library can be built or ported to another computer platform. To create a child process by means of a fork() and an exec().

SMB

Server Message Block

SMTP

Simple Mail Transfer Protocol

SNMP SNR socket software source code

Signal-to-Noise-Ratio

SW

sources

spawn spooler static stderr stdin stdout sticky bit

The standard Unix error output device (by default to the terminal display). The standard Unix input device (by default the terminal keyboard). The standard Unix output device (by default the terminal display). A permission bit on an executable file which causes the kernel to keep the memory image of the process after it has terminated, in order to avoid the overhead of reloading it when it is re-invoked.

143

Glosario de trminos Term stream Deprecated Alternatives Comment A sequence of data bytes with sequencing and flow control. The TCP/IP stream protocol is TCP (Isn't there a System V stream concept as . well as the network protocol? Does Linux implement it?) A value used in configuring the TCP/IP stack which specifies which part of a 32-bit IP address is the network address and which part the host address. A permission bit for files in Unix-compatible filesystems which causes the resultant process (i.e., assuming the file is executable) to enjoy access rights to other resources based on the UID of the user who owns the file, rather than the user who created the process. The user of the root account. A commercial Linux distribution. virtual memory; called swap space because processes swap location between fast RAM and slow virtual memory if their priority changes. a two-state (on|off) input device In computer networks, a bridge or router that uses dedicated hardware to quickly shunt packets through the network. Symbolic link: in Unix filesystems, an entry in a directory that points to another file name in the filesystem; cf. hard link. To make the events in two separate sequences happen at the same time (used in communications). To make the content and state of data stored in two separate locations identical (e.g. cache, FTP sites). The formal rules which determine how keywords or commands and their components need to be combined when writing the source code of a computer program or forming shell commands. system administrator: a person who administers a computer system and keeps it working. A computer system; a term loosely used to refer to hardware and | or software: cf. operating system.

subnet mask

mask

SUID

Set User ID, suid

superuser SuSE swap space

super user, su, wheel S.u.S.E. swap

switch [1] switch [2]

symlink

soft link

synchronize [1] synchronize [2] syntax

sysadmin

sysadm

system

box

144

Glosario de trminos Term TCP Deprecated Alternatives Transmission Control Protocol Comment A session-oriented streaming transport protocol which provides sequencing, error detection and correction, flow control, congestion control and multiplexing; cf. UDP . See RFC793. A suite of protocols basic to Internet transmissions. The outlet of a computer, usually consisting of a display for output of text (or possibly graphics), and a keyboard (and possibly a mouse) for input, used as a device for interaction between the computer and a user. cf. workstation. to disconnect, end, finish, quit, stop, etc. A resistive load to indicate the end a chain of devices, usually a SCSI chain or a coax network chain. A series of characters that can be displayed on a terminal display or printed on paper for human reading. Set of Python scripts to offer a web-interface to manage the LPI test items. See http://www.lpi.org/cgi-bin/tips.py. A protocol like FTP but much simpler and even less secure; used mainly for cracking computers and booting diskless network clients. See RFC1350.

TCP/IP

terminal

Transmission Control Protocol / Internet Protocol tty

terminate terminator

text

TIPS

Test Item Processing System Trivial FTP

TFTP

third-party tools topology

transport layer

As used with computer networks: the schematic shape formed by the connections between the hosts. The transport layer is the central layer (#4) in the ISO/OSI seven-layer model. It provides end-to-end control of a communication session once the path has been established, allowing processes to exchange data reliably and sequentially, independent of which systems are communicating and their locations in the network. The transport layer in the TCP/IP stack is not defined in the same way; although TCP provides sequencing and error correction, UDP - which is also a transport layer protocol - does not have a session concept and is unreliable. The TCP/IP transport layer primarily provides multiplexing through the use of ports.

145

Glosario de trminos Term troubleshoot Deprecated Alternatives Comment The process of finding the reason(s) of the problem(s) with networking|programming| hardware. To make small changes to configuration in order to produce more efficient operation. A commercial Linux distribution.

tune TurboLinux

Pacific HighTech Linux, PHT UDP User Datagram Protocol A connection-less, unreliable, transport protocol which provides multiplexing and error detection for applications which require a low-cost protocol for one-shot transactions; cf. datagram, packet, TCP See RFC768. . UID User ID UN*X A term for any variant of the UNIX(R)(TM) operating system, including Linux and a large number of free and commercial systems; also *NIX. uninstall Remove hardware or software from a computer system. unload Remove services or software from a server so that more resources (CPU time, disk space, etc.) become available. unreliable In the TCP/IP sense of the term, a protocol which does not perform error correction (relying on "upper" layers to detect and correct errors, usually through retransmission). upgrade To update hardware or software to a better state. URL Universal Resource An identifier for an address on the Internet, Locator preceded by the name of the protocol that must be used to reach that address (e.g.: ftp://ftp.kernel.org/ ). USB Universal Serial Bus A recently developed bus standard for connecting peripheral devices in a chain. user [1] The person that is using the resources of a computer. user [2] A person's account or process; identification listed in /etc/passwd . user interface UI, GUI see interactive interface user mask mask UTC Coordinated Universal Official world time. Time, GMT, Greenwich Mean Time utility A program to help you to do a task easier.

146

Glosario de trminos Term Deprecated Comment Alternatives UTP Unshielded Twisted Pair Type of network cables with several parallel wires used for Ethernet. The network usually has a star topology with hubs and does not need terminators. variable length VLSM cf. CIDR subnet mask vendor A company that provides a service or a product. virtual Functionality provided without additional hardware|software, often without the user needing to realize this economy; e.g.: virtual memory, virtual console or virtual web server. virtual console virtual terminal, VT, VC virtual VM Extra memory available on a system that is memory stored on a hard disk and is therefore essentially unlimited, although much slower than genuine RAM. Usually it is called swap space. WAN Wide Area Network A network which links geographically widespread facilities (and often LANs at those locations) using point-to-point (leased line, SLIP PPP) or packet-switched network (X.25, , frame relay) links and which does not support the broadcast and direct connection capabilities of LANs. widget wildcard An placeholder used to represent any character or group of characters. window A region on a graphical desktop, the user interface for I/O with a child process of the desktop. win-modem A modem that only has a Digital Signal Processor and uses MS-Windows-specific software running on the CPU of the host computer to encode and decode data. WINS Windows Internet Name An automatic NetBIOS name database to Service resolve NetBIOS names to IP addresses. word A data type consisting of two or four (or a different number - you cannot tell) of bytes On i386 architectures, a word is four bytes (32 bits) in size. workspace Computer resources that are assigned to a computer user. workstation A computer, usually with a graphical display, for interactive use by an individual; cf. server. write permission

147

Glosario de trminos Term WWW X Deprecated Alternatives World Wide Web, (the) web X-Windows Comment Global distributed archive of HTML documents linked through HTTP . The X Window System: a graphical user interface originating at MIT and having several variations.

XML X-session X-terminal Yellow Pages

eXtensible Markup Language X-station YP cf. workstation See NIS

148

You might also like