Published using Google Docs
introducao
Updated automatically every 5 minutes

Introdução

O comando ls na prática

ls -r

ls com curinga

ls --color

ls -a

ls -A

ls -m

ls -n

ls -R

ls -p

ls -F

ls -i

ls -l

ls -lh

ls -o

sl

dir

vdir

Introdução

O comando ls na prática

ls -r

# ls /boot/

abi-4.4.0-31-generic     config-4.4.0-45-generic      initrd.img-4.4.0-45-generic  vmlinuz-4.4.0-31-generic

abi-4.4.0-45-generic     grub                         System.map-4.4.0-31-generic  vmlinuz-4.4.0-45-generic

config-4.4.0-31-generic  initrd.img-4.4.0-31-generic  System.map-4.4.0-45-generic

# ls /boot/ -r

vmlinuz-4.4.0-45-generic     System.map-4.4.0-31-generic  grub                     abi-4.4.0-45-generic

vmlinuz-4.4.0-31-generic     initrd.img-4.4.0-45-generic  config-4.4.0-45-generic  abi-4.4.0-31-generic

System.map-4.4.0-45-generic  initrd.img-4.4.0-31-generic  config-4.4.0-31-generic

ls com curinga

$ ls

postinst.d  postrm.d

$ ls *

postinst.d:

initramfs-tools  pm-utils  zz-update-grub

postrm.d:

initramfs-tools  zz-update-grub

# ls /var/log/

alternatives.log  auth.log       btmp          dmesg     faillog  installer  lastlog  syslog               wtmp

apt               bootstrap.log  dist-upgrade  dpkg.log  fsck     kern.log   lxd      unattended-upgrades

# ls /var/log/*.log

/var/log/alternatives.log  /var/log/auth.log  /var/log/bootstrap.log  /var/log/dpkg.log  /var/log/kern.log

$ ls *lembrete.jpg*

lembrete.jpg

ls --color

$ ls --color

bin   dev  home        lib    lost+found  mnt  proc  run   selinux  sys  usr  vmlinuz

boot  etc  initrd.img  lib64  media       opt  root  sbin  srv      tmp  var

ls -a

ls -A

ls -m

# ls -m

bin, boot, dev, etc, home, initrd.img, initrd.img.old, lib, lib64, lost+found, media, mnt, opt, proc, root, run, sbin, snap, srv, sys, tmp, usr,

var, vmlinuz, vmlinuz.old

ls -n

# ls -n /

total 88

drwxr-xr-x   2 0 0  4096 Out 22 18:58 bin

drwxr-xr-x   3 0 0  4096 Out 25 21:35 boot

drwxr-xr-x  19 0 0  4240 Out 26 13:09 dev

drwxr-xr-x  89 0 0  4096 Out 26 16:13 etc

drwxr-xr-x   3 0 0  4096 Out 26 16:13 home

lrwxrwxrwx   1 0 0    32 Out 25 21:34 initrd.img -> boot/initrd.img-4.4.0-45-generic

lrwxrwxrwx   1 0 0    32 Out 22 18:39 initrd.img.old -> boot/initrd.img-4.4.0-31-generic

drwxr-xr-x  22 0 0  4096 Out 22 18:57 lib

drwxr-xr-x   2 0 0  4096 Out 25 21:37 lib64

drwx------   2 0 0 16384 Out 22 18:38 lost+found

drwxr-xr-x   3 0 0  4096 Out 22 18:38 media

drwxr-xr-x   2 0 0  4096 Jul 19 17:43 mnt

drwxr-xr-x   2 0 0  4096 Jul 19 17:43 opt

dr-xr-xr-x 133 0 0     0 Out 26 13:09 proc

drwx------   7 0 0  4096 Out 26 16:05 root

drwxr-xr-x  22 0 0   840 Out 26 13:10 run

drwxr-xr-x   2 0 0 12288 Out 25 21:37 sbin

drwxr-xr-x   2 0 0  4096 Jun 29 17:13 snap

drwxr-xr-x   2 0 0  4096 Jul 19 17:43 srv

dr-xr-xr-x  13 0 0     0 Out 26 16:11 sys

drwxrwxrwt   8 0 0  4096 Out 26 15:17 tmp

drwxr-xr-x  10 0 0  4096 Out 22 18:38 usr

drwxr-xr-x  13 0 0  4096 Out 22 18:48 var

lrwxrwxrwx   1 0 0    29 Out 25 21:34 vmlinuz -> boot/vmlinuz-4.4.0-45-generic

lrwxrwxrwx   1 0 0    29 Out 22 18:39 vmlinuz.old -> boot/vmlinuz-4.4.0-31-generic

