coreutils: Sorting the output
1
1 10.1.3 Sorting the output
1 -------------------------
1
1 These options change the order in which ‘ls’ sorts the information it
1 outputs. By default, sorting is done by character code (e.g., ASCII
1 order).
1
1 ‘-c’
1 ‘--time=ctime’
1 ‘--time=status’
1 If the long listing format (e.g., ‘-l’, ‘-o’) is being used, print
1 the status change timestamp (the ctime) instead of the mtime. When
1 explicitly sorting by time (‘--sort=time’ or ‘-t’) or when not
11 using a long listing format, sort according to the ctime. ⇒
File timestamps.
1
1 ‘-f’
1 Primarily, like ‘-U’—do not sort; list the files in whatever order
1 they are stored in the directory. But also enable ‘-a’ (list all
1 files) and disable ‘-l’, ‘--color’, and ‘-s’ (if they were
1 specified before the ‘-f’).
1
1 ‘-r’
1 ‘--reverse’
1 Reverse whatever the sorting method is—e.g., list files in reverse
1 alphabetical order, youngest first, smallest first, or whatever.
1
1 ‘-S’
1 ‘--sort=size’
1 Sort by file size, largest first.
1
1 ‘-t’
1 ‘--sort=time’
11 Sort by modification timestamp (mtime), newest first. ⇒File
timestamps.
1
1 ‘-u’
1 ‘--time=atime’
1 ‘--time=access’
1 ‘--time=use’
1 If the long listing format (e.g., ‘--format=long’) is being used,
1 print the last access timestamp (the atime). When explicitly
1 sorting by time (‘--sort=time’ or ‘-t’) or when not using a long
11 listing format, sort according to the atime. ⇒File
timestamps.
1
1 ‘-U’
1 ‘--sort=none’
1 Do not sort; list the files in whatever order they are stored in
1 the directory. (Do not do any of the other unrelated things that
1 ‘-f’ does.) This is especially useful when listing very large
1 directories, since not doing any sorting can be noticeably faster.
1
1 ‘-v’
1 ‘--sort=version’
1 Sort by version name and number, lowest first. It behaves like a
1 default sort, except that each sequence of decimal digits is
11 treated numerically as an index/version number. (⇒Details
about version sort.)
1
1 ‘-X’
1 ‘--sort=extension’
1 Sort directory contents alphabetically by file extension
1 (characters after the last ‘.’); files with no extension are sorted
1 first.
1