You are on page 1of 13

Docente: Lic.

Ramiro Gallardo Portanda


Asignatura: Laboratorio de Telemtica (lab-273)
Estudiante: Ivar Ral Rodrguez Guachalla
C.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

dir2
tres
uno
2) Crear los siguientes archivos usando el comando cat.

El archivo CLIENTE.TXT debe estar en el directorio miraiz

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:informatico
C800:arquitecto
^Z
[7]+ Detenido
cat > ACTIV.txt
root@Lab-273:/miraiz/dos/dir1# cat ACTIV.txt
C200:estudiante
C300:profesor

C700:informatico
C800:arquitecto

3.1) Copiar todos los archivos del directorio dir1 al directorio dir2.
root@Lab-273:/miraiz/dos/dir1#
root@Lab-273:/miraiz/dos/dir1#
total 8
-rw-r--r-- 1 root root 63 mar
-rw-r--r-- 1 root root 38 mar

cp * /miraiz/dos/dir2/
ls -l /miraiz/dos/dir2
1 16:41 ACTIV.txt
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 -l
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

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 dir1
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:informatico
C800:arquitecto

4.2. Mover todos los archivos con extensin txt del directorio dir2 al directorio
uno.
root@Lab-273:/miraiz/dos/dir1# cd ..
root@Lab-273:/miraiz/dos# cd dir2
root@Lab-273:/miraiz/dos/dir2# mv *.txt /miraiz/uno
root@Lab-273:/miraiz/dos/dir2# ls -l
total 0
root@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#
root@Lab-273:/miraiz/dos/dir2#
total 8
-rw-r--r-- 1 root root 63 mar
-rw-r--r-- 1 root root 0 mar
-rw-r--r-- 1 root root 38 mar

touch /miraiz/uno/zero.txt
ls -l /miraiz/uno
1 16:41 ACTIV.txt
1 17:03 zero.txt
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

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 tres
drwxr-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 /miraiz
total 16
--w----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 tres
drwxr-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.txt
root@Lab-273:/miraiz/dos/dir2# ls -l /miraiz
total 16
--w----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 tres
drwxr-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

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
root
1
0 0
916 1632
0
/sbin/init
root
2
0 0
0
0
0
[kthreadd]
root
3
2 0
0
0
0
[ksoftirqd/0]
root
5
2 0
0
0
0
[kworker/u:0]
root
6
2 0
0
0
0
[migration/0]
root
3982 3915
postfix
4087 1201
pickup -l -t fifo
root
4143
2
[kworker/0:0]
root
4144
2
[kworker/0:1]
root
4152
2
[kworker/u:2]
1000
4180
1
/usr/lib/libreoffi
1000
4228 4180
/usr/lib/libreoffi
root
4256
2
[kworker/0:2]
root
4262 3915
AF

0
0

1361
1149

280
1324

STIME TTY
14:18 ?

TIME CMD
00:00:02

14:18 ?

00:00:00

14:18 ?

00:00:00

14:18 ?

00:00:01

14:18 ?

00:00:00

0 16:27 pts/0
0 17:37 ?

00:00:00 cat
00:00:00

0 17:59 ?

00:00:04

0 18:04 ?

00:00:00

0 18:05 ?

00:00:00

8921

3136

0 18:07 ?

00:00:00

1 53914 74392

0 18:08 ?

00:00:05

0 18:12 ?

00:00:00

1541

1168

0 18:15 pts/0

00:00:00 ps -

8.2. Suprimir o matar el proceso sin salir del programa LibreOffice.


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

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


