Sei sulla pagina 1di 15

Introduccin En este documento se describen algunos comandos bsicos para manipular el sistema operativo Ubuntu por medio de su terminal,

algunos comandos bsicos como para hacer una consulta en la terminal no es necesario estar como sper usuario basta con un usuario normal para su ejecucin del comando, pero cuando requiere de modificaciones del sistema operativo necesita estar como sper usuario para as dar los permisos a los comandos. El usuario normal se identifica por el signo de $, y el supe usuario por el smbolo #.

COMANDOS BASICOS DE LINUX

figuras

figuras

2.- ls - lista el contenido de un directorio 3.- cd - sirve para cambiar el directorio. Sintaxis- cd nombre-delarchivo

1.- info se utiliza para mostrar la documentacin en lnea de comandos

4.- pwd -muestra el nombre del archivo complete del directorio de trabajo actual.

Sintaxis- pwd nombre-archivo

5.- man que es la palabra abreviatura de manual, proporciona informacin sobre el comando solicitado o permisos a los usuarios buscando comandos relacionados con una palabra clave.

6.- mkdir se usa para crear uno o ms directorios.

7.- rmdir se utiliza para eliminar un directorio y sus subdirectorios.


Ejemplo- rmdir nuevo-directorio

Sintaxis- mkdir nuevo-directorio

8.- touch cambia la fecha de un archivo.

9.- cat concatena archivos y los muestra en la salida estndar.

Sintaxis- touch directorio

Sintaxis- cat archivo

10.- more muestra informacin de un documento.

11.- file te dice si el objeto que ves es un archivo o directorio.

Sintaxis- - more archivo

Sintaxis- file archivo

12.- mv el la abreviatura de mover, se usa para mover renombrar un archivo de un directorio a otro. mv es distinto del cp ya que remueve por completo el archivo y el cp copia el contenido de un archivo. Sintaxis- mv fuente destino

13.- cp copia archivos de un lugar a otro

Sintaxis- cp fuente destino

14.- rm se usa para eliminar archivos de un directorio. Sintaxis- rm archivo

15.- pico abren un editor de texto.


Sintaxis- pico nuevo-archivo

16.- sort se usa para ordenar las lneas en un archivo de texto (-r ordena en orden inverso). Sintaxis- sort nombre-del-archivo

17.- last se usa para mostrar las listas de los ltimos usuarios conectados

18.- diffse usa para mostrar las diferencia que hay entre dos archivos. Sintaxis- diff archivo archivo2

19.- ifconfig se usa para mostrar informacin sobre la interfaz de la red.

21.- idse usa para mostrar el id del usuario 20.- netstatse usa para mostrar informacin esttica y estado actual de conexin de red.

23.- clear- borra pantalla

22.- passwd- cambiar la contrasea del usuario

24- du- reporta el tamao del directorio

25- df- muestra el espacio en disco

26.- uptime muestra la hora, tiempo de funcionamiento y nmero de usuarios conectas.

27.- uname muestra el sistema unix sobre el que estamos trabajando.

28.- free muestra informacin sobre la memoria libre y usada por el sistema.

29.- egrep se utiliza para buscar y encontrar en uno o ms archivos que coincidan con la cadena dada

30.- ps se utiliza para obtener informacin del estado de procesos

31.- top muestra informacin detallada sobre los procesos en cursos. top - 10:58:00 up 1:37, 1 user, load average: 0.00, 0.04, 0.05 Tasks: 130 total, 1 running, 129 sleeping, 0 stopped, 0 zombie Cpu(s): 14.6%us, 3.6%sy, 0.0%ni, 81.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1025656k total, 608376k used, 417280k free, 58244k buffers Swap: 1046524k total, 0k used, 1046524k free, 260180k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 943 root 20 0 99804 54m 7136 S 11.6 5.5 0:34.64 Xorg 2753 sanchez 20 0 73428 14m 10m S 5.6 1.4 0:01.34 gnome-terminal

32.- chmod te permite alterar o cambiar los derechos de accesos a archivos y directorios. # 1 2 3 4 5 6 7 Permiso de acceso Solo ejecucin Solo escritura Escritura y ejecucin Solo lectura Lectura y ejecucin Escritura y lectura Todos los permisos

drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Public drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Templates drwxrwxr-x 2 sanchez sanchez 4096 2013-02-17 10:35 Ubuntu One drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Videos root@ubuntu:/home/sanchez# chmod 777 nuevo root@ubuntu:/home/sanchez# ls -l total 48 drwxr-xr-x 2 sanchez sanchez 4096 2013-02-27 11:01 Desktop drw-r--r-- 3 sanchez sanchez 4096 2013-02-26 20:35 Documents drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Downloads drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Public drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Templates drwxrwxr-x 2 sanchez sanchez 4096 2013-02-17 10:35 Ubuntu One drwxr-xr-x 2 sanchez sanchez 4096 2013-02-17 10:32 Videos root@ubuntu:/home/sanchez#

