TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

New(ish) command line tools

760 pointsby grapplerabout 3 years ago

49 comments

divbzeroabout 3 years ago
A simple trick I only figured recently is following logs with fuzzy search:<p><pre><code> tail -f &#x2F;var&#x2F;log&#x2F;foo.log | fzf +s </code></pre> Or something similar for output from a dev server:<p><pre><code> make serve | fzf --ansi +s</code></pre>
评论 #31010853 未加载
评论 #31010485 未加载
评论 #31011835 未加载
评论 #31010197 未加载
评论 #31010417 未加载
评论 #31010978 未加载
评论 #31011686 未加载
评论 #31011341 未加载
评论 #31011839 未加载
dystroyabout 3 years ago
I really like the approach of pipe-rename (<a href="https:&#x2F;&#x2F;github.com&#x2F;marcusbuffett&#x2F;pipe-rename" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;marcusbuffett&#x2F;pipe-rename</a>) for renaming many files. It&#x27;s especially convenient for people who can efficiently edit many lines in their favorite text editor (so everybody here, I guess).<p>Main problem: you maybe don&#x27;t do this kind of operation frequently enough to remember how it&#x27;s called or how you aliased it.
评论 #31012132 未加载
评论 #31013027 未加载
评论 #31012393 未加载
评论 #31012519 未加载
评论 #31013089 未加载
评论 #31015111 未加载
评论 #31019106 未加载
评论 #31023305 未加载
评论 #31012684 未加载
评论 #31012412 未加载
评论 #31012458 未加载
评论 #31012817 未加载
评论 #31012491 未加载
评论 #31024309 未加载
michaelmiorabout 3 years ago
My favourite non-standard tool is pv[0]. In it&#x27;s simplest use case, pv is a replacement for cat that also outputs a progress bar to stderr. You can use it to add a progress bar (or multiple) to just about any pipeline. I love it because I know if the one-liner I wrote is about to finish in a couple minutes or if it will be a while and I should either write something more efficient, or do something else while I&#x27;m waiting.<p>[0] <a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pv" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;pv</a>
评论 #31014054 未加载
______-_-______about 3 years ago
I could really use a better workflow to refine grep matches. Has anyone made a tool that combines grep (regex search) with fzf (multiple positive&#x2F;negative patterns)? What I really want is something like:<p><pre><code> grep pattern1 **&#x2F;* | grep pattern2 | grep -v exclude_these | grep -v also_exclude </code></pre> The problem is this loses filenames and context lines in the output. I want to apply several positive and negative regexes, and only at the very end annotate with filenames and context. Anyone have a good workflow for this?
评论 #31010558 未加载
评论 #31010090 未加载
评论 #31010092 未加载
评论 #31010105 未加载
评论 #31010199 未加载
评论 #31010104 未加载
评论 #31011793 未加载
评论 #31010112 未加载
评论 #31011635 未加载
评论 #31010050 未加载
评论 #31010014 未加载
评论 #31012188 未加载
评论 #31010002 未加载
评论 #31016100 未加载
flurieabout 3 years ago
I&#x27;m a big fan of jo[1] for making generating JSON from the shell not terrible.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;jpmens&#x2F;jo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jpmens&#x2F;jo</a>
评论 #31013359 未加载
评论 #31014875 未加载
omair_inamabout 3 years ago
My personal go-to for intelligently tailing files is lnav (<a href="https:&#x2F;&#x2F;github.com&#x2F;tstack&#x2F;lnav" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tstack&#x2F;lnav</a>) tho it has crashed a couple of times for me when applying a bunch of filters, etc.<p>Is anyone aware of any other comparable shell tool for tailing a set of logs?
评论 #31014271 未加载
评论 #31015126 未加载
jiceaabout 3 years ago
As a maintainer, I hoped to see Hurl [1], a tool for testing HTTP with plain text and curl, but alas it isn’t here!<p>[1] <a href="https:&#x2F;&#x2F;hurl.dev" rel="nofollow">https:&#x2F;&#x2F;hurl.dev</a>
评论 #31009938 未加载
评论 #31012671 未加载
评论 #31010855 未加载
评论 #31011178 未加载
HellsMaddyabout 3 years ago
No such list is complete without hexyl!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;hexyl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;hexyl</a>
评论 #31009947 未加载
评论 #31009974 未加载
评论 #31010115 未加载
评论 #31013602 未加载
评论 #31010275 未加载
gsliepenabout 3 years ago
I would broadly categorizes these new tools into two categories: 1) those that are adding real value and make things easier, and 2) those that just add bling to existing tools. An example of the former category is ag, an example of the latter is duf. Also, lots of old tools can do more than you think. For example, did you know good old top can display a bar graph of CPU load for each core just like htop? Just press 1 and t after starting top. You can even make the output colored (press Z and enter), although admittedly the default color scheme is not great.
评论 #31015990 未加载
zamubafooabout 3 years ago
Ah, delta is missing! Right from the docs, it&#x27;s &quot;[a] syntax-highlighting pager for git, diff, and grep output&quot;.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta</a><p>(edit: nevermind, somehow I missed it)
评论 #31012059 未加载
评论 #31010211 未加载
评论 #31011060 未加载
评论 #31009908 未加载
monkaijuabout 3 years ago
I wrote dug, a cli tool I made to help visualize DNS propagation but is a great learning tool. Didnt make this list though sadly.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;unfrl&#x2F;dug" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;unfrl&#x2F;dug</a><p><a href="https:&#x2F;&#x2F;dug.unfrl.com" rel="nofollow">https:&#x2F;&#x2F;dug.unfrl.com</a>
评论 #31010074 未加载
ezequiel-garzonabout 3 years ago
Young man, let me be blunt with “replacements for standard tools” and call out this <i>stream</i> fad:<p>sed (ed) - 1979 (1971)
tomxorabout 3 years ago
broot completely changed the way I navigate directories on the CLI over the past year.<p>I was an &#x27;ls&#x27; purist before, I&#x27;ve tried various CLI file managers in the past and they all felt like they added too much friction, with the one exception of nnn which I briefly used before finding broot, which just feels really fluid and natural.
评论 #31011605 未加载
评论 #31031236 未加载
notJimabout 3 years ago
Glad to discover fd. I&#x27;ve always struggled with find syntax. It&#x27;s easy enough, but always kind of fiddly IME.
评论 #31009893 未加载
评论 #31012107 未加载
评论 #31009993 未加载
hirundoabout 3 years ago
I&#x27;d like a command line tool that could transform `history` into a list of alternate tool recommendations. Bonus if it could also generate recommended aliases and functions according to your habits.
评论 #31013224 未加载
jasonpeacockabout 3 years ago
A new fave I recently discovered - render markdown in the terminal for easy reading (and proofing):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;charmbracelet&#x2F;glow" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;charmbracelet&#x2F;glow</a>
评论 #31009736 未加载
评论 #31025204 未加载
dupedabout 3 years ago
direnv is such a godsend that I shill for it on every team and in every company now, it&#x27;s such a great tool.
评论 #31009634 未加载
评论 #31010960 未加载
评论 #31009916 未加载
评论 #31009962 未加载
评论 #31012022 未加载
评论 #31009614 未加载
sneakabout 3 years ago
Missing from this list is f2 (golang), one of my happiest finds of recent memory:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ayoisaiah&#x2F;f2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ayoisaiah&#x2F;f2</a>
mherdegabout 3 years ago
I peripatetically dive into &quot;strace&quot; for one-off debugging - is there something more modern I should be doing?
评论 #31010358 未加载
评论 #31016878 未加载
liendolucasabout 3 years ago
Nice list of new tools to take a look at. However I think there&#x27;s just one big drawback: as you move around different systems is very unlikely that you have those (you might even not have permission to touch those systems) so you will have to rely on the standard existing tools (even among different OSes you have slightly different implementations). That&#x27;s why I lately I&#x27;ve investing more time reading man pages of some tools, maybe I&#x27;m missing an already existing cool feature. You can learn a ton of things from man pages, and if you follow the &quot;SEE ALSO&quot; section you might even learn some new commands.
评论 #31018145 未加载
carapaceabout 3 years ago
It&#x27;s not new but I like &quot;Miller&quot;:<p>&gt; Miller is a command-line tool for querying, shaping, and reformatting data files in various formats including CSV, TSV, JSON, and JSON Lines.<p><a href="https:&#x2F;&#x2F;miller.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;miller.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a>
评论 #31012313 未加载
throwamonabout 3 years ago
Is mosh secure? Looks like it&#x27;s been unmaintained for quite a few years.
评论 #31010005 未加载
评论 #31010046 未加载
评论 #31009989 未加载
sjtindellabout 3 years ago
pwru (<a href="https:&#x2F;&#x2F;github.com&#x2F;cilium&#x2F;pwru" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cilium&#x2F;pwru</a>) is a fun new tool from the Cilium folks for tracing network packets in the kernel. Like tcpdump but you can trace the full path of the packet including kernel syscalls. Lets you debug much deeper than &quot;when the packet gets to this port it gets dropped&quot;.
mariusorabout 3 years ago
I think tig warrants more than just a passing mention.<p>For me it&#x27;s the best complement for a command line focused git usage, because it offers a far better (but still streamlined) experience for staging chunks than &quot;git add -i&quot;, through its &quot;tig status&quot; TUI interface.<p>One thing that I never bothered to research if it can be modified and the defaults bother me a little is that it does not use vim keybindings (gf for loading a commit, for example).
评论 #31015027 未加载
mihaitodorabout 3 years ago
I thought I’d share a few:<p>- Diffing YAML files: <a href="https:&#x2F;&#x2F;github.com&#x2F;homeport&#x2F;dyff" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;homeport&#x2F;dyff</a><p>- Inspecting Docker image layers: <a href="https:&#x2F;&#x2F;github.com&#x2F;wagoodman&#x2F;dive" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wagoodman&#x2F;dive</a><p>- Interactive HTTPS proxy: <a href="https:&#x2F;&#x2F;mitmproxy.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mitmproxy.org&#x2F;</a>
评论 #31015559 未加载
quagabout 3 years ago
I’m a fan of nnn for a terminal file manager, so I’m keen to try out broot. Does anyone have other recommendations I should try?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jarun&#x2F;nnn" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jarun&#x2F;nnn</a>
评论 #31010321 未加载
评论 #31010261 未加载
评论 #31010280 未加载
em-beeabout 3 years ago
related topics that may be interesting:<p>Ask HN: Best Command-Line Applications? <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18483460" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18483460</a><p>Command line tools for productive programmers <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27992073" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27992073</a><p>An Illustrated Guide to Useful Command Line Tools <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21363121" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21363121</a>
dystroyabout 3 years ago
May I suggest lfs (<a href="https:&#x2F;&#x2F;dystroy.org&#x2F;lfs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dystroy.org&#x2F;lfs&#x2F;</a>) as a replacement for df ?
Havocabout 3 years ago
Couple ones there that I’m keen to try out. bat in particular seems like such an easy win
评论 #31009735 未加载
评论 #31010553 未加载
评论 #31010715 未加载
评论 #31009790 未加载
bluenose69about 3 years ago
Another entry in such a list might be tig (<a href="https:&#x2F;&#x2F;jonas.github.io&#x2F;tig&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jonas.github.io&#x2F;tig&#x2F;</a>), which is an adjunct to various git commands.
评论 #31013057 未加载
thamerabout 3 years ago
macOS equivalent of locate: mdfind. This actually uses Spotlight, so it can search for files by content as well as by name.<p><pre><code> # search by content: $ mdfind some_string # search by name: $ mdfind -name my_file.txt </code></pre> Both commands return a list of files matching the query.
评论 #31014017 未加载
cyfexabout 3 years ago
I have found <a href="https:&#x2F;&#x2F;github.com&#x2F;denisidoro&#x2F;navi" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;denisidoro&#x2F;navi</a> very useful for remembering nifty one-liners.<p>It&#x27;s like a bookmark manager for commands.<p>Also good for sharing them with the rest of your team, via a git repo.
1vuio0pswjnm7about 3 years ago
None of the &quot;replacements&quot; interest me. When I try the &quot;new&quot; ones I cannot get interested in them either. When trying new programs I am looking for whether a program can do something essential that I cannot do myself, e.g., with shell scripts. However I am beginning to think another reason is that these &quot;new&quot; utilities are consitently too complicated, e.g., too many options. It often seems as if the authors are trying to show off their programming skills with some new language they are trying to learn, e.g., Go or Rust. Comparing these new programs to original UNIX utilities, many (most) of the UNIX ones seem comparatively simpler.<p>I write quick and dirty single-purpose utilities for myself because I want relatively simple programs. I try to keep program size reasonably small so I use C not Go or Rust. I avoid creating options. FWIW, seems like that was true of most of djb&#x27;s utilties, too. Some of the best &quot;new&quot; UNIX utilities I have seen have come from from people who use djb&#x27;s C functions and&#x2F;or copy his programming style, including the preference for small program size and few-to-no options. For example, the authors of runit or s6 have some interesting utilities. The author of tinysshd has some useful ones as well. These projects are generally not popular but they are generally high quality, IMHO.<p>There are some JSON utilities listed on this blog page. Despite so many options for libraries and programs to process JSON, I still cannot find one that does something very simple: 1. extract JSON from HTML, 2. print it in a customised, human-readable, left-justified format that 3. makes it easy to process further with <i>other</i> programs. Hence I wrote a stupid program for myself that extracts JSON, prints the keys and values left-justified, making it easy for me to read with less(1) and to process with traditional UNIX text-processing utilities. (I am probably mistaken but I believe the one I wrote may be able to operate at the same speed regardless of the size of the JSON data. This needs to be tested.)<p>I have written several shell scripts over the years that have a subset of the functionality of fzf (or a superset of urlview&#x27;s, which came much earlier), namely finding and selecting items from lists. I am still not a fzf convert because generally it does not do anything essential I cannot already do myself. Plus it is larger, more complex and generally slower.<p>Someone once said the best interface is no interface. For me, the less required user-interaction (including selecting options), the more powerful the utility.
评论 #31013893 未加载
评论 #31014803 未加载
评论 #31015262 未加载
评论 #31011127 未加载
jhsptabout 3 years ago
Shameless plug: a tool I wrote to manage downloads directory :)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jhspetersson&#x2F;fselect" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jhspetersson&#x2F;fselect</a>
pipeline_peakabout 3 years ago
I made a tool back in college called “line” for outputting ranges of line or column numbers.<p>I got tired of piping head into tail and found it simpler.<p>Examples:<p>line file.txt 5 to 9<p>cat file.txt | line —column 4 to 20<p>I thought “line” was very Unix sounding and kinda cute, but like a lot of these projects would never make its way into the gnu utils so I thought what’s the point. That and of course to a beginner Awk user, those kind of operations are child’s play. I thought about csv and printing lines between matching words, but it’s all about KISS.
评论 #31011350 未加载
评论 #31018409 未加载
ckunteabout 3 years ago
I&#x27;d like to mention two tools that I love and use: detox (<a href="https:&#x2F;&#x2F;github.com&#x2F;dharple&#x2F;detox" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dharple&#x2F;detox</a>) -- for sanitising filenames; and mtm (<a href="https:&#x2F;&#x2F;github.com&#x2F;deadpixi&#x2F;mtm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;deadpixi&#x2F;mtm</a>) -- smallest terminal multiplexer.
internetterabout 3 years ago
Has anyone made an installer&#x2F;GNU type thing for the &quot;common&quot; ones like delta and rg? Could be a fun weekend project:<p>Select what tooling you want, it will be installed using your package manager<p>[ ] delta<p>[ ] bat<p>...
评论 #31009954 未加载
评论 #31012164 未加载
评论 #31010460 未加载
评论 #31011702 未加载
tool_tipabout 3 years ago
rdfind, it&#x27;s excellent for finding duplicate files and deduplicating them.
sqqqqrlyabout 3 years ago
I use spruce for many thing but it&#x27;s ability to merge y&#x27;all files smartly is very useful. Think global yaml merged with one of [prod, staging, dev].yaml, merged with override.yaml creating a deployment yaml. <a href="https:&#x2F;&#x2F;github.com&#x2F;geofffranks&#x2F;spruce" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;geofffranks&#x2F;spruce</a>
tkhattraabout 3 years ago
pcstat and vmtouch (page cache statistics and control)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tobert&#x2F;pcstat" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tobert&#x2F;pcstat</a> <a href="https:&#x2F;&#x2F;hoytech.com&#x2F;vmtouch&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hoytech.com&#x2F;vmtouch&#x2F;</a>
评论 #31010207 未加载
wingworksabout 3 years ago
A little late to the party, but if you ever need to do basily anything with dates, check out dateutils (<a href="https:&#x2F;&#x2F;github.com&#x2F;hroptatyr&#x2F;dateutils" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hroptatyr&#x2F;dateutils</a>). Amazing collection of commands.
timviseeabout 3 years ago
Some might find `ffsend` useful to securely share files from your command line:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;timvisee&#x2F;ffsend" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;timvisee&#x2F;ffsend</a>
评论 #31014749 未加载
julienpalardabout 3 years ago
As the author, I&#x27;d add logtop:<p><pre><code> tail -f &#x2F;var&#x2F;log&#x2F;nginx&#x2F;access.log | cut -d&#x27; &#x27; -f1 | logtop </code></pre> as a live updating replacement for a |sort|uniq -c|sort -gr|head
babyabout 3 years ago
There’s also eureka to quickly encrypt files <a href="https:&#x2F;&#x2F;github.com&#x2F;mimoo&#x2F;eureka" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mimoo&#x2F;eureka</a>
评论 #31015151 未加载
aaaronicabout 3 years ago
rclone is another useful cli tool I use frequently.
astrodabout 3 years ago
Any terminal based solutions for Postman&#x2F;Insomnia&#x2F;Nightingale? I am just using curl and text files for api testing.
评论 #31010509 未加载
评论 #31010467 未加载
评论 #31011789 未加载
评论 #31011091 未加载
评论 #31011782 未加载
willkabout 3 years ago
Mosh isn&#x27;t a replacement for SSH, it uses it.<p>&gt; The mosh client logs in to the server via SSH<p>This is a cool list overall though.
评论 #31010049 未加载
评论 #31010142 未加载
评论 #31009885 未加载
voiper1about 3 years ago
I use rpl as search and replace (in place update supported) instead of sed.
kkfxabout 3 years ago
#ifdef NOFLAME<p>Curiously most of those tools implement things Emacs have since decades. Obligatory #define NOFLAME, I was and to a certain extent a unix guy but after having jumped the ship to Emacs I start seeing in practice many aspects of unix inferiority respect of classic systems, far beyond the Unix Haters Handbook.<p>File renaming? Dired do that and more than many modern tools, not only in mere editing (wdired-mode) but also in selecting what to edit (marking via regexp, narrowing, manually select files &quot;killing&quot; others etc) in a far more flexible than an unix CLI tool piped to an editor, results are the same of course, easiness it&#x27;s at another level.<p>Narrowing&#x2F;Fuzzy searching? Similarly from Helm to Counsel passing through consult, ido, ...<p>#endif &#x2F;&#x2F; NOFLAME<p>Anyway I still use CLI daily simply because much inhabited to it and for certain things it&#x27;s quick, and I use some of those tools but the interesting part is not much the tool (dangerously aliased sometimes to overwrite original ones because who remember their name?) but the trend: in the last decade I see a kind of resurgent interest in unix and FLOSS, many that in the past have said &quot;ah, yes, <i>nix are powerful but I need to work no time to learn, ...&quot; in the last decades have started much using GNU&#x2F;Linux even inside Windows and more and more are accustomed to </i>nix model. Emacs itself seems to have seen a sort of resurgent popularity and that&#x27;s make me think: did we need so much time to learn?<p>I mean, we have had the IT revolution from Xerox. Just very few have understood its power and the GAFAM born out of it, starting from the first modern IBM in term of using and ruining Xerox PARC tech to size it&#x27;s power still giving something to end users. The unix revolution succeed but again for most is a thing of the past and it&#x27;s successful model is it&#x27;s failure: they started saying that Xerox desktop model is just too complex and expensive people needs cheap and simpler things, the public agree unix succeed, in just few years they start realizing that no, good iron is needed, GUIs are needed etc and again the big iron era succeed but for a small period of time. PC era wipe it with again cheaper and crappy-er things. PC era succeed and in a moderately short period of time rediscovering of the past desktop model (without knowing it for most) happen, for instance the trend from widgets-based GUIs to document-based ones, the trend toward text-centric works and the recent interest in classic unix witch is actually the most common living vestige of classic model: not really end-user programming, that&#x27;s Emacs, but at least composability via IPCs in CLI, from IDEs to editors, from DE to WM, perhaps tiling&#x27;s ones, for some from unix model to Emacs.<p>Long story short I see a trend that &quot;knowledgeable&quot; people veeeery slowly rediscover classic tech, if that&#x27;s really a trend and we (society) really need such timeframe to learn... Well... It&#x27;s a bit sad...<p>What do you think?
评论 #31026896 未加载