A modern replacement for ls.
freshl supports the greatest hits of ls options: -R, -S, -t, -r, and
-d.
Unlike ls, -S and -t put the largest/newest files at the bottom of the
output. Also unlike ls, you can use -r again to double-reverse: -rt will
output the oldest files last. -rr or -rrrr will have no effect, but you can
ls like a pirate.
-R skips gitignored and dotfile dirs by default. Like ripgrep, -u lifts
that one level at a time: -u descends into gitignored dirs, and -uu also
descends into dotfile dirs.
Symlinks are always followed: a row reads name → target (or
name → mid → target for multi-hop), with the final target in its natural
per-kind color. A broken link still shows the full chain up to the break, with
the unresolved target in red; its mode and size columns are dimmed, since they
describe the link itself rather than a resolved file.
Color output is configured with $LS_COLORS, compatible with GNU ls. Apart
from that, there are no display options. You get it my way.
- Integrated Git status.
- File modes are in octal, e.g.,
644instead ofrw-r--r--. - Timestamps are always UTC.
- Directories sort first. Since symlinks-to-directories are followed, they sort with their targets.
- On case-insensitive filesystems, such as APFS, sorting is case-insensitive.
There is also context-sensitive dimming to deemphasize less-useful information:
- File modes are dimmed if they are the default for your current
umask. - Owners are dimmed if they match the owner of the containing directory.
- Groups are dimmed if they are the primary group for that user.
- If a file size is 1 MB or more, the low-order digits are dimmed in groups of
six. For example, a file of size 14142135 would have only
14undimmed. - Timestamps are dimmed progressively with age, leaving undimmed the part that
best distinguishes them from now: the day and
HH:MM:SSat first, the day andHH:MMafter an hour, the month and day after 24 hours, and the full date after six months. Future timestamps are fully undimmed.
if which freshl >/dev/null; then
alias l='freshl'
else
alias l='ls -lA'
fi