Live data from Hacker News

Exa: An alternative to Ls

the.exa.website

91–100 of 105 posts

Re: Exa: An alternative to Ls

#91
post #79
post #73

Earlier quoted context omitted.

Grouping/sorting also enhances human readability, and the options for this in GNU ls are quite limited.

Use sort(1), you can sort by fields. Also, you have --group-directories-first in GNU ls. Maybe everyone should read the man page before commenting.

I'm glad to hear you have some way to do your simple listings with standard tools, but I would say your comment is not really a fair rebut especially with RTFM snark. Your concept remains "quite limited", as I said. These limitations may not bother you, but they may well bother others - reasonably.

At a minimum, the "file type" codes are limited to inode types and one permission bit (exec). Output layout is limited to the `ls -l` format unless you parse & re-emit that in which case I would argue you are replacing `ls` just with `ls -l` instead of readdir/stat as a driver.

`lc` lets you define several kinds of new categories (besides classics like dot files and directories, for example ALL_CAPS or even file(1)/magic-based coding) and sort (or filter) by those in a multi-level sense in the unfolded (non-l) layout, not just the "-1" layout. As mentioned these categories are useful not only for colorization. This results in dense, but co-located big blocks of similar file types in the table. For example, I could group ELF executables differently than "simply perm-bit/access(3)" scripts. This is often helpful since the ELFs may not run across systems or can be rebuilt from sources. Similarly, I can group "dot directories" before "dot files" before "directories" before "non-directories-non-dots".

Besides file type limitations, there are also many other features in `lc` that would require increasingly sophisticated (and not generally available) shell tools and combinations. Just off the top of my head, the auto-glob abbreviation feature, other value-dependent formatting like file data sparseness, "3 char wide times" like "37w" for 37 weeks old, tweak files, etc. I doubt, were you to provide all these things that you would be able to persuade anyone that you were not "replacing ls" with something a notch or two more sophisticated. Could this replacement all be done with like find/stat/file/awk? Maybe, but I'd bet that would be pretty slow, especially on larger directories.

As to the value of said replacement, well, you may not care about any of these features and that is fine. I know smart people that mostly `ls -l|grep foo` - hardly using the features of the listing (or subdirectories!) at all. Yet none of my mentioned features involve color and it is simply incorrect to suggest just reading the man page reveals "trivial" ways to replicate them all. Combined with color, I think they are even more useful, but people vary on color. Anyway, cheers & good luck to you.

Re: Exa: An alternative to Ls

#93

I've been loving all the new rust-based CLI tools; you can find a lot of them here [0]. So far I've used ripgrep, fd-find, sd, exa, bat. I care less about speed and more about ease-of-use and beautiful output. Another bonus is standardized tooling between Mac and Linux; little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to i…

The best part is that most of them even work well under Windows, too, and that really is a nice breath of fresh air for a change. I always miss my tools when I am on Windows, and while I know a good deal of PowerShell it still doesn't work for me as well as "Unixy" tools.

Re: Exa: An alternative to Ls

#94
post #32

Earlier quoted context omitted.

> little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to install with Homebrew. I'm in the same boat as you - I love the the rust-based CLI tools. I would also recommend installing the GNU coreutils via homebrew ( https://formulae.brew.sh/formula/coreutils ). This lets you run the GNU coreutils by prefixing them with a `g`, l…

Oh that's neat, thanks. Given you also use the rust tools, where do you find yourself reaching for the g* tools?

Not GP, but I'd imagine one use case would be for writing scripts to be used on other machines where the tools might not be installed, e.g. writing scripts on a mac to be run on Linux servers. If for example you want to script something for CI to be run on a Linux server, I can imagine having the GNU utilities in the default path on a Mac would be useful, since getting the Rust tools installed on the CI server is probably not worth the effort.

Re: Exa: An alternative to Ls

#95
post #32

Earlier quoted context omitted.

> little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to install with Homebrew. I'm in the same boat as you - I love the the rust-based CLI tools. I would also recommend installing the GNU coreutils via homebrew ( https://formulae.brew.sh/formula/coreutils ). This lets you run the GNU coreutils by prefixing them with a `g`, l…

Oh that's neat, thanks. Given you also use the rust tools, where do you find yourself reaching for the g* tools?

it's all about the flags, e.g. readlink -f

Re: Exa: An alternative to Ls

#97
post #32

Earlier quoted context omitted.

> little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to install with Homebrew. I'm in the same boat as you - I love the the rust-based CLI tools. I would also recommend installing the GNU coreutils via homebrew ( https://formulae.brew.sh/formula/coreutils ). This lets you run the GNU coreutils by prefixing them with a `g`, l…

Oh that's neat, thanks. Given you also use the rust tools, where do you find yourself reaching for the g* tools?

gsed -i, Make, AWK, Tar

Re: Exa: An alternative to Ls

#98

I've been loving all the new rust-based CLI tools; you can find a lot of them here [0]. So far I've used ripgrep, fd-find, sd, exa, bat. I care less about speed and more about ease-of-use and beautiful output. Another bonus is standardized tooling between Mac and Linux; little bsd differences have been driving me nuts since I took a job that forced me into a MacBook, but these tools solve that issue and are easy to i…

The standardized tooling is called POSIX, and you already have it installed — it’s easy enough to train the GNUisms out of your fingers and it will reward you in the end.

The standard is also the lowest common denominator. I think it's a useful skill to be able to write POSIX-only shell scripts, but in my day to day use I'd rather have the GNU extensions, knowing that they aren't portable. Plus the GNU versions of the programs generally are still portable anyway.

Re: Exa: An alternative to Ls

#99
post #91
post #79

Earlier quoted context omitted.

Use sort(1), you can sort by fields. Also, you have --group-directories-first in GNU ls. Maybe everyone should read the man page before commenting.

I'm glad to hear you have some way to do your simple listings with standard tools, but I would say your comment is not really a fair rebut especially with RTFM snark. Your concept remains "quite limited", as I said. These limitations may not bother you, but they may well bother others - reasonably. At a minimum, the "file type" codes are limited to inode types and one permission bit (exec). Output layout is limited t…

Use find for complex queries. Also, on color, ls -F gives you a slash on directories, an at symbol on symlinks, an asterisk on executables and more goodies on special files. No color needed. KISS.

Re: Exa: An alternative to Ls

#100
post #39

Still defaults to the unreadable multicolumn view. Yuck! Why is this the default in ls? Why would anyone keep this awful default in another tool? It's so heinous.

I don't get why that's a problem, it allows you to see many many more files at first glance. Back when I switched from DOS (which does have the single column view as default for the "dir" command) to Linux, it was quite a revelation. The overwhelming amount of time I don't need to see ownership/permission and modification time?

Because it's unreadable, and virtually every directory has more files than fit in one screen, so you either read it in an unnatural left→right up→down direction or you read it in the natural up→down left→right direction and keep scrolling back up and down. It's just a terrible default that really has no use in a text environment.
Post reply on HN