programa.
8.3
root@Lab-273:/miraiz/dos/dir2# ps -AF
UID
PID PPID C
SZ
RSS PSR
root
1
0 0
916 1632
0
root
2
0 0
0
0
0
root
3
2 0
0
0
0
[ksoftirqd/0]
root
5
2 0
0
0
0
[kworker/u:0]
root
6
2 0
0
0
0
[migration/0]
root
7
2 0
0
0
0
root
8
2 0
0
0
0
root
9
2 0
0
0
0
root
10
2 0
0
0
0
root
11
2 0
0
0
0
root
12
2 0
0
0
0
[sync_supers]
root
13
2 0
0
0
0
default]
root
14
2 0
0
0
0
[kintegrityd]
root
15
2 0
0
0
0
root
16
2 0
0
0
0
root
17
2 0
0
0
0
root
18
2 0
0
0
0
root
20
2 0
0
0
0
root
21
2 0
0
0
0
root
22
2 0
0
0
0
root
23
2 0
0
0
0
root
24
2 0
0
0
0
[fsnotify_mark]
root
25
2 0
0
0
0
kthrea]
root
26
2 0
0
0
0
root
34
2 0
0
0
0
root
37
2 0
0
0
0
root
38
2 0
0
0
0
root
60
2 0
0
0
0
root
189
2 0
0
0
0
root
190
2 0
0
0
0
root
200
2 0
0
0
0
root
216
2 0
0
0
0
8]
root
217
2 0
0
0
0
unwrit]
root
415
1 0
708
568
0
udev-bridg

STIME
14:18
14:18
14:18

TTY
?
?
?

TIME CMD
00:00:02 /sbin/init
00:00:00 [kthreadd]
00:00:00

14:18 ?

00:00:01

14:18 ?

00:00:00

14:18
14:18
14:18
14:18
14:18
14:18

00:00:02
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00

?
?
?
?
?
?

[watchdog/0]
[cpuset]
[khelper]
[kdevtmpfs]
[netns]

14:18 ?

