[HN Gopher] Exa: An alternative to Ls
___________________________________________________________________
Exa: An alternative to Ls
Author : lordleft
Score : 101 points
Date : 2021-10-27 15:06 UTC (7 hours ago)
(HTM) web link (the.exa.website)
(TXT) w3m dump (the.exa.website)
| earthboundkid wrote:
| 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.
| anyfoo wrote:
| 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?
| cb321 wrote:
| With `lc` you can have customized format strings so that you
| can see "size name", or "perms size name" or any
| subset/reordering of the report columns. And all of these are
| rolled up into a multi-column layout, though you can control
| how many columns you want with, e.g. lc -n3.
|
| (Never mind the glob-abbreviation ability which while slow
| allows packing an enormous number of names per terminal row.)
| agluszak wrote:
| soon there will be nothing left to rewrite in Rust ;)
| 5- wrote:
| one surprising interaction with ls i had recently was that it
| coloured files with capabilities differently, but it was pretty
| difficult to figure out what was going on.
|
| and that looks like a recent change, as in 2012 someone
| complained that ls didn't distinguish those at all:
| https://utcc.utoronto.ca/~cks/space/blog/linux/LsShowCapabil...
|
| so i had an executable that was behaving unexpectedly, somewhat
| similar to the linked write-up, which ls showed with black text
| on red background. for a while, until i remembered about
| capabilities, i couldn't figure out what the unusual colour
| meant. eventually i found the word 'capability' buried in
| https://www.gnu.org/software/coreutils/manual/html_node/Gene...
|
| compared to that, exa seems to be a bit more obvious with its '@'
| indicator (it would be nice if it was documented in the man page
| and not just in https://the.exa.website/features/long-view) and
| the -@ option to print xattr/capability names.
| codezero wrote:
| Switching tools sure does highlight your own quirky usage of a
| tool. I installed exa and aliased it to ls, probably mistake
| number one.
|
| I tend to look for things using reverse sorting a lot, and exa
| -ltra exa -lSr don't work out of the box (not sure why I thought
| it might, maybe because exa -la did) - And now I'm faced with
| reading a man page or documentation for some 15-20 seconds which
| I can't be bothered to do, despite that seeming so simple :)
|
| I do think I'll try to give it a shot, it looks quite nice.
| yewenjie wrote:
| Does anybody have experience with `lc`? The description is quite
| intriguing.
|
| https://github.com/c-blake/lc
|
| c-blake/lc: A post-modern, "multi-dimensional", configurable,
| abbreviating, extensible ls/file lister in Nim
| cb321 wrote:
| Author here; I have experience using it 100s of times per day
| since I wrote it. There are a couple of things that I don't use
| (like selinux) support that may be a little hinky. I have a few
| loyal users, but I don't hear much feedback about troubles they
| might have.
|
| It has kind of a long history. I first did a prototype in
| Python about year 2000 and then a year later a re-write in C
| which I used for a couple of decades and then an I think pretty
| nice 3rd gen in Nim. (Often one doesn't really get it all
| layered correctly until 3rd try, even for something kinda
| simple like `ls`.)
|
| Miller columns a la NeXTStep is something easy to simulate with
| `lc` via the glob abbreviation { paste <(lc -1m25 ../..) <(lc
| -1m25 ..) <(lc -1m25 .) | column } and in general the program
| is more like an "ls construction toolkit" than a fixed
| classifier/turnkey ls. But really the readme covers many more
| details.
|
| Among unusual ones is "tweak" files; Got a directory that you
| want special defaults for? Just drop in a `.lc` file. (With
| some parallel hierarchy features when perms do not allow that
| directly.) This is sort of like Windows remembering what
| sorting/layout options you clicked on, but manual and opt-in
| (and far more general).
| [deleted]
| claytonjy wrote:
| 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 install with Homebrew.
|
| [0] https://lib.rs/command-line-utilities
| vips7L wrote:
| > Another bonus is standardized tooling between Mac and Linux;
|
| This is why I just use a modern cross platform shell that has
| everything built in. My choice is PowerShell since I flip
| between Linux and Windows, Nushell is also a solid choice if
| you want something more Unixy.
| gnubison wrote:
| 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.
| idsout wrote:
| > 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`,
| like `gsed` rather than `sed`.
| rank0 wrote:
| There's a way also to remap the gnu coreutils to their normal
| commands without the g prefix. I did it a while ago but I
| can't recall exactly how...
| claytonjy wrote:
| Oh that's neat, thanks. Given you also use the rust tools,
| where do you find yourself reaching for the g* tools?
| rank0 wrote:
| I use the gnu coreutils because small things like cli flags
| are different for the macos implementations. So for example
| some aliases in my .zshrc didn't work on my MacBook. I come
| from a Linux background so it was nice for me to have
| coreutils behave exactly how I'm used to. Some people
| prefer gnu software for ideological reasons too.
|
| It was one of the flags for 'ls' in particular that made me
| switch. There's a way to add the gnu coreutils to your path
| without the g prefix so I never even notice the difference.
| theamk wrote:
| I have nothing against exa, but the two examples in this post are
| are not correct for any sort of recent system.
|
| > Here's an example. exa, by default, runs the stat system call
| on every file it encounters.
|
| So does "ls" ... for at least last 20 years. Just checked on
| random Ubuntu system I had -- executables and dirs are
| highlighted with different colors.
|
| > exa makes heavy use of colours, treating them as opt-out rather
| than opt-in: it will highlight files and data differently based
| on their type or meaning.
|
| So does ls -- I see colors in default install. Yes, you need an
| environment variable to enable this, but all the modern distros
| set this anyway.
|
| So _based on that page_ , it seems that the only thing that EXA
| does differently is that it upgrades ls's 16 color palette to 256
| colors.
|
| I think they need stronger motivation.
| Liru wrote:
| ls doesn't do colours by default, but a lot of distros alias
| `ls` to `ls --color=auto` so it seems that way.
| jeroenhd wrote:
| There's a features page on their website that shows some more
| tricks it can do, like smarter file type colouring, generating
| a tree view and showing the git status of files.
|
| I'm still not entirely convinced that it's a must-have, but
| it's more than just ls with fancy colours.
|
| Personally, I'd much rather have seen an output format like
| JSON as a feature instead, so you can do some easier scripting
| through exa and jq. I'm sure there are other tools out there to
| serve thst purpose, though.
| setpatchaddress wrote:
| Yes, they really need to call out what makes it different.
| The front page makes it sound mostly like an alias to ls with
| specific options + an additional call to `git status`.
| throwaway8582 wrote:
| > I think they need stronger motivation.
|
| I've been using `exa` for over a year now, and I use it as an
| alias for both `ls` and `tree`. I don't really notice any
| benefit compared to using `ls`, but I really prefer its tree
| mode over the default `tree` command. It's nice being able to
| use the same CLI args and have a similar output format for both
| `tree` and `ls`.
| gizdan wrote:
| It does a little more than that. See my other comment:
| https://news.ycombinator.com/item?id=29015973
| chomp wrote:
| I'm not gonna hate on this too much; side projects like this are
| fun and help the creator understand the filesystem-side of their
| operating system. The colors are pretty, there's some nifty
| features to better understand the file list you're staring at.
|
| This won't ever replace `ls` because it's not POSIX compliant,
| but that's okay because I don't think it needs to be. I have run
| into cases where downstream packages have dependencies on non-
| POSIX commands which gets a little annoying, but you can always
| choose something else (or take it on yourself to re-implement
| their idea in a POSIX-compliant way), which is the whole point of
| open source software.
|
| Let this creator have their fun!
| TacticalCoder wrote:
| It's like saying ripgrep won't ever replace grep... It's true
| but for many use cases (for example in many shell scripts) but
| there are _much_ more people using ripgrep than just its
| creator.
|
| _exa_ is already several years old and has 15 K thousands
| stars on Github. Not to mention all the people using it that
| never bothered to give it a star.
| open-paren wrote:
| I've been using lsd[0] as my ls replacement for a while. I like
| that it has a config file for defaults, so I don't have to change
| a bunch of aliases when setting up a new system.
|
| 0: https://github.com/Peltoche/lsd
| oweiler wrote:
| It's also a lot faster than exa!
| [deleted]
| Soulsbane wrote:
| Same here.
| andreineculau wrote:
| Thanks! It's always nice to read HN threads and get "better"
| (subjective maybe) alternatives than the original post
| jordemort wrote:
| I'm also enjoying lsd, to the point where I've aliased ls to
| it. The file icons are fun.
| dunefox wrote:
| Same here. It's great.
| salil999 wrote:
| I like exa. Been using it for a couple months now.
| kkoncevicius wrote:
| Main feature here seems to be colors, but GNU `ls` can also color
| files based on their file extension and also differentiate
| between pipes, executables, and working and broken links [1].
|
| [1]:
| https://www.gnu.org/software/coreutils/manual/html_node/dirc...
| gizdan wrote:
| It does a lot more than just colours. It has git integrations,
| a more concise output, built-in tree, grid view, icons (note
| they're not showing correctly in below output) and much more.
| $ ll drwxrwxr-x - dan 27 Oct 15:12 -I .idea
| .rw-rw-r-- 15 dan 9 Sep 11:44 -N .tool-versions
| drwxrwxr-x - dan 9 Sep 11:53 -I dist drwxrwxr-x
| - dan 23 Sep 18:53 -- docs .rw-rw-r-- 376 dan 29 Jun
| 12:26 -I some-project.iml drwxr-xr-x - dan 10 Sep
| 12:28 -I node_modules .rw-rw-r-- 301 dan 21 Oct 13:17
| -N override.env
|
| edit: if it wasn't clear, the above output is a subset of the
| real output.
| eminence32 wrote:
| > icons (note they're not showing correctly in below output)
|
| This is often my biggest annoyance with command line tools
| that rely on dedicate fonts and private use icons. The
| functionality is great, but making sure you've got the right
| fonts installed on every machine/terminal is sometimes
| tedious enough that I give up on things like exa.
|
| These days I think exa does not show icons by default, which
| is I think the right decision.
| PaulHoule wrote:
| Lately I have been creating "three sided cards" which usually
| have a photograph or art reproduction on the front, a back side
| with an explanation and qr code that point to a web site.
|
| Each of these is a package of files in a directory.
|
| In the last few days I've been developing "ls-like" functionality
| for these cards with the specific goal of listing cards that need
| maintenance. For instance I did a series of photographs where I
| printed the cards but didn't generate the web sites.
|
| Architecturally it's interesting, particularly in that there is
| the selection logic, the way you display a card, and then the
| realization that you ought to be able to do something to a card
| other than display metadata for it but select the cards with the
| same facility you use to select them for "ls".
| qsi wrote:
| Won't use it for the simple reason it's much harder to type (for
| me) than ls, and doesn't seem to offer anything I can't find in
| ls right now.
| jakeva wrote:
| I've got ls aliased to exa
| rc_mob wrote:
| never seen this before, thanks for linking. i will try it out
| dang wrote:
| exa previous threads:
|
| _I use `exa` instead of `ls` on Linux_ -
| https://news.ycombinator.com/item?id=26559334 - March 2021 (51
| comments)
|
| _Exa - A Modern Replacement for Ls_ -
| https://news.ycombinator.com/item?id=20564000 - July 2019 (6
| comments)
|
| _Exa - A Modern Replacement for Ls_ -
| https://news.ycombinator.com/item?id=19342031 - March 2019 (1
| comment)
|
| _Exa - a modern replacement for ls_ -
| https://news.ycombinator.com/item?id=18658211 - Dec 2018 (2
| comments)
|
| _Exa, a modern replacement for ls_ -
| https://news.ycombinator.com/item?id=14923362 - Aug 2017 (403
| comments)
|
| _Show HN: Exa, a replacement for ls written in Rust_ -
| https://news.ycombinator.com/item?id=9087108 - Feb 2015 (87
| comments)
| bikeshaving wrote:
| I wish the authors thought a little bit more about the actual
| physicality of typing out commands. `exa` on a QWERTY keyboard is
| typed on one hand, across three rows, and with the weakest
| fingers. I guess I could put this into muscle memory, but I
| expect an `ls` like command to be ergonomic to some degree and I
| see myself making a lot of typos.
| 5- wrote:
| see also: https://github.com/mtoyoda/sl
|
| (available packaged in most linux/bsd distributions)
| dTal wrote:
| This is a basic flaw in the design of unix. The user interface
| is coupled to the implementation. To accomplish a task, you
| don't describe the task - you write the name of a program that
| executes that task. Once a program is named, no other program
| can be named that ever again.
|
| Imagine if programming languages worked that way.
| wruza wrote:
| I don't understand the programming languages analogy, can you
| elaborate? One way to interpret that is "s/program/function,
| class or module/g", but that sounds strange to me.
| cb321 wrote:
| I put some thought into that naming
| https://github.com/c-blake/lc which I think is basically
| uniformly more capable than exa.
| dopu wrote:
| I guess. Nothing's stopping you from remapping 'ls' to exa.
| That's what I did.
| kelvie wrote:
| I've been doing this -- it's annoying for things like "ls
| -rt" and other commands that you may or may not use often.
| cyberge99 wrote:
| Yeah, I just use \ls -whatever for those.
| kingaillas wrote:
| You better not switch your keyboard layout to dvorak... 'ls'
| are both right pinky letters. ;)
| anthk wrote:
| alias ls='ls -vF'
|
| This way you'll see directories and executables in a glance.
|
| No need for colors, or fancy ls replacements.
| cb321 wrote:
| Grouping/sorting also enhances human readability, and the
| options for this in GNU ls are quite limited.
| gkfasdfasdf wrote:
| For me, the killer feature of exa is the git integration. Being
| able to do 'l' (aliased to 'exa --long --all --links --git') and
| seeing the git status (added, ignored, modified, etc) along with
| other file details is awesome.
| paxys wrote:
| Tree view looks like it could be useful. Every other feature is
| meh though.
| adrian_b wrote:
| Looking at the available options, I like that it can display
| the extended attributes of the files, because I use extended
| attributes for various purposes.
|
| On the other hand, it could not replace ls for me, because exa
| does not have any equivalent of the ls option _--full-time_.
| All the possible exa options to display the time truncate the
| timestamps to various resolutions (much coarser than how the
| timestamps are stored in the file system).
| kosayoda wrote:
| Is what you're looking for (re: --full-time) not `exa -l
| --time-style=full-iso`?
| adrian_b wrote:
| `exa -l --time-style=full-iso' truncates the timestamps to
| millisecond resolution.
|
| `ls --full-time" gives the timestamps as they are stored by
| the file system, without alteration. For example the xfs
| timestamps and the FreeBSD ufs timestamps have nanosecond
| resolution.
| kosayoda wrote:
| This is what I get running `exa -l --time-style=full-iso`
| on my ext4 system: `drwxr-xr-x - kosa 2021-09-02
| 12:20:39.114446860 -0400 Desktop`
|
| Unless it's different on xfs/ufs, this seems to be
| nanosecond resolution to me,
| jxy wrote:
| > exa, by default, runs the stat system call on every file it
| encounters.
|
| Never used a multi-user system with a moderate amount of files,
| did you? Let alone distributed filesystems.
| JohnWhigham wrote:
| Kind of getting tired of seeing these replacements for battle-
| tested tools that are basically just resume padding for the
| author.
| adamnemecek wrote:
| Until exa came around, I would install the GNU core utilities on
| my mac because the BSD ls doesn't have the option to group
| directories first.
| cb321 wrote:
| https://github.com/c-blake/lc can do that and more; Indeed you
| can group "dot directories" differently than "non-dot
| directories". When I sat down to write `lc` I went through all
| of exas issues and features and included as much as I felt
| reasonable.
|
| I never liked the graphical tree mode, though. I prefer packing
| as much information as possible into small real estate (like
| cell phone terminal screens).
|
| https://github.com/c-blake/procs does include some
| "indentation" oriented tree viewing, though, and uses much of
| the same kind of classification-colorization as `lc`, just for
| process table listings (on Linux only for now). It also has
| "user tweakable aggregation" (kind of the reverse of listing
| the sub-threads in process).
| pimlottc wrote:
| This page doesn't actually list any features or explain why you
| should use exa instead of ls. The homepage [0] is more useful in
| this regard.
|
| 0: https://the.exa.website/
| p_j_w wrote:
| Did the link get edited or something? OP takes me to
| https://the.exa.website/introduction, which has a nice tutorial
| with all of the features and how to install.
| theamk wrote:
| No? That "introduction" link mentions 2 differences: "The
| computer is no longer the bottleneck." -> exa runs stat()
| calls; and "256-colour terminals are everywhere." -> exa uses
| color by default.
|
| But the thing is, if you install any modern system (ubuntu or
| fedora or pretty much anything else) and type "ls", it does
| those two things as well! Your default config will alias ls
| to enable color by default, and this ls invocation _will_ be
| doing stat on every page.
|
| So anyone who knows "ls" even a bit would, on looking on
| _that particular page_ , say, "Huh? That's your special
| feature? my ls does this already and I don't have to do
| anything to install it. [close window]"
|
| To reiterate, EXA does have features that "ls" does not. It
| just that https://the.exa.website/introduction page does not
| list those features at all. If you want to convince people to
| switch to EXA, you better point them to a different page.
| seanw444 wrote:
| Same here. I thought it was an alright little manifesto.
| pimlottc wrote:
| It's fine as a manifesto but no where does that
| introduction page actually say why you might want to bother
| switching over from ls in the first place.
| linkdd wrote:
| > The computer is no longer the bottleneck.
|
| High load average, full swap, memory leaks, those things still
| happen today.
|
| > exa, by default, runs the stat system call on every file it
| encounters.
|
| 99% of ls's use case are: show me the files in this folder.
|
| What happened to KISS (Keep It Simple, Stupid) and the UNIX
| philosophy (do only one thing, but do it well)?
|
| > 256-colour terminals are everywhere.
|
| Laughs with Windows Terminal.
|
| > ls is still there if you need it.
|
| Thank you, I will keep using it. Also "ls" for "list" is
| straightforward, what does "exa" even mean?
|
| There is a reason why those programs have not changed in the last
| 50 years: they work, they do one thing, they do it well, nobody
| ask them to do more.
| wongarsu wrote:
| It might not be KISS, but I think exa embodies the UNIX
| philosophy. It does one thing (show me the contents of a
| folder) and it does it well (arguably better than ls as long as
| the consumer is a human).
|
| The UNIX philosophy isn't "only call one syscall", so getting
| more info on the files it's displaying is far game in my book.
| faho wrote:
| >Laughs with Windows Terminal
|
| The new windows terminal has truecolor.
| linkdd wrote:
| And yet git bash still needs ansicon to have ANSI escape
| sequences handled correctly.
| omnicognate wrote:
| >what does "exa" even mean?
|
| Examine
| deeblering4 wrote:
| > You list files hundreds of times a day. Why spend your time
| squinting at black and white text?
|
| I don't spend any time squinting... And personally the bright
| colors shown in the example are harder on my eyes than the shades
| of gray I've selected in my terminal emulator.
|
| I also work with a large number of systems, and prefer to work
| from muscle memory with the tooling that is installed by default
| 100% of the time.
|
| Part of me wishes projects like this would just write patches for
| the thing they are trying to replace. There is no reason ls
| couldn't output emoji file types, just patch it in ls and make it
| a flag people can alias, like --color=auto.
|
| To each their own I guess.
| treeman79 wrote:
| When I wear prism glasses I have to mute the colors to bear
| black and white otherwise I get weird text hovering. Different
| colors come forward backwards.
| cb321 wrote:
| Actually, I did at first look into this kind of a modification
| of GNU ls, but its internal concepts of how to classify files
| is just not amenable to generalization along the lines of
| https://github.com/c-blake/lc . Basically, the patch would be
| to thoroughly overhaul guts of the command and libraries it
| uses and be so unclean that starting from scratch is better,
| even if you wanted to "stay in C".
|
| It's not like the patch would be installed 100% of the time
| anyway, and shell aliases can paper over divergent
| installations. So, it's 100% fine if none of these features
| matter to you - to each his own indeed - but I thought your
| point deserved a reply.
|
| (EDIT: also, `lc` is < 1000 lines of pretty tabular Nim code;
| Nim is a very high productivity language; exa and GNU ls are
| both effectively like 10x more code, IIRC. But yeah, you do
| need to have the Nim compiler installed)
| kbd wrote:
| The main thing I use Exa for is as a better "tree":
| et() { exa -alT --git
| -I'.git|node_modules|.mypy_cache|.pytest_cache|.venv'
| --color=always "$@" | less -R; } alias et1='et -L1'
| alias et2='et -L2' alias et3='et -L3'
|
| Exa is great for this because it shows file details along with
| the tree hierarchy.
|
| (I have to manually specify a bunch of git-ignores because Exa's
| git ignore support doesn't work properly.)
| zamadatix wrote:
| Tree does have some options for file details as well, -p is the
| same as ls -l or and/or you can use options like -hug
| individually. -hugDC for dates and some coloring too.
|
| Maybe not as great as exa but not bad for the classic option.
| baumy wrote:
| Love this! Stole it and added a bit of bash-fu to it to avoid
| needing to define the extra aliases:
|
| et() { exa -alT --git
| -I'.git|node_modules|.mypy_cache|.pytest_cache|.venv'
| --color=always "-L${1:-1}" | less -R }
|
| commands would now be, e.g. "et 2" instead of "et2", but will
| work with any number. defaults to 1 if just "et" is run with no
| argument.
___________________________________________________________________
(page generated 2021-10-27 23:01 UTC)