Has Anyone Attempted Replacing All Linux Command Line Tools with Rust Alternatives? Share Your Experience!

After watching this video, I’m tempted to give it a try myself. The idea of swapping out traditional CLI tools for Rust-based alternatives is intriguing, and I’m curious to know if anyone has undertaken such an endeavor.

I’m also on the lookout for dotfiles that primarily feature configurations for Rust tools. I find it both educational and entertaining to explore other people’s configurations. I stumbled upon this repository, but I’m interested in discovering more if possible.

wuphysics87,

ion ❤

gerdesj,

No. Those tools are tried and well tested. Yes there may still be bugs lurking but simply rewriting in Rust does not guarantee safety. I do hope that this: doc.rust-lang.org/book/ch19-01-unsafe-rust.html doesn’t get used in that repo.

That said, I’ll take a look in say five years and see how they are getting on.

snowraven,

I don’t know man, those tools - they seem rusty to me.

PseudoSpock,
@PseudoSpock@lemmy.dbzer0.com avatar

The thread needed the joke. Had you not done it, I’d have offered some flavor of it. Bravo!

pixelscript,

If the current tools work fine, have decades of historic support and battle testing, and the alternatives offer little to no net benefit, uhh, why?

noli,

But rust

snowraven,

Aye, I can’t argue with that

mcepl,
@mcepl@lemmy.world avatar

Is Rust Web Scale?

ShustOne,
@ShustOne@lemmy.one avatar

Battle hardened > new

Unless the new has a killer feature set worth the trade off in potential bugs

broface,

I think that’s fair.

Eventually, the Rust-alternatives will be battle-hardened too and we can simply choose what suits us best.

It’s a good time for software, honestly.

ShustOne,
@ShustOne@lemmy.one avatar

Agreed that competition only helps us users

dino,

Are you still using bash?

imgel,