00:00:00 [bdi-

14:18 ?

00:00:00

14:18
14:18
14:18
14:18
14:18
14:18
14:18
14:18
14:18

00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:23
00:00:00
00:00:00
00:00:00

?
?
?
?
?
?
?
?
?

[kblockd]
[ata_sff]
[khubd]
[md]
[khungtaskd]
[kswapd0]
[ksmd]
[khugepaged]

14:18 ?

00:00:00 [ecryptfs-

14:18
14:18
14:18
14:18
14:18
14:18
14:18
14:18
14:18

00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:01

?
?
?
?
?
?
?
?
?

[crypto]
[kthrotld]
[scsi_eh_0]
[scsi_eh_1]
[devfreq_wq]
[mpt_poll_0]
[mpt/0]
[scsi_eh_2]
[jbd2/sda2-

14:18 ?

00:00:00 [ext4-dio-

14:18 ?

00:00:00 upstart-

root
419
1
--daem
root
483
419
--daem
root
484
419
--daem
root
541
2
root
584
2
8]
root
587
2
unwrit]
root
608
1
socket-bri
102
704
1
--syst
root
727
1
/usr/sbin/modem-ma
root
728
1
/usr/sbin/bluetoot
syslog
747
1
avahi
749
1
daemon: runn
avahi
750
749
daemon: chro
root
753
2
root
757
1
NetworkManager
root
760
1
/usr/sbin/cupsd -F
root
773
1
/usr/lib/policykit
root
850
1
-8 384
root
858
1
-8 384
root
860
2
root
873
757
/sbin/dhclient -d
root
876
1
-8 384
root
877
1
-8 384
root
885
1
-8 384
root
901
1
/usr/sbin/dovecot
root
915
1
/etc/acpi
root
919
1
root
924
1
whoopsie
925
1
daemon
935
1

813

768

0 14:18 ?

00:00:00 /sbin/udevd

812

312

0 14:18 ?

00:00:00 /sbin/udevd

812

484

0 14:18 ?

00:00:00 /sbin/udevd

0
0

0
0

0
0

0 14:18 ?
0 14:18 ?

00:00:00 [kpsmoused]
00:00:02 [jbd2/sda5-

0 14:18 ?

00:00:00 [ext4-dio-

711

396

0 14:18 ?

00:00:00 upstart-

1025

1796

0 14:18 ?

00:00:00 dbus-daemon

1805

2000

0 14:18 ?

00:00:00

1185

1176

0 14:18 ?

00:00:00

0
0

7539
863

956
1288

0 14:18 ?
0 14:18 ?

00:00:01 rsyslogd -c5


00:00:01 avahi-

863

164

0 14:18 ?

00:00:00 avahi-

0
0

0
8162

0
3988

0 14:18 ?
0 14:18 ?

00:00:00 [krfcommd]
00:00:01

2768

2200

0 14:18 ?

00:00:00

6301

3484

0 14:18 ?

00:00:01

1157

712

0 14:18 tty4

00:00:00 /sbin/getty

1157

712

0 14:18 tty5

00:00:00 /sbin/getty

0
0

0
731

0
1020

0 14:18 ?
0 14:18 ?

00:00:01 [flush-8:0]
00:00:00

1157

712

0 14:18 tty2

00:00:00 /sbin/getty

1157

712

0 14:18 tty3

00:00:00 /sbin/getty

1157

712

0 14:18 tty6

00:00:00 /sbin/getty

752

748

0 14:18 ?

00:00:00

543

440

0 14:18 ?

00:00:00 acpid -c

0
0
0
0

8253
654
6473
617

2712
796
3192
220

0
0
0
0

00:00:00
00:00:00
00:00:00
00:00:00

14:18
14:18
14:18
14:18

?
?
?
?

lightdm
cron
whoopsie
atd

mysql
936
1
/usr/sbin/mysqld
dovecot
946
901
dovecot/anvil
root
949
901
root
968
919
:0 -aut
root
997
2
nobody
1024
757
/usr/sbin/dnsmasq
root
1100
1
/usr/lib/accountss
root
1124
1
/usr/sbin/consoleroot
1201
1
/usr/lib/postfix/m
root
1244
1
/usr/sbin/apache2
www-data 1256 1244
/usr/sbin/apache2
www-data 1257 1244
/usr/sbin/apache2
www-data 1258 1244
/usr/sbin/apache2
www-data 1263 1244
/usr/sbin/apache2
www-data 1264 1244
/usr/sbin/apache2
postfix
1374 1201
fifo -u
root
1515
1
-8 384
root
1598
919
<defunct>
root
1615
1
/usr/lib/upower/up
rtkit
1667
1
/usr/lib/rtkit/rtk
root
1902
919
session1000
1937
1
/usr/bin/gnome-key
1000
1948 1902
session --se
1000
1983 1948
/usr/bin/ssh-agent
1000
1986
1
/usr/bin/dbus-laun
1000
1987
1
daemon
1000
1999 1948
/usr/lib/gnome-set

0 79375 15116

0 14:18 ?

00:00:04

0 14:18 ?

00:00:00

0
679
512
3 27055 69576

0 14:18 ?
0 14:18 tty7

00:00:00 dovecot/log
00:09:19 /usr/bin/X

0
0

0
1663

0
1124

0 14:18 ?
0 14:18 ?

00:00:00 [ttm_swap]
00:00:00

3956

3400

0 14:18 ?

00:00:01

7273

3416

0 14:18 ?

00:00:00

1144

1464

0 14:18 ?

00:00:00

9488

5520

0 14:18 ?

00:00:01

9494

3896

0 14:18 ?

00:00:00

9494

3896

0 14:18 ?

00:00:00

9494

3896

0 14:18 ?

00:00:00

9494

3896

0 14:18 ?

00:00:00

9494

3896

0 14:18 ?

00:00:00

1161

1328

0 14:18 ?

00:00:00 qmgr -l -t

1157

832

0 14:18 tty1

00:00:00 /sbin/getty

0 14:18 ?

00:00:00 [lightd]

7105

3488

0 14:18 ?

00:00:00

5332

1216

0 14:18 ?

00:00:00

4114

2828

0 14:22 ?

00:00:00 lightdm --

0 16914

3152

0 14:22 ?

00:00:00

0 12960

8536

0 14:22 ?

00:00:00 gnome-

680

492

1019

208

0 14:22 ?

00:00:00

984

728

0 14:22 ?

00:00:00

1760

3196

0 14:22 ?

00:00:09 //bin/dbus-

0 34504 14016

0 14:22 ?

00:00:06

1000
2006
1
/usr/lib/gvfs/gvfs
1000
2008
1
/usr/lib/gvfs//gvf
colord
2015
1
/usr/lib/i386-linu
1000
2016 1948
1000
2027
1
/usr/lib/i386-linu
1000
2031
1
/usr/bin/pulseaudi
1000
2032 1948
panel
1000
2033 1948
shell
1000
2036 2031
/usr/lib/pulseaudi
1000
2042 1948
/usr/lib/policykit
1000
2043 1948
applet
1000
2044 1948
/usr/lib/gnome-set
1000
2045 1948
1000
2046 1948
1000
2048
1
/usr/lib/bamf/bamf
1000
2066
1
/usr/lib/gvfs/gvfs
root
2069
1
/usr/lib/udisks/ud
root
2070 2069
daemon: not
1000
2073
1
/usr/lib/gvfs/gvfs
1000
2075
1
/usr/lib/gvfs/gvfs
1000
2082
1
/usr/lib/unity/uni
1000
2090
1
/usr/lib/indicator
1000
2093
1
/usr/lib/indicator
1000
2095
1
/usr/lib/indicator
1000
2097
1
/usr/lib/indicator
1000
2099
1
/usr/lib/indicator
1000
2101
1
/usr/lib/indicator

2449

2288

0 14:22 ?

00:00:00

8433

2460

0 14:22 ?

00:00:00

0 13074

5516

0 14:22 ?

00:00:00

0 54343 13904
0 2773 3200

0 14:22 ?
0 14:22 ?

00:00:39 metacity
00:00:00

0 25309

4532

0 14:22 ?

00:00:08

0 28218 20244

0 14:22 ?

00:00:11 unity-2d-

0 96232 54700

0 14:22 ?

00:00:48 unity-2d-

3525

2352

0 14:22 ?

00:00:00

0 10337

7460

0 14:22 ?

00:00:00

0 34528 10404

0 14:22 ?

00:00:00 bluetooth-

0 14422

7504

0 14:22 ?

00:00:00

0 53091 21192
0 59421 13396
0 12953 9296

0 14:22 ?
0 14:22 ?
0 14:22 ?

00:00:09 nautilus -n
00:00:00 nm-applet
00:00:13

2872

3208

0 14:22 ?

00:00:00

3988

3040

0 14:22 ?

00:00:00

1638

712

0 14:22 ?

00:00:00 udisks-

2607

2036

0 14:22 ?

00:00:00

5426

2056

0 14:22 ?

00:00:00

0 38009 17428

0 14:22 ?

00:00:06

0 19019

5072

0 14:22 ?

00:00:00

0 31763

5636

0 14:22 ?

00:00:00

0 15348

8580

0 14:22 ?

00:00:00

0 17964

5704

0 14:22 ?

00:00:00

0 16706

5112

0 14:22 ?

00:00:00

0 15130

4076

0 14:22 ?

00:00:00

1000
2106
1
/usr/lib/dconf/dco
1000
2143
1
/usr/lib/gvfs/gvfs
1000
2144
1
/usr/lib/geoclue/g
1000
2152
1
/usr/lib/ubuntu-ge
1000
2158
1
/usr/lib/gvfs/gvfs
1000
2181
1
/usr/lib/indicator
1000
2191 1948
/usr/lib/gnome-dis
1000
2199
1
/usr/lib/unity-len
1000
2201
1
/usr/lib/unity-len
1000
2204
1
/usr/bin/python /u
1000
2207
1
/usr/lib/unity-len
1000
2224
1
/usr/bin/zeitgeist
1000
2239
1
/usr/lib/zeitgeist
1000
2241
1
datahub
1000
2243 2239
1000
2256
1
/usr/lib/unity-len
1000
2276 1948
indicato
1000
2282
1
/usr/lib/telepathy
1000
2287
1
/usr/lib/gnome-onl
1000
2293
1
/usr/bin/python /u
1000
2307 1948
screensaver
1000
2314 1948
/usr/lib/evolution
1000
2319
1
/usr/lib/evolution
1000
2398 1948
notifier
root
2416
1
/usr/bin/python /u
1000
2420
1
/usr/bin/python /u

8122

2428

0 14:22 ?

00:00:00

2589

2880

0 14:22 ?

00:00:00

1994

2296

0 14:22 ?

00:00:00

0 10260

5180

0 14:22 ?

00:00:00

2450

2360

0 14:22 ?

00:00:00

0 15912

5268

0 14:22 ?

00:00:01

0 10782

7808

0 14:22 ?

00:00:00

0 19201

8312

0 14:22 ?

00:00:02

0 21414

5788

0 14:22 ?

00:00:01

0 21840 11932

0 14:22 ?

00:00:06

0 19561

6472

0 14:22 ?

00:00:01

0 10732

4336

0 14:22 ?

00:00:01

0 12980

6664

0 14:22 ?

00:00:01

0 13086

5044

0 14:22 ?

00:00:01 zeitgeist-

0 1361
0 16909

280
3504

0 14:22 ?
0 14:23 ?

00:00:00 /bin/cat
00:00:00

0 18764

8920

0 14:23 ?

00:00:00 telepathy-

0 10171

4424

0 14:23 ?

00:00:00

0 22801

6668

0 14:23 ?

00:00:00

0 25411 14892

0 14:23 ?

00:00:07

0 10567

9112

0 14:23 ?

00:00:05 gnome-

0 13413

9284

0 14:23 ?

00:00:00

0 20795

7344

0 14:23 ?

00:00:00

0 15217 11420

0 14:23 ?

00:00:02 update-

8064

0 14:23 ?

00:00:00

0 54997 32828

0 14:23 ?

00:00:08

4494

1000
2473 1948
/usr/lib/deja-dup/
lp
2680
760
/usr/lib/cups/noti
1000
2938
1
terminal
1000
2947 2938
gnome/home/telema
root
3957 3915
root
3960 3915
root
3963 3915
root
3969 3915
root
3980 3915
root
3982 3915
postfix
4087 1201
fifo
root
4152
2
[kworker/u:2]
root
4256
2
[kworker/0:2]
root
4269
2
[kworker/0:1]
root
4272
2
[kworker/0:0]
root
4273 3915

0 10717

3512

0 14:24 ?

00:00:00

924

0 14:28 ?

00:00:00

0 37651 15260

0 15:12 ?

00:00:28 gnome-

600

716

0 15:12 ?

00:00:00

0
0
0
0
0
0
0

1361
1361
1361
1361
1361
1361
1149

284
280
280
280
280
280
1324

0
0
0
0
0
0
0

00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00
00:00:00

0 18:05 ?

00:00:00

0 18:12 ?

00:00:00

0 18:17 ?

00:00:00

0 18:22 ?

00:00:00

1541

1172

0 18:23 pts/0

00:00:00 ps -AF

1556

16:17
16:18
16:19
16:22
16:25
16:27
17:37

pts/0
pts/0
pts/0
pts/0
pts/0
pts/0
?

cat
cat
cat
cat
cat
cat
pickup -l -t

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 root
root@Lab-273:~# cd /usr/local/bin
root@Lab-273:/usr/local/bin# vim compara
#!/bin/bash
# Ivar Rodriguez
echo "Introduzca un numero A:"
read varA
echo "Introduzca un numero B:"
read varB
if [ $varA = $varB ]; then
echo "Los numeros son IGUALES"
else
echo "Los numeros son DISTINTOS"
fi
exit

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


root@Lab-273:/usr/local/bin# compara
Introduzca un numero A:
8
Introduzca un numero B:
4
Los numeros son DISTINTOS
root@Lab-273:/usr/local/bin# compara
Introduzca un numero A:
12
Introduzca un numero B:
12
Los numeros son IGUALES

You might also like