33.- gzip - comprime archivos utilizando la extensin .gz gzip - Comprime archivos a .gz r gzip - Descomprime un archivo .gz d gzip - Muestra el contenido de un fichero c .gz

34.- groupadd se usaa para crear un anueva cuenta de grupo. Ejemplo .- groupadd nombre-del-grupo
root@ubuntu:/# groupadd sistemas root@ubuntu:/# more /etc/group root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4:sanchez tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: uucp:x:10: man:x:12: sanchez:x:1000: sambashare:x:124:sanchez estudiantes:x:1001: sistemas:x:1002: root@ubuntu:/# gzip -c lista2

35.- groupmod se usaa para modificar un 36.- groupdel se usaa para eliminar grupo grupos. Ejemplo.groupmod nuevo-nombre sanchez@ubuntu:~$ sudo su root nombre-antiguo [sudo] password for sanchez: root@ubuntu:/home/sanchez# cd .. root@ubuntu:/home# cd .. root@ubuntu:/# groupmod -n taller root@ubuntu:/# groupdel taller sistemas root@ubuntu:/# more /etc/group root@ubuntu:/# more /etc/group root:x:0: root:x:0: sambashare:x:124:sanchez daemon:x:1: estudiantes:x:1001: utempter:x:121: rtkit:x:122: saned:x:123: sanchez:x:1000: sambashare:x:124:sanchez estudiantes:x:1001: taller:x:1002: root@ubuntu:/#

37.- useradd aade un nuevo usuario al sistema Linux , con el nombre del usuario especifico. Cuando se crea un nuevo usuario se crea en los archivos /etc /passwd. /etc /group y /etc /shadow Ejemplo useradd [opcin] nombre-del-usuario -d Especifica el directorio inicial del usuario -s Especifica el Shell del usuario -g Especifica el grupo primario del usuario -e Especifica la fecha de expiracin del usuario

38.- userdel elimina usuarios Ejemplo userdel [opcion]usuario -r.- para borrar el contenido de su carpeta home
root@ubuntu:/home/sanchez# userdel villegas root@ubuntu:/home/sanchez# more /etc/passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bi n/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/syn c games:x:5:60:games:/usr/games:/bi n/sh root@ubuntu:/home/sanchez# root@ubuntu:/home/sanchez# ls -l villegas ls: cannot access villegas: No such file or directory root@ubuntu:/home/sanchez#

root@ubuntu:/# useradd invitado root@ubuntu:/# more /etc/passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin: /bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games: /bin/sh hplip:x:112:7:HPLIP system user,,,: /var/run/hplip:/bin/false saned:x:113:123::/home/saned: /bin/false sanchez:x:1000:1000:Esteban,,,: /home/sanchez:/bin/bash invitado:x:1001:1002::/home /invitado:/bin/sh root@ubuntu:/# root@ubuntu:/#

39.- whereis busca un ejecutable. Su cdigo 40.- vmstat. nos permite obtener un detalle fuente y su pgina man. Sintaxis.- whereis nombre-del-ejecutable especifico de los procesos.
root@ubuntu:/home/sanchez# whereis ls ls: /bin/ls /usr/share/man/man1/ls.1.gz root@ubuntu:/home/sanchez# whereis man man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man7/man.7.gz /usr/share/man/man1/man.1.gz root@ubuntu:/home/sanchez# whereis Documents/ : /usr/src/linux-headers-3.0.0-12/. /usr/src/linux-headers-3.0.0-12generic/. /usr/src/linux-headers3.0.0-12-generic/.config /usr/src/linux-headers-3.0.0-12generic/.tmp_versions /bin/. /usr/bin/. /sbin/. /usr/sbin/. /etc/. /lib/. /usr/lib root@ubuntu:/home/sanchez# whereis ls ls: /bin/ls /usr/share/man/man1/ls.1.gz root@ubuntu:/home/sanchez# whereis man man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man7/man.7.gz /usr/share/man/man1/man.1.gz root@ubuntu:/home/sanchez# whereis Documents/ : /usr/src/linux-headers-3.0.0-12/. /usr/src/linux-headers-3.0.0-12generic/. /usr/src/linux-headers3.0.0-12-generic/.config /usr/src/linux-headers-3.0.0-12generic/.tmp_versions /bin/. /usr/bin/. /sbin/. /usr/sbin/. /etc/. /lib/. /usr/lib

41.- apt-get install. comando que nos 42.- cal. despliega un calendario permite instalar paquetes. Sintaxis.- apt-get install paquete-instalar
root@ubuntu:/home/sanchez# tree The program 'tree' is currently not installed. You can install it by typing: apt-get install tree root@ubuntu:/home/sanchez# apt-get install tree Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 460 not upgraded. Need to get 27.6 kB of archives. After this operation, 98.3 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! tree

Install these packages without verification [y/N]? y Get:1 http://us.archive.ubuntu.com/ubuntu / oneiric/universe tree i386 1.5.32 [27.6 kB] Fetched 27.6 kB in 0s (42.2 kB/s) Selecting previously deselected package tree. (Reading database ... 125619 files and directories currently installed.) Unpacking tree (from .../archives/tree_1.5.3-2_i386.deb) ... Processing triggers for man-db ... Setting up tree (1.5.3-2) ... root@ubuntu:/home/sanchez#

43.-dir. muestra el contenido de cierto directorio. sanchez@ubuntu:~$ dir Desktop Downloads examples.desktop nuevo Public Ubuntu\ One Documents ejemplo3 Music Pictures Templates Videos sanchez@ubuntu:~$ ^C sanchez@ubuntu:~$

44.- mount.- Muestra un listado de los dispositivos montados sanchez@ubuntu:~$ mount /dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755 ) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880 ) none on /run/shm type tmpfs (rw,nosuid,nodev) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/sanchez/.gvfs type fuse.gvfsfuse-daemon (rw,nosuid,nodev,user=sanchez)

45.- whereis.- Busca la ruta donde se 46.-lsusb Muestra dispositivos conectados

encuntra el programa
sanchez@ubuntu:~$ whereis tree tree: /usr/bin/tree /usr/share/man/man1/tree.1.gz sanchez@ubuntu:~$ ^C sanchez@ubuntu:~$ whereis Documents/ : /usr/src/linux-headers-3.0.0-12/. /usr/src/linux-headers-3.0.0-12generic/. /usr/src/linux-headers3.0.0-12-generic/.config /usr/src/linux-headers-3.0.0-12-ge

por bus USB


sanchez@ubuntu:~$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse

48.-lshw.....Utilidad que extrae informacin 47.- cat /proc/meminfo...Informacin sobre sobre la configuracin del hardware de la la memoria. mquina sanchez@ubuntu:~$ cat /proc/meminfo version: 02 MemTotal: 1025656 kB width: 32 bits MemFree: 195640 kB clock: 33MHz Buffers: 46928 kB capabilities: pci Cached: 411064 kB subtractive_decode bus_master SwapCached: 0 kB cap_list Active: 481188 kB resources: Inactive: 301412 kB ioport:2000(size=8192) Active(anon): 325296 kB memory:c9000000-ca3fffff Inactive(anon): 7152 kB ioport:d8400000(size=6291456) Active(file): 155892 kB *-usb:0 Inactive(file): 294260 kB description: USB Unevictable: 0 kB Controller product: USB1.1 UHCI Controller vendor: VMware physical id: 0 bus info: pci@0000:02:00.0 version: 00 width: 32 bits clock: 33MHz capabilities: uhci bus_master configuration: driver=uhci_hcd latency=64 resources: irq:18 ioport:20c0(size=32) *-network description: Ethernet interface product: 79c970 [PCnet32 LANCE]

vendor: Hynix Semiconductor (Hyundai Electronics) physical id: 1 bus info: pci@0000:02:01.0 logical name: eth0 version: 10 serial: 00:0c:29:ec:53:13 width: 32 bits clock: 33MHz capabilities: bus_master rom ethernet physical logical configuration: broadcast=yes driver=pcnet32 driverversion=1.35 ip=192.168.147.133 latency=64 link=yes maxlatency=255 mingnt=6

49.- date.............Muestra la hora y la fecha en formato completo root@ubuntu:/home/sanchez# date Wed Feb 27 22:49:55 PST 2013 root@ubuntu:/home/sanchez#

50.- dpkg -r paquete.- desinstala un programa root@ubuntu:/home/sanchez# dpkg -r tree (Reading database ... 125624 files and directories currently installed.) Removing tree ... Processing triggers for man-db ... root@ubuntu:/home/sanchez#

Conclusin Una vez concluida mis prcticas de los comando de Linux en la terminal de sistema operativo Ubuntu me ha servido de mucho para poder as realizar diversas funciones por medio de su terminal, me ha quedado una motivacin de seguir practicando estos comandos y otros ms. Para as tener un conocimiento amplio del sistema.

Potrebbero piacerti anche