Files in a directory window are listed in descending columns. They are always
sorted. This section tells how to control
the sorting mode.
The default sorting mode is to sort by file type, then alphabetically.
That is, all directories are listed first, then all regular files, then all symlinks.
Within each group, they are alphabetical.
X11 | MacOS | |
rotate sort order | altY | ^Y |
Sorting by modify time is handy because the files you most recently worked on tend
to float to the top-left, so you can find them easily. If you also color by age,
it looks nice, too.
You can choose which criteria to use by using preflags to the Sort command. Here
are some of the more useful ones (consult altU altI, or ^U ^I, in the program itself
for the latest list):
X11 | MacOS | |
AlphaNumerically | altN altY | ^N ^Y |
Alphabetically | altL altY | ^L ^Y |
Ascii sort order | altB altY | ^B ^Y |
Suffix | altX altY | ^X ^Y |
Modify time | altM altY | ^M ^Y |
Type | altP altY | ^P ^Y |
Size | altS altY | ^S ^Y |
There are three different alphabetical sort criteria. Alphabetical is a case-insensitive
sort. You can get the traditional Unix ls behavior by using ascii-sort
order.
AlphaNumerical
sorting treats strings of digits differently - the entire sequence of consecutive
digits is considered a number and is compared that way. This way, you don't have
10 coming before 9 (because 1 comes before 9), or 64 coming before 8 (because 6 comes
before 8). Periods, commas, plus and minus signs, and other punctuation are treated
as regular characters, therefore -2 comes after -1, and 4.03 comes after 4.2.
Sort by Suffix considers the suffix (sometimes called the extension) to be anything that follows the last period in the file's name. If there are no periods, the suffix is empty and sorts before all others. Therefore, daglue.tar.gz comes before daglue.html, and daglue comes before both of those. The sorting is case-insensitive.
You may have noticed, if you played around with it, that sorting by Type doesn't
always sort the same way within the types. That is, the Regular files may or may
not be sorted alphabetically. In fact, they are sorted by whatever the previous sort
criteria was: modify time, suffix, alphabetical, whatever.
In other words, if you want to sort by Suffix, and then by Modify Time, you would
type altM altY altX altY. Think of it as a deck of cards: if you sort them by number,
and then sort them into Red and Black piles, each red and black pile will still
be sorted by number.
A faster way is to combine them in the same command - but remember to reverse
the order. That is:
altM altY altX altY | = | altX altM altY |
sort by time, sort by suffix | = | sort by suffix, and then within that, time |
Let's say you then choose Modify Time sorting. Again, the new sort order heavily
dominates, although, if two files have a date within the same second, the Ascii spelling
sort order will then take effect among files modified within the same second.
This table shows which sort criteria are equivocal, and how equivocal.
criteria | how | |
Often Equivocal | P tyPe X suffiX |
all dirs grouped, all regulars grouped files with same suffix |
Rarely Equivocal | L aLphabetical N alphaNumerical M, H, A times S size |
A=a (not equivocal on case insensitive volumes) J3=J03 granularity of one second files of same size |
Never Equivocal | B ascii | files never have the same name |
Documentation >
Directory Window >
Sorting