ls -R

ls -p

# ls -p

bin/   dev/  home/       initrd.img.old  lib64/       media/  opt/   root/  sbin/  srv/  tmp/  var/     vmlinuz.old

boot/  etc/  initrd.img  lib/  

ls -F

/$ ls -F

bin/   dev/  home/        lib/    lost+found/  mnt/  proc/  run/   srv/  tmp/  var/

boot/  etc/  initrd.img@  lib64/  media/       opt/  root/  sbin/  sys/  usr/  vmlinuz@

ls -i

# touch arquivo1

# touch arquivo2

# touch arquivo3

# ls -li

total 0

524401 -rw-r--r-- 1 root root 0 Out 26 16:26 arquivo1

524417 -rw-r--r-- 1 root root 0 Out 26 16:26 arquivo2

524431 -rw-r--r-- 1 root root 0 Out 26 16:26 arquivo3

ls -l

# ls -l

total 88

drwxr-xr-x   2 root root  4096 Out 22 18:58 bin

drwxr-xr-x   3 root root  4096 Out 25 21:35 boot

drwxr-xr-x  19 root root  4240 Out 26 13:09 dev

drwxr-xr-x  89 root root  4096 Out 26 16:13 etc

drwxr-xr-x   3 root root  4096 Out 26 16:13 home

lrwxrwxrwx   1 root root    32 Out 25 21:34 initrd.img -> boot/initrd.img-4.4.0-45-generic

lrwxrwxrwx   1 root root    32 Out 22 18:39 initrd.img.old -> boot/initrd.img-4.4.0-31-generic

drwxr-xr-x  22 root root  4096 Out 22 18:57 lib

drwxr-xr-x   2 root root  4096 Out 25 21:37 lib64

drwx------   2 root root 16384 Out 22 18:38 lost+found

drwxr-xr-x   3 root root  4096 Out 22 18:38 media

drwxr-xr-x   2 root root  4096 Jul 19 17:43 mnt

drwxr-xr-x   2 root root  4096 Jul 19 17:43 opt

dr-xr-xr-x 133 root root     0 Out 26 13:09 proc

drwx------   3 root root  4096 Out 26 16:20 root

drwxr-xr-x  22 root root   840 Out 26 13:10 run

drwxr-xr-x   2 root root 12288 Out 25 21:37 sbin

drwxr-xr-x   2 root root  4096 Jun 29 17:13 snap

drwxr-xr-x   2 root root  4096 Jul 19 17:43 srv

dr-xr-xr-x  13 root root     0 Out 26 16:11 sys

drwxrwxrwt   8 root root  4096 Out 26 16:17 tmp

drwxr-xr-x  10 root root  4096 Out 22 18:38 usr

drwxr-xr-x  13 root root  4096 Out 22 18:48 var

lrwxrwxrwx   1 root root    29 Out 25 21:34 vmlinuz -> boot/vmlinuz-4.4.0-45-generic

lrwxrwxrwx   1 root root    29 Out 22 18:39 vmlinuz.old -> boot/vmlinuz-4.4.0-31-generic

ls -lh

# ls -lh

total 88K

drwxr-xr-x   2 root root 4,0K Out 22 18:58 bin

drwxr-xr-x   3 root root 4,0K Out 25 21:35 boot

drwxr-xr-x  19 root root 4,2K Out 26 13:09 dev

drwxr-xr-x  89 root root 4,0K Out 26 16:13 etc

drwxr-xr-x   3 root root 4,0K Out 26 16:13 home

lrwxrwxrwx   1 root root   32 Out 25 21:34 initrd.img -> boot/initrd.img-4.4.0-45-generic

lrwxrwxrwx   1 root root   32 Out 22 18:39 initrd.img.old -> boot/initrd.img-4.4.0-31-generic

drwxr-xr-x  22 root root 4,0K Out 22 18:57 lib

drwxr-xr-x   2 root root 4,0K Out 25 21:37 lib64

drwx------   2 root root  16K Out 22 18:38 lost+found

drwxr-xr-x   3 root root 4,0K Out 22 18:38 media

drwxr-xr-x   2 root root 4,0K Jul 19 17:43 mnt

drwxr-xr-x   2 root root 4,0K Jul 19 17:43 opt

dr-xr-xr-x 133 root root    0 Out 26 13:09 proc

drwx------   3 root root 4,0K Out 26 16:20 root

drwxr-xr-x  22 root root  840 Out 26 13:10 run

drwxr-xr-x   2 root root  12K Out 25 21:37 sbin

drwxr-xr-x   2 root root 4,0K Jun 29 17:13 snap

