5 ms·
For anyone interested there're a few such tools that are modern alternatives to traditional Unix utilities. Interestingly all written in Rust. grep -> ripg
by forgotpwd16 6y ago
For anyone interested there're a few such tools that are modern alternatives to traditional Unix utilities. Interestingly all written in Rust.
grep -> ripgrep (command `rg`)
find -> fd
sed -> sd
diff -> delta
ls -> exa && lsd
cat -> bat
wc -> cw
du -> dust
ps -> procs
top -> ytop (**edit** archived; author recommends `bottom`)
They all offer their own modern take but I'll say the first two, which are the only ones I'm using, are the most interesting. Both ripgrep and fd offer easier usage. The ripgrep is also an ack replacement and fd can also replace parallel (even has compatible syntax). The amazing part is that both are an order of magnitude faster their counterparts. The ripgrep dev has extended analysis for how this is achieved on their blog[0].
[0]: https://blog.burntsushi.net/ripgrep/ https://blog.burntsushi.net/ripgrep/
- guiambros 6y ago> find -> fd oh, I loved it! Thanks for sharing. For others interested, here [1]. I still need to check others, but find is the one I use the most anyway. btw, it seems ytop [2] is not being maintained anymore. I use gtop [3], which has the same interface, but was developed in Node instead of Rust. [1] https://github.com/sharkdp/fd https://github.com/sharkdp/fd [2] https://github.com/cjbassi/ytop https://github.com/cjbassi/ytop [3] https://github.com/aksakalli/gtop https://github.com/aksakalli/gtop
- forgotpwd16 6y ago>it seems ytop [2] is not being maintained anymore Indeed, author recommends `bottom` instead so noted that in the list. It appears top has a few alternatives. There's also `gotop` that is written in Go and (now that looks cool) `bashtop` written in Bash.
- franga2000 6y agoAny reason nobody is mentioning good old htop here? Since ytop was pitched as an alternative to top...
- guiambros 6y agoYeah, I like them both. Normally when I'm doing some heavy processing I have a htop, gtop and nvtop laid out side-by-side on a tmux session [1], giving me full visibility of system resources. [1] https://imgur.com/a/gZCSKnv https://imgur.com/a/gZCSKnv
- franga2000 6y agoLooks great! Is that a vertical 16:10 monitor?
- guiambros 6y agoIndeed, it's a 24" rotated 90 degrees, so 1200:1920. Initially I thought I'd never use it, but it's surprisingly useful for things like monitoring or background processing.
- bawolff 6y ago> wc -> cw Googling that i get: cw - sound characters as Morse code on the soundcard or console speaker. Must be a pretty obscure replacement when all the google results are for a different unix program. Unless im missing the joke. As an aside, bat really sounds like its replacing less not cat.
- KMnO4 6y ago> As an aside, bat really sounds like its replacing less not cat. In a literal sense, yes. But for what 99% of what people use cat for (viewing files), bat is a great substitute.
- chronogram 6y ago> As an aside, bat really sounds like its replacing less not cat. You have to alias cat='bat --paging=never' for it to replace cat.
- coldtea 6y agoI think it's enough that you invoke it outside of a tty output (e.g. with a redirection to a file) and it will behave like cat.
- forgotpwd16 6y ago`cw` repo is https://github.com/Freaky/cw https://github.com/Freaky/cw `bat` is definitely a `cat` replacement as it has the essential functionality of concatenating files. The automatic paging is only for printing to standard output and it doesn't meddle with this functionality. By the way, zsh built-in pager (invoked with `<`) has this behavior. It prints output to display but it pipes it to an actual pager if size is large.
- krylon 6y ago> zsh built-in pager (invoked with `<`) Huh, I did not know about this. Thank you!
- throwaway894345 6y agosd is pretty great. It’s like sed but it does what you would expect by default (find the first arg and replace with the second). You can opt into regex matches.
- zabzonk 6y ago> modern take What that? Why would I use these rather than the unix tools I have been pretty happy with for nearly 40 years? And which come installed on every unix-like distro.
- gui77aume 6y agoI guess it means more modern implementation (rust). ripgrep is faster than grep, but there are some differences, not exactly the same flags, for example. If you use grep on big files regularly it worth a try.
- rgoulter 6y agoThere are UX benefits of `rg` (or whatever alternatives) over `grep`. e.g. ignoring the .git directory by default. - Plenty of these things _can_ be done with grep, but the newer tools offer the benefits out of the box. Generally, the UX improvements involve better colouring and a more intuitive set of arguments. "installed on every unix-like distro" is an advantage if you're frequently jumping into environments without these tools installed. In that context, it's worth learning the defaults of these tools. - But in many jobs you're able to work on the same computer, and benefit from e.g. customising dotfiles, using whichever tools you want.
- SubjectToChange 6y agoI use ripgrep because it is noticeably snappier, especially for unicode. Other tools like hyperfine or fd are just more convenient. I'd have no problem replacing ls with another tool, but none of them support viewing SELinux attributes. I really don't care whether a tool is standard or not when it comes to a workstation. I have so many thinks tweaked and personalized that using a few nonstandard tools doesn't make a difference.
- happymellon 6y agoIt would be better if it was written in rust, but I prefer `httpie` to `curl` because I find the syntax significantly easier to get my head around even though curl is installed on virtually every Linux distro I almost always get the syntax wrong. But if you prefer a tool, there is no reason to switch of you don't want to.
- SubjectToChange 6y agoA few more time -> hyperfine fzf -> skim diff -> delta sloccount/cloc -> tokei Also, other tools like xsv, fselect, zola, svgcleaner, and flamegraph. I also bounce between Alacritty and Kitty for my terminal emulators.
- wooptoo 6y agoGreat list, I just switched to delta. I would add: curl -> xh