deleted_by_moderator

  • Loading...
  • intrepid, (edited )

    Like many others, I don’t replace old tools with new ones, simply because it is written in Rust. For example, fzf is a very novel and useful tool that’s written in Go. (FYI: Fzf has a Rust alternative called skim). I’m going to restrict the rest of the post to the context of this thread - Rust CLI/TUI programs that I like. But by no means are they the only new ones I like, or always a replacement for the old ones.

    fd and ripgrep (rg) have 2 things in common that give them edge over their older counterparts. First is that both are extremely fast compared to their predecessors. Second is that both support a modern (perl-compatible) version of regex syntax that many programming languages support.

    Zellij is a terminal multiplexer like Tmux. However, Zellij IMO has one huge advantage over Tmux and screen - you don’t need to take a tutorial or read a user guide just to get started. Everything is discoverable and intuitive. Zellij has the potential to replace TMux as the dominant terminal multiplexer in the near future.

    You may find zoxide, atuin and starship as good extensions to your terminal experience, depending on your tastes. Zoxide is a smart directory changer (alt for cd) with good integration all around - with a lot of shells, alternatives (data import), editors (emacs, nvim, etc), file browsers (ranger, nnn, etc) and even mail client (aerc). Atuin replaces the history part of GNU Readline. But lately, it has started gaining features not found in readline, like encrypted history and cross-device history sync. Starship may be a bit fancy for shell prompts - but I find its configuration format to be simpler than the old method. It also supports several shells giving you a uniform experience across shells.

    GPG-TUI is a TUI frontend to GnuPG. It’s useful simply because the GnuPG UI is terrible. Meanwhile, Sequoia PGP is a tool that aims to replace GnuPG altogether. It has some lofty ambitions and has forced the OpenPGP ecosystem to advance a bit. Some of their innovations aim to solve the drawbacks of old OpenPGP - like lack of PKI (instead of just WoT) and Perfect forward secrecy in certain modes. Its defaults are also more sane and modern compared to GnuPG.

    Git-UI (Rust) and LazyGit (Go) are TUI frontends for Git - they have no alternatives. I can recommend either of them if you are a heavy user of git - especially interactive staging and interactive rebasing. Meanwhile, git-interactive-rebase-tool is a tool specifically designed to manage interactive rebases.

    If you are into coding, you may find Tokei useful. It is tool for counting Lines of code (LoC) in your projects, segregated by language. Hyperfine, from the developer of fd, is used to benchmark applications over several runs, with a lot of configuration options. Bat is a terminal pager, again from the developer of fd. It supports syntax highlighting. I often find uses for that. I’m not aware of another tool with the exact same functionality.

    Finally, nushell is showing a lot of promise as a shell with more modern features. It extends the structured data paradigm from powershell.

    intrepid,

    Forgot to mention stacked-git (stg). This is a tool to deal with patch stacks - much like the age old quilt tool often used by kernel hackers. Unlike quilt, stg uses git to manage a stack of patches. This tool was originally written in Python. It was recently rewritten in Rust by the same team.

    Having used stg, it’s like having multiple staging indexes in git. This allows you to craft a good commit history like the one you get from using interactive rebasing. Unlike interactive rebasing, you don’t have to wait till finishing the feature, in order to achieve that result. If you are a git user and haven’t given stg a try yet, I strongly recommend you do. It’s a nice tool to have in your development tool chest.

    Spore,

    Note that skim performs worse than fzf. There’s a new matcher in Rust called nucleo which is faster, but it currently doesn’t have a cli and can only be used inside Helix editor (hx)

    nu is probably the best shell for ad-hoc data processing, handling all my daily needs in one expression.

    fd and rg have another thing in common, that they’re both 50% shorter than their traditional alternatives /s

    Administrator,

    fd is pretty cool. It offers a good simplification over find’s syntax. find -name “*file*” vs fd file. rg I don’t use often except for colorized output. A lot of Nvim plugins also prefer to use ripgrep over grep.

    dino,

    nu is probably the best shell for ad-hoc data processing, handling all my daily needs in one expression.

    I am really struggling with this, I heard about nu shell some time ago, but the fact that you had to learn some form of new language made me reluctant to actually try it. As a fisher user I want to have sane usable defaults, without having to learn just another programming language for a “tool”.

    What am I missing?

    Spore,

    It kinda fills a niche.

    I use fish for simple command pipelines as well. But traditional shells are not as good when I need to do anything “structured”, because they treats almost any value as a string and don’t have anonymous functions. The first problem means that you have to parse a string again and again to do anything useful, the second means that when both pipe and xargs fails you are doomed.
    Nu solves both of the big problems that matters when you want to do rather complex but ad-hoc processing of data. And with a rather principled design, nu is very easy to learn (fish is already way better than something POSIX like bash though).

    Personally another important reason is that I have a Windows machine at work and nushell is much easier than pwsh.

    Btw fish is also going to be a “tool in rust” soon :)

    flakusha,
    @flakusha@beehaw.org avatar

    Just to add - gitui doesn’t (yet) have the commit signing, so for commiting stuff you still have to use command line, but other features are pretty useful.

    netchami,

    Thanks for your comprehensive comment!

    ScottE,

    No, it’s a pointless exercise that makes no sense.

    MonkderZweite, (edited )

    What alternatives? Most of them do different things, often optimized for interactive usecase but lacking in scriptability.

    And just because it’s in Rust, doesn’t mean it’s better in code quality or even safer.

    I do like fd though.

    GustavoM,
    @GustavoM@lemmy.world avatar

    No, but I’d gladly do so if it shows a considerable performance improvement compared to their “standard” counterparts.

    dino,

    I am using alacritty for years, just recently discovered helix. So I guess I am a natural convert.

    StrangeAstronomer,

    What for? Even if they have improvements in some areas, the original POSIX standard utilities will continue to be needed for script compatibility. You’re not going to swap them out - at best you can add them and then you just have an additional code base to support with additional attack surface to protect.

    Decker108,

    The uutils project is aiming for full compatibility though, so eventually you will be able to just swap them out.

    broface,

    What for?

    Personally, I’m a huge fan in unifying software under one language.

    kevin,

    Yes. The only things I use regularly that aren’t aliased to or replaced by a rust-built tool are mkdir, ln, and rsync.

    • cd: zoxide
    • ls: eza
    • cat: bat
    • grep: ripgrep
    • find: fd
    • sed: sd
    • du: dust
    • top/htop: btm
    • vi: helix
    • tmux: zellij (or wezterm mux)
    • diff: delta
    • ps: procs

    Probably some others I’m forgetting

    dessalines,

    Nice, I use almost all these! helix, btm, exa, and delta are wonderful.

    SuperIce,

    Maybe sure to replace exa with eza. Exa has been unmaintained for a while and eza is the maintained replacement.

    dessalines,

    Ah hadn’t realized. Looks like arch AUR was smart about it and yanked exa, and eza had an automatic alias to it.

    sxan, (edited )
    @sxan@midwest.social avatar

    I have a strong bias for staying with tools that are installed by default. After this many years working with new systems of my own, containers, and systems where I’m not root, the added value of an alternativehas to be quite high for me to switch a core utility.

    Thay said, I’ve found fd, ripgrep, and helix to meet that criteria. The others, not so much; they either don’t improve upon or add functionality that’s not available, or simply add eye candy. Gaining pretty colors is nice, but not worth losing familiarity with ubiquitous tools.

    git-delta is an exception where the syntax highlighting can make a functional difference in code diffs. Not so much that I think about installing it, or using it outside of indirect VCS configuration, but it is a good example of using style for more than just eye candy. I prefer difftastic, but they do much the same.

    While it’s not a replacement for an existing tool and isn’t in your list, nnn is very helpful in many cases, especially bulk renames and reorganizations.

    kevin,

    they either don’t improve upon or add functionality that’s not available, or simply add eye candy. Gaining pretty colors is nice, but not worth losing familiarity with ubiquitous tools.

    The thing I like about a lot of these is that I don’t lose familiarity with existing tools. When I end up on a cluster that doesn’t have them, I’m a bit annoyed, but I can still operate just fine.

    The principle exception to this is actually fd - I now find find (har!) almost unusable without having a man page open in a separate terminal. But that’s because fd is so much more ergonomic and powerful, I would never give it up unless forced.

    sxan,
    @sxan@midwest.social avatar

    I unfortunately do not have your crystaline perfect recall. I used vi/m for nearly 20 years before drifting onto kakoune and now helix; I’ve been using them for about a year, and it’s getting harder and harder to not make reflexive mistakes when I’m trying to use vim. sed was already odd with regex escaping (parens but not brackets? Why??), and I know the less I use it the more I’ll forget. This is crippling when I have to work on a system that doesn’t have these new tools installed.

    kevin,

    What I mean is that many of them have basically the same functionality with the same arguments. I don’t mean I have pristine memory for the differences, but things like alias ls=“eza” is basically a drop in replacement with some added features. So when I’m on a server without it, everything is basically the same, just less fancy.

    Helix and fd are an example of the other pattern - they are huge improvements over existing tools, to the point that when I’m forced to use the basic ones, I’m actively crippled. But as an argument not to use the better tool day-to-day, this doesn’t make sense to me. Why would I force myself to suffer 95% of the time to save myself from suffering 5% of the time?

    I mean, for helix/vi it’s even clearer. Vanilla vi is basically unusable for me anyway, and I needed a huge number of plugins to be serviceable - on a basic cluster environment, I’m going to be crippled anyway, so…

    dino,

    While it’s not a replacement for an existing tool and isn’t in your list, nnn is very helpful in many cases, especially bulk renames and reorganizations.

    Can you give an example on the reorganization benefits with nnn? I am using it myself but I still feel like a noob with it.

    sxan,
    @sxan@midwest.social avatar

    So, I did a whole asciinema demonstration to show you, but it was getting tedious. It started to turn into a whole tutorial, and I really didn’t want to go there. That’s why it’s taken so long for me to reply.

    But there are three things I do with nnn:

    • move things. I use the tabs (1-4) to open different directories, space-select multiple items, and ‘v’ to move selected items to directories
    • bulk rename. Again, space-select and ctrl-r to bulk rename. Often, I don’t even select, I just ‘R’ to bulk rename the whole directory. This opens my text editor with all of the file/Dir names; edit freely, save, exit, and nnn renames whatever changed.
    • move/copy to remote locations. With ‘c’ nnn can mount a remote directory over ssh in a tab, and it works just like a local directory, with copying, moving, and renaming seamlessly between tabs.

    I don’t “live” in nnn; it’s a tool I open when I want to do certain things - it’s fast enough to use this way. But you certainly could, since nnn can fork shell processes in selected directories.

    dino,

    The last point is new to me, will check it out, thank you!

    flakusha,
    @flakusha@beehaw.org avatar

    Please give a try for btop - not Rust based, but pretty good and seem to be superior to btm.

    kevin,

    I don’t have any particular allegiance to rust, though once it’s set up, being able to install through cargo rather than being to figure out whatever package manager or build system is nice, especially on various HPC environments where I don’t have sudo.

    Btop does look cool though

    netchami,

    I like most of those, but helix just sucks. It will never replace vi/vim/nvim. I don’t like zellij either, it’s not a proper replacement for tmux.

    kevin,

    You are of course welcome to your opinion. Use whatever tools bring you joy. But I’m a huge fan of helix, and think zellij is great (though I prefer wezterm’s mux server when I can use it).

    dino,

    Can you also give arguments to your opinion?

    netchami,

    Some general things: Both Tmux and Neovim have such broad plugin ecosystems, helix and zellij don’t even come close.

    For zellij specifically: I don’t like the UI, it’s just way too much stuff on the screen, it’s distracting. Tmux tries to stay out of the way and only displays something if it’s absolutely necessary. You can also configure everything yourself.

    Regarding helix: As a long time Vim/Emacs-evil user I just can’t get used to stuff like Kakoune or Helix, it just feels weird.

    dino,

    The thing is, helix has useable defaults, you dont need plugins, thats the whole point for me. Keeping plugins up to date across machines and making sure they work is just tiresome. In terms of tmux/zellij can’t say much, but I never got used to tmux because the controls seem unintuitive. Tested zellji just briefly and it seems it tries to show you the controls instead of hiding them, which is helpful if you are trying to get used to something.

    Mereo,

    deleted_by_author

  • Loading...
  • Rustmilian, (edited )
    @Rustmilian@lemmy.world avatar

    deleted_by_author

  • Loading...
  • Andy,
    @Andy@programming.dev avatar

    I checked the wiki page you kind of linked, and the third sentence is:

    Unlike copyleft software licenses, the MIT License also permits reuse within proprietary software, provided that all copies of the software or its substantial portions include a copy of the terms of the MIT License and also a copyright notice.

    Rustmilian, (edited )
    @Rustmilian@lemmy.world avatar

    deleted_by_author

  • Loading...
  • Andy,
    @Andy@programming.dev avatar

    No, I don’t. I don’t know the strict definition of copyleft, so I went to the source you indicated to get a better understanding. And the phrase I found there:

    Unlike copyleft software licenses, the MIT License . . .

    certainly indicates that the MIT License is not copyleft.

    Rustmilian, (edited )
    @Rustmilian@lemmy.world avatar

    deleted_by_author

  • Loading...
  • Andy,
    @Andy@programming.dev avatar

    The Wikipedia link you provide here for copyleft does not say that permissive licenses are a subset of copyleft licenses, but rather contrasts the two categories. For example, you can scroll down to the table at “Types and relation to other licenses,” where you can see MIT is not in the green Copyleft column.

    If you check Wikipedia’s Copyleft software licenses category, you’ll see MIT is absent.

    The Wikipedia link you provide for permissive states:

    The Open Source Initiative defines a permissive software license as a "non-copyleft license . . .

    morrowind,
    @morrowind@lemmy.ml avatar

    nushell, since it uses more structured data, is basically moving in this direction.

    dinckelman,

    I’ve not replaced anything just because it’s Rust, but I have replaced a fair share of tools, just because their newer Rust equivalents are much better

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • oklahoma
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • SuperSentai
  • feritale
  • KamenRider
  • All magazines