monroewalker 3 days ago

Other than colorization, what are people getting out of ls replacements like this? I've recently started using ranger which might replace my ls usage for the most part since it not only shows everything in the directory but has vim like shortcuts for filtering, sorting, and searching the directory as well as previewing files and entering other directories

2
dhruvkb 2 days ago

Hi, author of `pls`[1] here. `pls` goes above and beyond what is typically possible with `ls` without going so far as to become an entire TUI file explorer like Broot[2].

Among a few things it does that `ls` (and other alternatives like `eza` don't do) are: - icons (SVG icons in terminals that support it, Nerd Fonts otherwise) - advanced filtering using regex - advanced sorting across multiple sort bases - styles and colors using customisable rules

For someone wanting to make the output of `ls` prettier (with a few extra bells and whistles) without having to relearn a new workflow, something like an `ls` replacement makes more sense.

[1]: https://pls.cli.rs [2]: https://dystroy.org/broot/

pmarreck 2 days ago

pls looks useful and I will retain it but eza is giving more icons for more things via (this is my alias for `l`, basically)

`eza --long --hyperlink --header --all --icons --git --sort name`

also the hyperlink thing is useful

Symbiote 2 days ago

ls does colored output. I'm surprised it's not the default for you.

cb321 2 days ago

If you run `dircolors --print-database|less` you will see that GNU ls only highlights/colors the path/filenames according to a simplistic scheme where a file can only resolve to one type even though on many terminals today "foreground overlays background overlays bold/italic/etc". (https://github.com/c-blake/lc#vector-typemulti-dimensionalit... has a more advanced idea.)

This tool by triyanox -- just from the screen shot if you click through -- will also colorize permission masks and sizes, dates, user & group.

Symbiote 2 days ago

I managed to scroll past the screenshot twice (now and earlier) before it had loaded.

Two settings for ls make some of the colouring less useful to me.

BLOCK_SIZE='1 formats sizes in bytes with comma separators. TIME_STYLE=long-iso formats the dates sensibly.

This means entries line up in neater columns.

  -rwxr-xr-x 1 root   root            852 2024-02-23 22:31 zsh5
  -rwxr-xr-x 1 root   root      1,022,760 2024-08-09 04:33 zstd
  lrwxrwxrwx 1 root   root              4 2024-08-09 04:33 zstdcat -> zstd

cb321 2 days ago

You could probably embed raw ANSI SGR color escape sequences { maybe from $(tput) if your terminal might be weird } inside a TIME_STYLE=+FORMAT to colorize the times.

In `lc`, mentioned a bit this thread, you can actually color the age like a "heat map" if you want. I.e. more recent times are more toward the red side of the rainbow and older ages toward the other "cooler" side ("cold storage"). Or whatever color scheme you like. So, if you know you're looking for something recent, the color pops out at you. If you like that kind of thing.