ls command

# ls -lh
total 104
-rw-r–r– 1 root wheel 793B Dec 7 2009 .cshrc
-rw-r–r– 1 root wheel 0B Jul 23 07:10 .first_time
-rw-r–r– 1 root wheel 0B Dec 7 2009 .hushlogin
-rw——- 1 root wheel 77B Aug 2 15:51 .lesshst
-rw-r–r– 1 root wheel 299B Dec 7 2009 .login
-rw-r–r– 1 root wheel 0B Jul 23 07:10 .part_mount
-rw-r–r– 1 root wheel 129B Dec 7 2009 .profile
-rw-r–r– 1 root wheel 129B Dec 7 2009 .shrc
-rw-r–r– 1 root wheel 1B Jul 23 07:10 .tcshrc
-rw-r–r– 1 root wheel 13K Nov 3 09:15 check_reload_status.log
-rw-r–r– 1 root wheel 77K Jul 30 07:17 packetcapture.cap

Já parou para pensar o que significa aquele total lá em cima, logo após a execução do comando ls -l ?
Certa vez você já deve ter escutado os antigos, falarem em “blocagem” pois é olha ela ai.
“..As with many of the utilities that deal with filenames, the output of ls for multiple files or in one of the long listing formats must be used carefully on systems where filenames can contain embedded white space. Systems and system administrators should institute policies and user training to limit the use of such filenames.

The number of disk blocks occupied by the file that it reports varies depending on underlying file system type, block size units reported and the method of calculating the number of blocks. On some file system types, the number is the actual number of blocks occupied by the file (counting indirect blocks and ignoring holes in the file); on others it is calculated based on the file size (usually making an allowance for indirect blocks, but ignoring holes). ..” http://opengroup.org/onlinepubs/007908775/xcu/ls.html

“… Normally the size is printed as a byte count without punctuation, but this can be overridden (*note Block size::). For example, `-h’ prints an abbreviated, human-readable count, and `–block-size=”‘1″‘ prints a byte count with the thousands separator of the current locale.
For each directory that is listed, preface the files with a line `total BLOCKS’, where BLOCKS is the total disk allocation for all files in that directory. The block size currently defaults to 1024 bytes, but this can be overridden (*note Block size::). The BLOCKS computed counts each hard link separately; this is arguably a deficiency. …” http://www.examplenow.com/info/ls

Mas se o interesse era mesmo somente listar os arquivos e tal. Você poderia ter utilizado também o
# find . -ls | more

Tags: , ,

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s


%d blogueiros gostam disto: