Hacking with ls options ( -S -1 -r)

GNU Command

$> a1.txt
$a > a2.txt
bash: a: command not found
$echo a > a2.txt
$ls -S
a2.txt	a1.txt
$ls -S -1
a2.txt
a1.txt
$ls -r -S -1
a1.txt
a2.txt
$

UNIX Explanation


 -S     sort by file size
-1     list one file per line
-r, --reverse
              reverse order while sorting


computer science Theory Drop

Sorting is any  process of arranging items in  some sequence and/or
in different sets, and accordingly, it has two common, yet distinct
meanings:  ordering:  arranging  items  of the  same  kind,  class,
nature, etc.  in some ordered sequence,  categorizing: grouping and
labeling items with similar properties together (by sorts).

source : http://en.wikipedia.org/wiki/Sorting

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s