Category Archives: II —:::— Cocoa

ls ( –sort option)

UNIX Command

$pwd
/home/jeffrin/shelter/symmel
$ls
beautifulwork  bugs-general  debian-howtos  firewall  language	ovlfose
books	       config-files  Docs	    https:    linux	README
$ls --sort=none
Docs   https:	      language	ovlfose       firewall	    README
books  debian-howtos  linux	bugs-general  config-files  beautifulwork
$ls --sort=time
firewall  Docs	  config-files	 beautifulwork	bugs-general  ovlfose
language  https:  debian-howtos  books		linux	      README
$ls --sort=size
beautifulwork  bugs-general  debian-howtos  firewall  language	ovlfose
books	       config-files  Docs	    https:    linux	README
$ls --sort=extension
beautifulwork  bugs-general  debian-howtos  firewall  language	ovlfose
books	       config-files  Docs	    https:    linux	README
$ls --sort=version
Docs	beautifulwork  bugs-general  debian-howtos  https:    linux
README	books	       config-files  firewall	    language  ovlfose
$


UNIX Explanation

--sort=WORD            sort by WORD instead of name: none -U,
                             extension -X, size -S, time -t, version -v


Theory Drop Related

Names of some sorting algorithms :

Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
Bucket sort
Radix sort
Distribution sort
Timsort

CONNECTION

name of sorting algorithms which is knowledge related to sorting

ls ( –block-size option )

UNIX Command

$ls
info  man
$ls -l
total 8
drwxr-xr-x 2 jeffrin jeffrin 4096 Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 4096 Nov 22 18:51 man
$ls -l --block-size=B
ls: invalid --block-size argument `B'
$ls -l --block-size=KB
total 9kB
drwxr-xr-x 2 jeffrin jeffrin 5kB Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 5kB Nov 22 18:51 man
$ls -l --block-size=M
total 1M
drwxr-xr-x 2 jeffrin jeffrin 1M Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 1M Nov 22 18:51 man
$ls -l --block-size=MB
total 1MB
drwxr-xr-x 2 jeffrin jeffrin 1MB Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 1MB Nov 22 18:51 man
$ls -l --block-size=T
total 1T
drwxr-xr-x 2 jeffrin jeffrin 1T Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 1T Nov 22 18:51 man
$ls -l --block-size=K
total 8K
drwxr-xr-x 2 jeffrin jeffrin 4K Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 4K Nov 22 18:51 man
$ls
info  man
$ls -l
total 8
drwxr-xr-x 2 jeffrin jeffrin 4096 Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 4096 Nov 22 18:51 man
$ls -l --block-size=10MB
total 1
drwxr-xr-x 2 jeffrin jeffrin 1 Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 1 Nov 22 18:51 man
$ls -l --block-size=5MB
total 1
drwxr-xr-x 2 jeffrin jeffrin 1 Nov 22 20:39 info
drwxr-xr-x 3 jeffrin jeffrin 1 Nov 22 18:51 man
$ls -l --block-size=5 MB
ls: cannot access MB: No such file or directory
$ls -l --block-size=MB 5
ls: cannot access 5: No such file or directory
$

UNIX Explanation

 --block-size=SIZE
              scale sizes by SIZE before printing them.  E.g., `--block-size=M' prints sizes  in  units  of
              1,048,576 bytes. 
SIZE  may  be  (or  may  be an integer optionally followed by) one of following: KB 1000, K 1024, MB
       1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Theory Drop

In computing  (specifically data transmission and  data storage), a
block is  a sequence of bytes  or bits, having a  nominal length (a
block  size). Data  thus structured  are  said to  be blocked.  The
process of putting data into blocks is called blocking. Blocking is
used to facilitate the handling  of the data-stream by the computer
program receiving the  data. Blocked data is normally  read a whole
block  at a  time.  Blocking is  almost  universally employed  when
storing data  to 9-track magnetic  tape, to rotating media  such as
floppy disks, hard disks, optical discs and to NAND flash memory.

source : http://en.wikipedia.org/wiki/Block_(data_storage)

CONNECTION

The option --block-size in the command is related to data storage(block)