drwxr-xr-x   2 root root 4,0K Jul 19 17:43 srv

dr-xr-xr-x  13 root root    0 Out 26 16:11 sys

drwxrwxrwt   8 root root 4,0K Out 26 16:17 tmp

drwxr-xr-x  10 root root 4,0K Out 22 18:38 usr

drwxr-xr-x  13 root root 4,0K Out 22 18:48 var

lrwxrwxrwx   1 root root   29 Out 25 21:34 vmlinuz -> boot/vmlinuz-4.4.0-45-generic

lrwxrwxrwx   1 root root   29 Out 22 18:39 vmlinuz.old -> boot/vmlinuz-4.4.0-31-generic

ls -o

# ls -lho

total 88K

drwxr-xr-x   2 root 4,0K Out 22 18:58 bin

drwxr-xr-x   3 root 4,0K Out 25 21:35 boot

drwxr-xr-x  19 root 4,2K Out 26 13:09 dev

drwxr-xr-x  89 root 4,0K Out 26 16:13 etc

drwxr-xr-x   3 root 4,0K Out 26 16:13 home

lrwxrwxrwx   1 root   32 Out 25 21:34 initrd.img -> boot/initrd.img-4.4.0-45-generic

lrwxrwxrwx   1 root   32 Out 22 18:39 initrd.img.old -> boot/initrd.img-4.4.0-31-generic

drwxr-xr-x  22 root 4,0K Out 22 18:57 lib

drwxr-xr-x   2 root 4,0K Out 25 21:37 lib64

drwx------   2 root  16K Out 22 18:38 lost+found

drwxr-xr-x   3 root 4,0K Out 22 18:38 media

drwxr-xr-x   2 root 4,0K Jul 19 17:43 mnt

drwxr-xr-x   2 root 4,0K Jul 19 17:43 opt

dr-xr-xr-x 133 root    0 Out 26 13:09 proc

drwx------   3 root 4,0K Out 26 16:20 root

drwxr-xr-x  22 root  840 Out 26 13:10 run

drwxr-xr-x   2 root  12K Out 25 21:37 sbin

drwxr-xr-x   2 root 4,0K Jun 29 17:13 snap

drwxr-xr-x   2 root 4,0K Jul 19 17:43 srv

dr-xr-xr-x  13 root    0 Out 26 16:11 sys

drwxrwxrwt   8 root 4,0K Out 26 16:17 tmp

drwxr-xr-x  10 root 4,0K Out 22 18:38 usr

drwxr-xr-x  13 root 4,0K Out 22 18:48 var

lrwxrwxrwx   1 root   29 Out 25 21:34 vmlinuz -> boot/vmlinuz-4.4.0-45-generic

lrwxrwxrwx   1 root   29 Out 22 18:39 vmlinuz.old -> boot/vmlinuz-4.4.0-31-generic

sl

Captura de tela - 18-05-2015 - 16:10:31.png

dir

# dir

bin   dev  home        initrd.img.old  lib64           media  opt        root  sbin  srv  tmp  var      vmlinuz.old

boot  etc  initrd.img  lib               lost+found  mnt          proc        run   snap  sys  usr  vmlinuz

vdir

$ vdir

total 172576

drwxr-xr-x 2 carlinha carlinha      4096 Ago 10 20:52 Área\ de\ trabalho

-rw-r--r-- 1 carlinha carlinha   5543842 Abr 22 09:49 Aula\ de\ ingles\ Basico\ #1\ -XbL9_FDaVYU.mp3

-rw-r--r-- 1 carlinha carlinha     20252 Ago 18 16:29 cobit.odt

drwxr-xr-x 2 carlinha carlinha      4096 Mai  6 15:36 Documentos

drwxr-xr-x 3 carlinha carlinha      4096 Ago 24 19:05 Downloads

-rw-r----- 1 carlinha carlinha     59731 Mai 10 01:03 e07b0ed6a4044530b1aeab0d5b636a45.jpg

-rw-r--r-- 1 carlinha carlinha 171045149 Abr 23 11:04 Gayatri\ Mantra\ -\ 2\ hs\ 57\ minutos\ 05\ seg-noXZRyPbb4o.mp3

drwxr-xr-x 6 carlinha carlinha      4096 Ago 24 14:25 Imagens

drwxr-xr-x 2 carlinha carlinha      4096 Mai  6 15:36 Modelos

drwxr-xr-x 3 carlinha carlinha      4096 Ago 21 11:34 Música

drwxr-xr-x 2 carlinha carlinha      4096 Mai  6 15:36 Público

drwxr-xr-x 2 carlinha carlinha      4096 Jul 23 13:43 Vídeos