rodriguez ivar tarea1

Upload: ivar-rodriguez

Post on 14-Oct-2015

52 views

Category:

Documents


0 download

TRANSCRIPT

  • 5/24/2018 Rodriguez Ivar Tarea1

    1/13

    Docente: Lic. Ramiro Gallardo PortandaAsignatura: Laboratorio de Telemtica (lab-273)Estudiante: Ivar Ral Rodrguez GuachallaC.I.: 6730419 L.P.

    1) Crear la siguiente estructura de subdirectorios debajo de /

    /$ pwd//$ sudo mkdir miraiz

    /$ cd miraiz/miraiz$ sudo mkdir uno

    /miraiz$ sudo mkdir dos/miraiz$ sudo mkdir tres

    /miraiz$ cd dos/miraiz/dos$ pwd

    /miraiz/dos/miraiz/dos$ sudo mkdir dir1 dir2

    /miraiz/dos$ cd ../miraiz$ cd ../$ tree miraiz

    miraiz

    dos dir1 dir2tresuno

    2) Crear los siguientes archivos usando el comando cat.

    El archivo CLIENTE.TXT debe estar en el directorio miraiz

  • 5/24/2018 Rodriguez Ivar Tarea1

    2/13

    Los archivos ZONES.TXT y ACTIV.TXT deben estar en el directorio dir1

    /$ sudo su

    [sudo] password for telematica:

    root@Lab-273:/# cd miraiz

    root@Lab-273:/miraiz# cat>CLIENTE.txt

    C200:Juan:Perez:UMSA:12345

    C300:Pedro:Navajas:98765

    C800:Maria:Bonifaz:10101

    C700:Teresa:Paco:65342

    ^Z

    [5]+ Detenido cat > CLIENTE.txt

    root@Lab-273:/miraiz# cat CLIENTE.txt

    C200:Juan:Perez:UMSA:12345

    C300:Pedro:Navajas:98765

    C800:Maria:Bonifaz:10101

    C700:Teresa:Paco:65342

    root@Lab-273:/miraiz# cd dos/dir1

    root@Lab-273:/miraiz/dos/dir1# cat>ZONAS.txt

    San Pedro

    Sopocachi

    Miraflores

    Irpavi

    ^Z

    [6]+ Detenido cat > ZONAS.txt

    root@Lab-273:/miraiz/dos/dir1# cat ZONAS.txt

    San Pedro

    Sopocachi

    Miraflores

    Irpavi

    root@Lab-273:/miraiz/dos/dir1# cat>ACTIV.txt

    C200:estudiante

    C300:profesor

    C700:informaticoC800:arquitecto

    ^Z

    [7]+ Detenido cat > ACTIV.txt

    root@Lab-273:/miraiz/dos/dir1# cat ACTIV.txt

    C200:estudiante

    C300:profesor

  • 5/24/2018 Rodriguez Ivar Tarea1

    3/13

    C700:informatico

    C800:arquitecto

    3.1) Copiar todos los archivos del directorio dir1 al directorio dir2.

    root@Lab-273:/miraiz/dos/dir1# cp * /miraiz/dos/dir2/root@Lab-273:/miraiz/dos/dir1# ls -l /miraiz/dos/dir2

    total 8-rw-r--r-- 1 root root 63 mar 1 16:41 ACTIV.txt

    -rw-r--r-- 1 root root 38 mar 1 16:41 ZONAS.txt

    3.2) En el directorio dir2 cambiar el nombre del archivo ZONES.TXT a zoo.txt.

    root@Lab-273:/miraiz/dos/dir1# cd ..

    root@Lab-273:/miraiz/dos# cd dir2

    root@Lab-273:/miraiz/dos/dir2# mv ZONAS.txt zoo.txt

    root@Lab-273:/miraiz/dos/dir2# ls -ltotal 8

    -rw-r--r-- 1 root root 63 mar 1 16:41 ACTIV.txt-rw-r--r-- 1 root root 38 mar 1 16:41 zoo.txt

    4.1. Mostrar el contenido de los archivos ZONES.TXT y ACTIV.TXT del directorio

    dir1.

    root@Lab-273:/miraiz/dos/dir2# cd ..root@Lab-273:/miraiz/dos# cd dir1root@Lab-273:/miraiz/dos/dir1# cat ZONAS.txt

    San PedroSopocachi

    Miraflores

    Irpavi

    root@Lab-273:/miraiz/dos/dir1# cat ACTIV.txt

    C200:estudianteC300:profesorC700:informatico

    C800:arquitecto

  • 5/24/2018 Rodriguez Ivar Tarea1

    4/13

    4.2. Mover todos los archivos con extensin txtdel directorio dir2 al directorio

    uno.

    root@Lab-273:/miraiz/dos/dir1# cd ..

    root@Lab-273:/miraiz/dos# cd dir2root@Lab-273:/miraiz/dos/dir2# mv *.txt /miraiz/uno

    root@Lab-273:/miraiz/dos/dir2# ls -l

    total 0root@Lab-273:/miraiz/dos/dir2# ls -l /miraiz/uno

    total 8

    -rw-r--r-- 1 root root 63 mar 1 16:41 ACTIV.txt

    -rw-r--r-- 1 root root 38 mar 1 16:41 zoo.txt

    5.1. Crear un nuevo archivo vacio (0 bytes) con el nombre zero.txt en el

    directorio uno.

    root@Lab-273:/miraiz/dos/dir2# touch /miraiz/uno/zero.txt

    root@Lab-273:/miraiz/dos/dir2# ls -l /miraiz/unototal 8-rw-r--r-- 1 root root 63 mar 1 16:41 ACTIV.txt

    -rw-r--r-- 1 root root 0 mar 1 17:03 zero.txt-rw-r--r-- 1 root root 38 mar 1 16:41 zoo.txt

    5.2. Ubicado en el directorio miraiz saque un listado en detalle de toda la

    estructura de archivos y directorios contenida.

    root@Lab-273:/miraiz/dos/dir2# ls -R /miraiz

    /miraiz:CLIENTE.txt dos tres uno

    /miraiz/dos:

    dir1 dir2

    /miraiz/dos/dir1:ACTIV.txt ZONAS.txt

    /miraiz/dos/dir2:

    /miraiz/tres:

    /miraiz/uno:

    ACTIV.txt zero.txt zoo.txt

  • 5/24/2018 Rodriguez Ivar Tarea1

    5/13

    6.1. Quitar los permisos de lectura al propietario y al grupo del archivo

    CLIENTE.TXT. Verifique la salida del comando.

    root@Lab-273:/miraiz/dos/dir2# ls -l /miraiz

    total 16-rw-r--r-- 1 root root 100 mar 1 16:23 CLIENTE.txt

    drwxr-xr-x 4 root root 4096 mar 1 15:20 dos

    drwxr-xr-x 2 root root 4096 mar 1 15:18 tresdrwxr-xr-x 2 root root 4096 mar 1 17:03 uno

    root@Lab-273:/miraiz/dos/dir2# chmod ug-r /miraiz/CLIENTE.txt

    root@Lab-273:/miraiz/dos/dir2# ls -l /miraiztotal 16

    --w----r-- 1 root root 100 mar 1 16:23 CLIENTE.txtdrwxr-xr-x 4 root root 4096 mar 1 15:20 dos

    drwxr-xr-x 2 root root 4096 mar 1 15:18 tresdrwxr-xr-x 2 root root 4096 mar 1 17:03 uno

    6.2. Cambie de propietario al archivo CLIENTE.TXT, el nuevo propietario ser

    root.

    chown -R root /miraiz/CLIENTE.txtroot@Lab-273:/miraiz/dos/dir2# ls -l /miraiztotal 16

    --w----r-- 1 root root 100 mar 1 16:23 CLIENTE.txtdrwxr-xr-x 4 root root 4096 mar 1 15:20 dos

    drwxr-xr-x 2 root root 4096 mar 1 15:18 tresdrwxr-xr-x 2 root root 4096 mar 1 17:03 uno

    7. Ejecutar los comandos shell apropiados, para que se muestre fondo negro de

    la pantalla con un primer plano de color verde.

    root@Lab-273:/miraiz/dos/dir2# tput setaf 2

    root@Lab-273:/miraiz/dos/dir2# tput setab 0

  • 5/24/2018 Rodriguez Ivar Tarea1

    6/13

    8. Abrir un documento de texto con el programa LibreOffice

    8.1. Utilizando comandos linux mostrar el proceso asociado a la ejecucin de

    este programa

    root@Lab-273:/miraiz/dos/dir2# ps -AF

    UID PID PPID C SZ RSS PSR STIME TTY TIME CMD

    root 1 0 0 916 1632 0 14:18 ? 00:00:02/sbin/initroot 2 0 0 0 0 0 14:18 ? 00:00:00[kthreadd]

    root 3 2 0 0 0 0 14:18 ? 00:00:00[ksoftirqd/0]

    root 5 2 0 0 0 0 14:18 ? 00:00:01[kworker/u:0]

    root 6 2 0 0 0 0 14:18 ? 00:00:00[migration/0]

    root 3982 3915 0 1361 280 0 16:27 pts/0 00:00:00 catpostfix 4087 1201 0 1149 1324 0 17:37 ? 00:00:00pickup -l -t fifo

    root 4143 2 0 0 0 0 17:59 ? 00:00:04[kworker/0:0]

    root 4144 2 0 0 0 0 18:04 ? 00:00:00[kworker/0:1]

    root 4152 2 0 0 0 0 18:05 ? 00:00:00[kworker/u:2]1000 4180 1 0 8921 3136 0 18:07 ? 00:00:00

    /usr/lib/libreoffi

    1000 4228 4180 1 53914 74392 0 18:08 ? 00:00:05/usr/lib/libreoffi

    root 4256 2 0 0 0 0 18:12 ? 00:00:00

    [kworker/0:2]root 4262 3915 0 1541 1168 0 18:15 pts/0 00:00:00 ps -

    AF

    8.2. Suprimir o matarel proceso sin salir del programa LibreOffice.

    8.2.

    root@Lab-273:/miraiz/dos/dir2# kill 4228

  • 5/24/2018 Rodriguez Ivar Tarea1

    7/13

    8.3. Mostrar que ya no existe el proceso asociado a la ejecucin de este

    programa.

    8.3root@Lab-273:/miraiz/dos/dir2# ps -AFUID PID PPID C SZ RSS PSR STIME TTY TIME CMDroot 1 0 0 916 1632 0 14:18 ? 00:00:02 /sbin/initroot 2 0 0 0 0 0 14:18 ? 00:00:00 [kthreadd]root 3 2 0 0 0 0 14:18 ? 00:00:00[ksoftirqd/0]root 5 2 0 0 0 0 14:18 ? 00:00:01[kworker/u:0]root 6 2 0 0 0 0 14:18 ? 00:00:00[migration/0]root 7 2 0 0 0 0 14:18 ? 00:00:02 [watchdog/0]root 8 2 0 0 0 0 14:18 ? 00:00:00 [cpuset]root 9 2 0 0 0 0 14:18 ? 00:00:00 [khelper]root 10 2 0 0 0 0 14:18 ? 00:00:00 [kdevtmpfs]root 11 2 0 0 0 0 14:18 ? 00:00:00 [netns]

    root 12 2 0 0 0 0 14:18 ? 00:00:00[sync_supers]root 13 2 0 0 0 0 14:18 ? 00:00:00 [bdi-default]root 14 2 0 0 0 0 14:18 ? 00:00:00[kintegrityd]root 15 2 0 0 0 0 14:18 ? 00:00:00 [kblockd]root 16 2 0 0 0 0 14:18 ? 00:00:00 [ata_sff]root 17 2 0 0 0 0 14:18 ? 00:00:00 [khubd]root 18 2 0 0 0 0 14:18 ? 00:00:00 [md]root 20 2 0 0 0 0 14:18 ? 00:00:00 [khungtaskd]root 21 2 0 0 0 0 14:18 ? 00:00:23 [kswapd0]

    root 22 2 0 0 0 0 14:18 ? 00:00:00 [ksmd]root 23 2 0 0 0 0 14:18 ? 00:00:00 [khugepaged]root 24 2 0 0 0 0 14:18 ? 00:00:00[fsnotify_mark]root 25 2 0 0 0 0 14:18 ? 00:00:00 [ecryptfs-kthrea]root 26 2 0 0 0 0 14:18 ? 00:00:00 [crypto]root 34 2 0 0 0 0 14:18 ? 00:00:00 [kthrotld]root 37 2 0 0 0 0 14:18 ? 00:00:00 [scsi_eh_0]root 38 2 0 0 0 0 14:18 ? 00:00:00 [scsi_eh_1]root 60 2 0 0 0 0 14:18 ? 00:00:00 [devfreq_wq]root 189 2 0 0 0 0 14:18 ? 00:00:00 [mpt_poll_0]

    root 190 2 0 0 0 0 14:18 ? 00:00:00 [mpt/0]root 200 2 0 0 0 0 14:18 ? 00:00:00 [scsi_eh_2]root 216 2 0 0 0 0 14:18 ? 00:00:01 [jbd2/sda2-8]root 217 2 0 0 0 0 14:18 ? 00:00:00 [ext4-dio-unwrit]root 415 1 0 708 568 0 14:18 ? 00:00:00 upstart-udev-bridg

  • 5/24/2018 Rodriguez Ivar Tarea1

    8/13

    root 419 1 0 813 768 0 14:18 ? 00:00:00 /sbin/udevd--daemroot 483 419 0 812 312 0 14:18 ? 00:00:00 /sbin/udevd--daemroot 484 419 0 812 484 0 14:18 ? 00:00:00 /sbin/udevd--daemroot 541 2 0 0 0 0 14:18 ? 00:00:00 [kpsmoused]root 584 2 0 0 0 0 14:18 ? 00:00:02 [jbd2/sda5-

    8]root 587 2 0 0 0 0 14:18 ? 00:00:00 [ext4-dio-unwrit]root 608 1 0 711 396 0 14:18 ? 00:00:00 upstart-socket-bri102 704 1 0 1025 1796 0 14:18 ? 00:00:00 dbus-daemon--systroot 727 1 0 1805 2000 0 14:18 ? 00:00:00/usr/sbin/modem-maroot 728 1 0 1185 1176 0 14:18 ? 00:00:00/usr/sbin/bluetootsyslog 747 1 0 7539 956 0 14:18 ? 00:00:01 rsyslogd -c5

    avahi 749 1 0 863 1288 0 14:18 ? 00:00:01 avahi-daemon: runnavahi 750 749 0 863 164 0 14:18 ? 00:00:00 avahi-daemon: chroroot 753 2 0 0 0 0 14:18 ? 00:00:00 [krfcommd]root 757 1 0 8162 3988 0 14:18 ? 00:00:01NetworkManagerroot 760 1 0 2768 2200 0 14:18 ? 00:00:00/usr/sbin/cupsd -Froot 773 1 0 6301 3484 0 14:18 ? 00:00:01/usr/lib/policykitroot 850 1 0 1157 712 0 14:18 tty4 00:00:00 /sbin/getty-8 384root 858 1 0 1157 712 0 14:18 tty5 00:00:00 /sbin/getty-8 384root 860 2 0 0 0 0 14:18 ? 00:00:01 [flush-8:0]root 873 757 0 731 1020 0 14:18 ? 00:00:00/sbin/dhclient -droot 876 1 0 1157 712 0 14:18 tty2 00:00:00 /sbin/getty-8 384root 877 1 0 1157 712 0 14:18 tty3 00:00:00 /sbin/getty-8 384root 885 1 0 1157 712 0 14:18 tty6 00:00:00 /sbin/getty-8 384root 901 1 0 752 748 0 14:18 ? 00:00:00/usr/sbin/dovecotroot 915 1 0 543 440 0 14:18 ? 00:00:00 acpid -c/etc/acpiroot 919 1 0 8253 2712 0 14:18 ? 00:00:00 lightdmroot 924 1 0 654 796 0 14:18 ? 00:00:00 cronwhoopsie 925 1 0 6473 3192 0 14:18 ? 00:00:00 whoopsiedaemon 935 1 0 617 220 0 14:18 ? 00:00:00 atd

  • 5/24/2018 Rodriguez Ivar Tarea1

    9/13

    mysql 936 1 0 79375 15116 0 14:18 ? 00:00:04/usr/sbin/mysqlddovecot 946 901 0 680 492 0 14:18 ? 00:00:00dovecot/anvilroot 949 901 0 679 512 0 14:18 ? 00:00:00 dovecot/logroot 968 919 3 27055 69576 0 14:18 tty7 00:09:19 /usr/bin/X:0 -autroot 997 2 0 0 0 0 14:18 ? 00:00:00 [ttm_swap]

    nobody 1024 757 0 1663 1124 0 14:18 ? 00:00:00/usr/sbin/dnsmasqroot 1100 1 0 3956 3400 0 14:18 ? 00:00:01/usr/lib/accountssroot 1124 1 0 7273 3416 0 14:18 ? 00:00:00/usr/sbin/console-root 1201 1 0 1144 1464 0 14:18 ? 00:00:00/usr/lib/postfix/mroot 1244 1 0 9488 5520 0 14:18 ? 00:00:01/usr/sbin/apache2www-data 1256 1244 0 9494 3896 0 14:18 ? 00:00:00/usr/sbin/apache2

    www-data 1257 1244 0 9494 3896 0 14:18 ? 00:00:00/usr/sbin/apache2www-data 1258 1244 0 9494 3896 0 14:18 ? 00:00:00/usr/sbin/apache2www-data 1263 1244 0 9494 3896 0 14:18 ? 00:00:00/usr/sbin/apache2www-data 1264 1244 0 9494 3896 0 14:18 ? 00:00:00/usr/sbin/apache2postfix 1374 1201 0 1161 1328 0 14:18 ? 00:00:00 qmgr -l -tfifo -uroot 1515 1 0 1157 832 0 14:18 tty1 00:00:00 /sbin/getty-8 384root 1598 919 0 0 0 0 14:18 ? 00:00:00 [lightd]root 1615 1 0 7105 3488 0 14:18 ? 00:00:00/usr/lib/upower/uprtkit 1667 1 0 5332 1216 0 14:18 ? 00:00:00/usr/lib/rtkit/rtkroot 1902 919 0 4114 2828 0 14:22 ? 00:00:00 lightdm --session-1000 1937 1 0 16914 3152 0 14:22 ? 00:00:00/usr/bin/gnome-key1000 1948 1902 0 12960 8536 0 14:22 ? 00:00:00 gnome-session --se1000 1983 1948 0 1019 208 0 14:22 ? 00:00:00/usr/bin/ssh-agent1000 1986 1 0 984 728 0 14:22 ? 00:00:00/usr/bin/dbus-laun1000 1987 1 0 1760 3196 0 14:22 ? 00:00:09 //bin/dbus-daemon1000 1999 1948 0 34504 14016 0 14:22 ? 00:00:06/usr/lib/gnome-set

  • 5/24/2018 Rodriguez Ivar Tarea1

    10/13

    1000 2006 1 0 2449 2288 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfs1000 2008 1 0 8433 2460 0 14:22 ? 00:00:00/usr/lib/gvfs//gvfcolord 2015 1 0 13074 5516 0 14:22 ? 00:00:00/usr/lib/i386-linu1000 2016 1948 0 54343 13904 0 14:22 ? 00:00:39 metacity1000 2027 1 0 2773 3200 0 14:22 ? 00:00:00

    /usr/lib/i386-linu1000 2031 1 0 25309 4532 0 14:22 ? 00:00:08/usr/bin/pulseaudi1000 2032 1948 0 28218 20244 0 14:22 ? 00:00:11 unity-2d-panel1000 2033 1948 0 96232 54700 0 14:22 ? 00:00:48 unity-2d-shell1000 2036 2031 0 3525 2352 0 14:22 ? 00:00:00/usr/lib/pulseaudi1000 2042 1948 0 10337 7460 0 14:22 ? 00:00:00/usr/lib/policykit1000 2043 1948 0 34528 10404 0 14:22 ? 00:00:00 bluetooth-

    applet1000 2044 1948 0 14422 7504 0 14:22 ? 00:00:00/usr/lib/gnome-set1000 2045 1948 0 53091 21192 0 14:22 ? 00:00:09 nautilus -n1000 2046 1948 0 59421 13396 0 14:22 ? 00:00:00 nm-applet1000 2048 1 0 12953 9296 0 14:22 ? 00:00:13/usr/lib/bamf/bamf1000 2066 1 0 2872 3208 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfsroot 2069 1 0 3988 3040 0 14:22 ? 00:00:00/usr/lib/udisks/udroot 2070 2069 0 1638 712 0 14:22 ? 00:00:00 udisks-daemon: not1000 2073 1 0 2607 2036 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfs1000 2075 1 0 5426 2056 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfs1000 2082 1 0 38009 17428 0 14:22 ? 00:00:06/usr/lib/unity/uni1000 2090 1 0 19019 5072 0 14:22 ? 00:00:00/usr/lib/indicator1000 2093 1 0 31763 5636 0 14:22 ? 00:00:00/usr/lib/indicator1000 2095 1 0 15348 8580 0 14:22 ? 00:00:00/usr/lib/indicator1000 2097 1 0 17964 5704 0 14:22 ? 00:00:00/usr/lib/indicator1000 2099 1 0 16706 5112 0 14:22 ? 00:00:00/usr/lib/indicator1000 2101 1 0 15130 4076 0 14:22 ? 00:00:00/usr/lib/indicator

  • 5/24/2018 Rodriguez Ivar Tarea1

    11/13

    1000 2106 1 0 8122 2428 0 14:22 ? 00:00:00/usr/lib/dconf/dco1000 2143 1 0 2589 2880 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfs1000 2144 1 0 1994 2296 0 14:22 ? 00:00:00/usr/lib/geoclue/g1000 2152 1 0 10260 5180 0 14:22 ? 00:00:00/usr/lib/ubuntu-ge

    1000 2158 1 0 2450 2360 0 14:22 ? 00:00:00/usr/lib/gvfs/gvfs1000 2181 1 0 15912 5268 0 14:22 ? 00:00:01/usr/lib/indicator1000 2191 1948 0 10782 7808 0 14:22 ? 00:00:00/usr/lib/gnome-dis1000 2199 1 0 19201 8312 0 14:22 ? 00:00:02/usr/lib/unity-len1000 2201 1 0 21414 5788 0 14:22 ? 00:00:01/usr/lib/unity-len1000 2204 1 0 21840 11932 0 14:22 ? 00:00:06/usr/bin/python /u

    1000 2207 1 0 19561 6472 0 14:22 ? 00:00:01/usr/lib/unity-len1000 2224 1 0 10732 4336 0 14:22 ? 00:00:01/usr/bin/zeitgeist1000 2239 1 0 12980 6664 0 14:22 ? 00:00:01/usr/lib/zeitgeist1000 2241 1 0 13086 5044 0 14:22 ? 00:00:01 zeitgeist-datahub1000 2243 2239 0 1361 280 0 14:22 ? 00:00:00 /bin/cat1000 2256 1 0 16909 3504 0 14:23 ? 00:00:00/usr/lib/unity-len1000 2276 1948 0 18764 8920 0 14:23 ? 00:00:00 telepathy-indicato1000 2282 1 0 10171 4424 0 14:23 ? 00:00:00/usr/lib/telepathy1000 2287 1 0 22801 6668 0 14:23 ? 00:00:00/usr/lib/gnome-onl1000 2293 1 0 25411 14892 0 14:23 ? 00:00:07/usr/bin/python /u1000 2307 1948 0 10567 9112 0 14:23 ? 00:00:05 gnome-screensaver1000 2314 1948 0 13413 9284 0 14:23 ? 00:00:00/usr/lib/evolution1000 2319 1 0 20795 7344 0 14:23 ? 00:00:00/usr/lib/evolution1000 2398 1948 0 15217 11420 0 14:23 ? 00:00:02 update-notifierroot 2416 1 0 4494 8064 0 14:23 ? 00:00:00/usr/bin/python /u1000 2420 1 0 54997 32828 0 14:23 ? 00:00:08/usr/bin/python /u

  • 5/24/2018 Rodriguez Ivar Tarea1

    12/13

    1000 2473 1948 0 10717 3512 0 14:24 ? 00:00:00/usr/lib/deja-dup/lp 2680 760 0 1556 924 0 14:28 ? 00:00:00/usr/lib/cups/noti1000 2938 1 0 37651 15260 0 15:12 ? 00:00:28 gnome-terminal1000 2947 2938 0 600 716 0 15:12 ? 00:00:00gnome/home/telema

    root 3957 3915 0 1361 284 0 16:17 pts/0 00:00:00 catroot 3960 3915 0 1361 280 0 16:18 pts/0 00:00:00 catroot 3963 3915 0 1361 280 0 16:19 pts/0 00:00:00 catroot 3969 3915 0 1361 280 0 16:22 pts/0 00:00:00 catroot 3980 3915 0 1361 280 0 16:25 pts/0 00:00:00 catroot 3982 3915 0 1361 280 0 16:27 pts/0 00:00:00 catpostfix 4087 1201 0 1149 1324 0 17:37 ? 00:00:00 pickup -l -tfiforoot 4152 2 0 0 0 0 18:05 ? 00:00:00[kworker/u:2]root 4256 2 0 0 0 0 18:12 ? 00:00:00[kworker/0:2]

    root 4269 2 0 0 0 0 18:17 ? 00:00:00[kworker/0:1]root 4272 2 0 0 0 0 18:22 ? 00:00:00[kworker/0:0]root 4273 3915 0 1541 1172 0 18:23 pts/0 00:00:00 ps -AF

    Usando las capacidades de programacin de la Shell, crear un script para

    (preguntas 9 a 10):

    9. Comparar dos nmeros introducidos por teclado y desplegar los respectivos

    mensajes.

    root@Lab-273:/# cd rootroot@Lab-273:~# cd /usr/local/bin

    root@Lab-273:/usr/local/bin# vim compara

    #!/bin/bash# Ivar Rodriguez

    echo "Introduzca un numero A:"

    read varAecho "Introduzca un numero B:"

    read varBif [ $varA = $varB ]; thenecho "Los numeros son IGUALES"

    elseecho "Los numeros son DISTINTOS"fi

    exit

  • 5/24/2018 Rodriguez Ivar Tarea1

    13/13

    root@Lab-273:/usr/local/bin# chmod +x compararoot@Lab-273:/usr/local/bin# compara

    Introduzca un numero A:8

    Introduzca un numero B:4

    Los numeros son DISTINTOSroot@Lab-273:/usr/local/bin# compara

    Introduzca un numero A:12

    Introduzca un numero B:

    12Los numeros son IGUALES