18 ms·
New(ish) command line tools
- ckunte 4y agoI'd like to mention two tools that I love and use: detox (https://github.com/dharple/detox https://github.com/dharple/detox) -- for sanitising filenames; and mtm (https://github.com/deadpixi/mtm https://github.com/deadpixi/mtm) -- smallest terminal multiplexer.
- monkaiju 4y agoI wrote dug, a cli tool I made to help visualize DNS propagation but is a great learning tool. Didnt make this list though sadly. https://github.com/unfrl/dug https://github.com/unfrl/dug https://dug.unfrl.com https://dug.unfrl.com
- duped 4y agodirenv is such a godsend that I shill for it on every team and in every company now, it's such a great tool.
- chrisweekly 4y agoI feel that way about z
- grappler 4y agodirenv should have been part of unix/linux/posix environments from the start. Whenever something's install steps tell you "go add this export statement to your .bashrc" or similar, it never sat well. That sort of thing should be scoped by path, and shell independent -- exactly the thing direnv enables.
- flurie 4y agoThe first thing I did recently in some cleanup work for a team was set up direnv and have it auto-switch kubernetes context by location.
- slig 4y agoI was reading the thread and thinking "this is a cool tool, might use someday". >have it auto-switch kubernetes context by location Now I'm sold, thanks!
- sundarurfriend 4y agoI never understood why people were so enamored with direnv, but this makes me understand it a bit. I don't think I need it right now, but I'll keep it in mind for this use case.
- ttyprintk 4y agoI alias ~~ to load .env if it exists, and unload the custom pieces if it doesn’t. I’ve seen people do that with :: as well.
- deleted 4y ago[deleted]
- hardwaresofton 4y ago
- jicea 4y agoAs a maintainer, I hoped to see Hurl [1], a tool for testing HTTP with plain text and curl, but alas it isn’t here! [1] https://hurl.dev https://hurl.dev
- mbo 4y agoThis doesn't quite appear to be the type of tool that fits the theme of the list (coreutil replacements).
- jicea 4y agoIt could fit here nevertheless? « new inventions Here are some tools that are not exactly replacements for standard tools:»
- DangitBobby 4y agoI like this, I'll have to try it out!
- danychok 4y agoCool project!
- nonrandomstring 4y agoOh it runs stuff like curl. I use html2text just about 5 times a day, and want better ways of working with html _as_ text without a browser of an kind.
- Havoc 4y agoCouple ones there that I’m keen to try out. bat in particular seems like such an easy win
- rascul 4y agoI use both bat and cat often. cat normally, but bat for source code since it comes with syntax highlighting and line numbers by default.
- zem 4y agofd and ripgrep are the ones that have really stuck with me, replacing find and grep in my finger memory.
- internetter 4y agoYou can of course alias these commands as I have done, although coworkers hate me for it. Mind that 1. You need to be careful to avoid "works on my machine" moments 2. You need to remember that you did it in case you need to undo it.
- sundarurfriend 4y agobat is certainly a game changer. I never printed things out to the terminal - always did a `less` or a `view` - before I installed bat. One (very) minor issue I have with it is that when the file is very small - a couple words or lines at most - then the "decorations" it prints around the content get distracting and make the content slightly harder to read. Maybe I should just write a wrapper around it that does a `wc` first and decides whether to do a `bat` or a `cat`.
- ehsankia 4y agoEvery time I see these lists, I tell myself i'll start using these, but always forget. I would love a meta tool that, every time I use one of the old tools, it automatically gives me a notice to use the new one instead, so I can learn. Then again I guess I could alias the old ones to point to the one one.
- jasonpeacock 4y agoA new fave I recently discovered - render markdown in the terminal for easy reading (and proofing): https://github.com/charmbracelet/glow https://github.com/charmbracelet/glow
- monocasa 4y agoI recently found out about mdp too, a way to display markdown in the terminal as slides. https://github.com/visit1985/mdp https://github.com/visit1985/mdp
- nikau 4y ago> I recently found out about mdp too, a way to display markdown in the terminal as slides. > https://github.com/visit1985/mdp https://github.com/visit1985/mdp I use pandoc to convert markdown to powerpoint decks, it's a great workflow as you can preview and tweak the content and then apply the firm theme before the presentation.
- monocasa 4y agoYeah, I just like the terminal aesthetic. And I've had a problem in the past with sales bros taking internal only presentations that aren't supposed to be consumed externally for a lot of reasons and showing them to customers. Markdown seems to be enough of a barrier to keep that from happening.
- sundarurfriend 4y agoDo you mean actual PowerPoint or just creating a (presumably HTML based) presentation?
- nikau 4y agoactual pptx file: pandoc -f markdown input.md -o output.pptx
- mihaitodor 4y agoGlow is absolutely gorgeous! I wasn't aware of it before reading this article and I love it so much! I write most of my notes as Markdown files and Glow is the best tool to browse through them.
- tool_tip 4y agordfind, it's excellent for finding duplicate files and deduplicating them.
- HellsMaddy 4y agoNo such list is complete without hexyl! https://github.com/sharkdp/hexyl https://github.com/sharkdp/hexyl
- nsb1 4y agoNice tool - my muscle memory steers me toward bvi though.
- sundarurfriend 4y ago"A command-line hex viewer" (for anyone else who wanted a one line description of what it is).
- ______-_-______ 4y agoA replacement for xxd, which it seems like equally few people know about for some reason. Probably the reason it's forgotten about so often
- ttyprintk 4y agoOne of his other tools, hyperfine, made the list. vivid is useful candy from him.
- unixhero 4y agoI use mcview
- flurie 4y agoI'm a big fan of jo[1] for making generating JSON from the shell not terrible. [1] https://github.com/jpmens/jo https://github.com/jpmens/jo
- s_dev 4y agoYou could give jq a go: https://stedolan.github.io/jq/ https://stedolan.github.io/jq/
- flurie 4y agoOh, don’t worry, I am familiar[1] with it! It doesn’t quite do this one thing as well as jo, so I like using both. [1] https://github.com/flurie/AdventOfCode/blob/main/2021/jq/d14p2.org https://github.com/flurie/AdventOfCode/blob/main/2021/jq/d14... - unfortunately, this is the point at which I realized the stdlib was a little too anemic for general purpose solving and gave up
- jonfw 4y agoVery cool! jq is very powerful but can be clunky for simple operations, I love how simple this is
- notJim 4y agoGlad to discover fd. I've always struggled with find syntax. It's easy enough, but always kind of fiddly IME.
- Beltalowda 4y agoI mostly use zsh's globbing for this these days; the syntax can be a bit intimidating at first, but it's not that hard once you get used to it, and it's very quick and easy to type. Bash doesn't really have any of this, so if you're a bash user you're out of luck. Don't know about fish.
- O_H_E 4y agofd has been a life saver on windows dealing with tons of csv file lately.
- clircle 4y agoyes! lots of new tools like FD are just easier to use on Windows than the GNU tools (My experience with a corporate laptop).
- asicsp 4y agoI create aliases/functions and maintain a cheatsheet for commands I don't use often (for ex: convert/ffmpeg/etc) . # fs 'foo' will find files/dirs with 'foo' anywhere in the name irrespective of case fs() { find -iname '*'"$1"'*' ; }
- aaaronic 4y agorclone is another useful cli tool I use frequently.
- willk 4y agoMosh isn't a replacement for SSH, it uses it. > The mosh client logs in to the server via SSH This is a cool list overall though.
- simtel20 4y agoIt only uses ssh for iniating the connection to leverage the authentication.
- sitkack 4y agoSemantics, semantics. If you mosh into a system, you wouldn't also ssh into it. In that sense, the use of mosh replaces the use of ssh and mosh would be used in similar scenarios.
- eminence32 4y agoThe neat thing about mosh is that it doesn't rely on ssh. All you need is a way to launch a process on a remote machine and securely transmit a shared key back to the client. ssh happens to be a useful way to do this, but it's not required
- throwamon 4y agoIs mosh secure? Looks like it's been unmaintained for quite a few years.
- usefulcat 4y agoI've been using it all day, every day for several years. It works quite well.
- keithwinstein 4y agoWe might be victims of our own success on some of this. We've never had a major security hole in Mosh (after ten years since 1.0). We're really proud of that! But that also means we've never needed to issue a security update, which some people use as a proxy for "are people looking for security holes in this project." After a few years without an active maintainer, as of a few months ago we now have a group working slowly but actively towards a Mosh 1.4 release. I think the main benefit people are expecting will be support for 24bit color escape sequences, but I'm also hoping we can get some fuzz targets, etc.
- cepp 4y agoYes, because it’s underpinned by SSH it’s secure. The authors consider it feature complete hence the lack of updates.
- loeg 4y agoWhat? Outside of initial handshake, it doesn’t use ssh (which is kind of the point). It’s totally valid to ask about its security.
- deleted 4y ago[deleted]
- hirundo 4y agoI'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.
- michaelmior 4y agoDoesn't recommend tools, but rags[0] will look through your history to recommend aliases. https://github.com/max-heller/rags https://github.com/max-heller/rags
- zamubafoo 4y agoAh, delta is missing! Right from the docs, it's "[a] syntax-highlighting pager for git, diff, and grep output". [1] https://github.com/dandavison/delta https://github.com/dandavison/delta (edit: nevermind, somehow I missed it)
- internetter 4y agoIt's on the list, do a ripgrep for `a pager for git` ;)
- javajosh 4y agoInterestingly I was also about to post that autojump was missing, checked the comments, saw yours, and rechecked - sure enough, autojump is in there! So, your comment was useful after all.
- zamubafoo 4y agoAh, htmlq [1] is a missing one that's not on the list! Straight from the repo: "Like jq, but for HTML." I find it useful for quickly hacking scripts together and exploring data. Very useful for the iterative process of finding good CSS selectors with the data that I can get without javascript running. --- [1] https://github.com/mgdm/htmlq https://github.com/mgdm/htmlq
- ducktective 4y agoI use pup for this. People who tried both, any difference? https://github.com/EricChiang/pup https://github.com/EricChiang/pup
- zamubafoo 4y agoNot sure if pup supports this but something I do use fairly often (and copied into my own internal tooling) is the ability to filter out results as a flag in the CLI. For example, something I usually do is: curl --include --location https://example.com | tee /tmp/example-com.html | htmlq --base https://example.com a --attribute href --remove-nodes 'a[href*="#"],a[href^="javascript"],a[href*="?"]' This grabs the page, shunts a copy to /tmp for subsequent, iterative testing, then tries to grab all the links while filtering out any links that have a '#', '?', or start with the word 'javascript'. This is super helpful when I'm just exploring some HTML scrape and trying to build a graph of links without having to pop out a proper programming language just yet.
- internetter 4y agoHas anyone made an installer/GNU type thing for the "common" ones like delta and rg? Could be a fun weekend project: Select what tooling you want, it will be installed using your package manager [ ] delta [ ] bat ...
- ______-_-______ 4y agoIf you're on arch, most if not all these tools are in the official repos. Note that delta is named "git-delta". pacman -Syu git-delta bat ripgrep fd Saved you a weekend ;)
- deleted 4y ago[deleted]
- qbasic_forever 4y agoHomebrew works great, even on linux. Every one of these nifty tools is available there. asdf is another good option with most of them.
- petepete 4y agoI use a makefile to set up a new computer. https://github.com/peteryates/dotfiles/blob/master/Makefile#L12 https://github.com/peteryates/dotfiles/blob/master/Makefile#...
- zamubafoo 4y agoThis is brilliant and I'm totally stealing this. I dislike Ansible too much to encode a lot of my workflow in it, but a make file is a much better proposition.
- BrightOne 4y agoYou can use Nix (https://nixos.org/nix https://nixos.org/nix) to install these tools on any Mac/Linux machine (nix profile install nixpkgs#{bat, delta}). Disclaimer: I packaged some of these tools for Nix :)
- tkhattra 4y agopcstat and vmtouch (page cache statistics and control) https://github.com/tobert/pcstat https://github.com/tobert/pcstat https://hoytech.com/vmtouch/ https://hoytech.com/vmtouch/
- ttyprintk 4y agoI have a feeling vmtouch is more widely-deployed than the articles list. See also cachemaster.
- deleted 4y ago[deleted]
- ______-_-______ 4y agoI could really use a better workflow to refine grep matches. Has anyone made a tool that combines grep (regex search) with fzf (multiple positive/negative patterns)? What I really want is something like: grep pattern1 **/* | grep pattern2 | grep -v exclude_these | grep -v also_exclude 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?
- totetsu 4y agoLnav with filters? or can you stack -e expression arguments onto one grep command?
- codemac 4y agoAre you ok with the initial list existing in memory? Then I highly recommend: emacs / vim buffers
- henshao 4y agoJust posting this without trying it out...grep -nH gives you line numbers and full filepath context, and as another commenter said, -ve allows you to string multiple excludes, so grep -inH <search> -ve not_this -ve nor_this -ve nor_that.
- fiddlerwoaroof 4y agoYou don’t have to stack -v like that: -v inverts all the -e expressions, so this should be equivalent: grep -inHv -e foo -e bar -e baz
- fiddlerwoaroof 4y agoSo, awk sort of works as a fancy grep: ps axjw | awk '(/zsh/ || /login/) && !(/awk/ || /direnv/)' And you can easily add features like "print the first line unconditionally: ps axjw | awk 'NR == 1 {print} (/zsh/ || /login/) && !(/awk/ || /direnv/)' IMO, awk is in a pretty uniquely sweet spot between grep and perl/ruby/python.
- sqqqqrly 4y agoI use spruce for many thing but it's ability to merge y'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. https://github.com/geofffranks/spruce https://github.com/geofffranks/spruce
- mherdeg 4y agoI peripatetically dive into "strace" for one-off debugging - is there something more modern I should be doing?
- virchau13 4y agoFor Linux, look at the eBPF tools - they're really useful[0]. I've used them to troubleshoot annoying problems before, and they're far more practical to use than the usual `strace -f ./program` dance. Troubleshooting system issues can also be done with SystemTap[1], which looks cool, but I haven't personally tried it yet. [0]: A cool example of using them is https://www.brendangregg.com/blog/2021-08-27/slack-crashes-secret-stderr.html https://www.brendangregg.com/blog/2021-08-27/slack-crashes-s.... [1]: https://www.sourceware.org/systemtap/ https://www.sourceware.org/systemtap/
- Too 4y agoPerf. Extremely powerful. Mostly for profiling and also some scenarios of debugging. Takes a fair bit of getting used to and each debugging session need more setup, compared to just a quick strace. When working with containers it’s even more complicated to setup unfortunately.
- tomxor 4y agobroot completely changed the way I navigate directories on the CLI over the past year. I was an 'ls' purist before, I'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.
- dystroy 4y agoBroot has many features that feel natural... when you know they exist (for example, try looking for what's taking space with `br -w` then stage the files and remove them at the end). I suggest everyone to have at least a short glance at the introduction at https://dystroy.org/broot/ https://dystroy.org/broot/
- gaws 4y agobroot can't run commands on, let alone select, multiple files. A real shame.
- divbzero 4y agoA simple trick I only figured recently is following logs with fuzzy search: tail -f /var/log/foo.log | fzf +s Or something similar for output from a dev server: make serve | fzf --ansi +s
- lytedev 4y agoI've been using tmux for finding, but I think this might be brilliant and stupid simple. Thank you for this! Never thought of piping "live" output or streaming to fzf!!
- mihaitodor 4y agoSpeaking of logs, angle-grinder is amazing: https://github.com/rcoh/angle-grinder https://github.com/rcoh/angle-grinder
- francislavoie 4y agoThat looks awesome. Something I'd love help with, I use pdsh to tail logs from multiple servers at once, but the ways I can manipulate the logs feel really limited because of how pdsh works. Does anyone know of a better solution for that? Like, from a head node, aggregate/tail the contents of the same log file on multiple servers. Bonus points if it uses 'genders' too to get the list of servers.
- tstack 4y agoThe Logfile Navigator (https://lnav.org https://lnav.org), a TUI for viewing log files, has support for opening logs on remote hosts via SSH in its latest version. See the following post for more information: https://lnav.org/2021/05/03/tailing-remote-files.html https://lnav.org/2021/05/03/tailing-remote-files.html As for integrating with a “genders” host DB, there’s no direct support for it. But, lnav is scriptable, so I’m pretty sure it’s possible to write a script that does what you want. I can help with that if post in the github discussion: https://github.com/tstack/lnav/discussions https://github.com/tstack/lnav/discussions
- sundarurfriend 4y ago
- quag 4y agoI’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? https://github.com/jarun/nnn https://github.com/jarun/nnn
- ranger207 4y agoHow does nnn compare to ranger https://github.com/ranger/ranger https://github.com/ranger/ranger ?
- sundarurfriend 4y agoranger is fancier (both visually and in terms of configurability), but nnn is significantly faster in my experience. I kept putting off looking into ranger's rifle capabilities and Python scripting, but after having it crash on me a couple times - in a directory with many hundreds of files, to be fair - I tried nnn. The speed and simplicity made me switch over entirely, because it has just the right amount of features that I wanted from ranger. (Well, the one thing I kinda miss is the inline Markdown preview in ranger - shortcut `i` - but it's a minor convenience at best.)
- apjana 4y agoYou can set glow (https://github.com/charmbracelet/glow https://github.com/charmbracelet/glow) as the markdown previewer in nnn if you use a customer opener.
- davewongillies 4y agoRelated to ranger, nowadays I use lf[0], which is a clone of ranger written in Go. There's also pistol[1] which is a replacement for ranger's rifle file viewer [0] https://github.com/gokcehan/lf https://github.com/gokcehan/lf [1] https://github.com/doronbehar/pistol https://github.com/doronbehar/pistol
- unixhero 4y agoMidnight commander
- sjtindell 4y agopwru (https://github.com/cilium/pwru https://github.com/cilium/pwru) 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 "when the packet gets to this port it gets dropped".
- astrod 4y agoAny terminal based solutions for Postman/Insomnia/Nightingale? I am just using curl and text files for api testing.
- followben 4y agoTry https://httpie.io/cli https://httpie.io/cli No affiliation... just happy user relieved at deleting Postman :)
- thayne 4y agoAlso xh and curlie
- mihaitodor 4y agoI found https://github.com/hoppscotch/hoppscotch https://github.com/hoppscotch/hoppscotch recently and it's quite nice. There's also a VSCode extension that doesn't look like it's actively developed any more: https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client https://marketplace.visualstudio.com/items?itemName=rangav.v...
- joobus 4y agoThere is a cli tool to run postman collections: https://github.com/postmanlabs/newman https://github.com/postmanlabs/newman You still have to create the collections in Postman, however.
- jihchi 4y agohttps://news.ycombinator.com/item?id=31009609 https://news.ycombinator.com/item?id=31009609 hurl looks good
- zamubafoo 4y agoFrom much earlier [1], hurl [2] supports some really great features and definitely worth looking into for repetitive HTTP tasks. --- [1] https://news.ycombinator.com/item?id=31009609 https://news.ycombinator.com/item?id=31009609 [2] https://hurl.dev https://hurl.dev [3] https://github.com/Orange-OpenSource/hurl https://github.com/Orange-OpenSource/hurl
- carapace 4y agoIt's not new but I like "Miller": > Miller is a command-line tool for querying, shaping, and reformatting data files in various formats including CSV, TSV, JSON, and JSON Lines. https://miller.readthedocs.io/en/latest/ https://miller.readthedocs.io/en/latest/
- honzajde 4y agoI got very excited about this tool. It's exactly what I need. I wrote a custom calendar app in it. But I got disappointed by performance. A list of 10 items takes 3 seconds to draw. I yet have to check if that is not caused by some other tool in the call stack. I wonder what is others people experience with performance of mlr?
- adren123 4y agoI also use regularly miller/mlr with files having 1M+ lines and I never had problems with the hardcoded processing (i.e. "verbs") nor the DSL language which is know to be much less efficient compared to verbs. Both visidata and miller are essential tools to process/view CSV/TSV files, way better than LibreOffice or Excel in terms of performance on large files.
- carapace 4y agoIf you can reproduce that reliably you should open a bug for it, eh? I'm sure John Kerl would want to know.
- thamer 4y agomacOS equivalent of locate: mdfind. This actually uses Spotlight, so it can search for files by content as well as by name. # search by content: $ mdfind some_string # search by name: $ mdfind -name my_file.txt Both commands return a list of files matching the query.
- bloopernova 4y agoIf you add this to your .zshenv or similar: [[ $OSTYPE =~ ^darwin.* ]] && export FZF_CTRL_T_COMMAND="mdfind -onlyin . -name ." When you hit ctrl+t, you'll get mdfind's output for all files in the current working directory and below, auto-piped into fzf for fuzzy matching. You can do something like type "vim " then hit ctrl+t, find the file, hit enter twice to start editing it. I wrote a quick guide on installing fzf/fd/ripgrep with powerlevel10k/oh-my-zsh/zplug on MacOS, because I would get asked how to replicate my setup: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b3f3ae24019 https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b...
- 1vuio0pswjnm7 4y agoNone of the "replacements" interest me. When I try the "new" 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 "new" 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. 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's utilties, too. Some of the best "new" UNIX utilities I have seen have come from from people who use djb's C functions and/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. 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 other 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.) I have written several shell scripts over the years that have a subset of the functionality of fzf (or a superset of urlview'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. Someone once said the best interface is no interface. For me, the less required user-interaction (including selecting options), the more powerful the utility.
- forgotpwd16 4y ago>consitently too complicated, e.g., too many options At least one of them (fd) was designed specifically to be simpler to use than its UNIX counterpart (find). And others though as simple to use (ripgrep, scc) they're much more performant than the tools they replace (ack, cloc).
- sneak 4y agoMissing from this list is f2 (golang), one of my happiest finds of recent memory: https://github.com/ayoisaiah/f2 https://github.com/ayoisaiah/f2
- ezequiel-garzon 4y agoYoung man, let me be blunt with “replacements for standard tools” and call out this stream fad: sed (ed) - 1979 (1971)
- baby 4y agoThere’s also eureka to quickly encrypt files https://github.com/mimoo/eureka https://github.com/mimoo/eureka
- ChrisGranger 4y agoI recommend age as well. It offers encrypting for recipients for whom you have public keys. https://github.com/FiloSottile/age https://github.com/FiloSottile/age
- pipeline_peak 4y agoI made a tool back in college called “line” for outputting ranges of line or column numbers. I got tired of piping head into tail and found it simpler. Examples: line file.txt 5 to 9 cat file.txt | line —column 4 to 20 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.
- speed_spread 4y agoI'd much prefer an ecosystem of interlocking small commands with uniform options than using classic UNIX do-everything tools such as awk. These generally have terrible syntax that's impossible to remember. If I'm gonna drop to a sublanguage other than the shell, I'll use something sane like Python.
- javert 4y agoTo me it feels like someone could rethink the unix tools in the way you're talking about, and maybe it could become a successful and widely-adopted project. Because a suite of tools like this could live alongside the old unix stuff. The main challenge to doing this well is having good taste and experience. It may be that if you really tried to do this, you'd face tons of UX challenges, and you'd find that tools like awk really were in the sweet spot already.
- Beltalowda 4y agoawk is a lot better at what it does than Python though, and much easier too. Even something simple as "cmd | awk {print $1}" in awk is something like: import sys, re for line in sys.stdin.read().split('\n'): s = re.split('\s+') if len(s) > 0: print(s[0]) else: print() And I probably got that incorrect as it's probably not the way to read stdin (it's been a while since I programmed Python). I can list many gripes with Unix tools, but "awk bad" isn't on that list. It's a small language that solves a very specific problem, and does that surprisingly well. The syntax is about as simple as it gets – no idea how it's "terrible" or "impossible to remember", and it's certainly not "insane" as you seem to be suggesting.
- julienpalard 4y agoAs the author, I'd add logtop: tail -f /var/log/nginx/access.log | cut -d' ' -f1 | logtop as a live updating replacement for a |sort|uniq -c|sort -gr|head
- dystroy 4y agoMay I suggest lfs (https://dystroy.org/lfs/ https://dystroy.org/lfs/) as a replacement for df ?
- dystroy 4y agoI really like the approach of pipe-rename (https://github.com/marcusbuffett/pipe-rename https://github.com/marcusbuffett/pipe-rename) for renaming many files. It's especially convenient for people who can efficiently edit many lines in their favorite text editor (so everybody here, I guess). Main problem: you maybe don't do this kind of operation frequently enough to remember how it's called or how you aliased it.
- tomsmeding 4y agoGiven that I'm guaranteed to forget that I have this thing installed if I would install it, I'm just going to steal the idea and try to remember to use my editor instead of an ugly shell loop next time I want to rename many files. There's only a small difference, really, between transforming `1.txt 2.txt 3.txt` to `file1.md file2.md file3.md` and transforming to `mv 1.txt file1.md; mv 2.txt file2.md; mv 3.txt file3.md`.
- chrisshroba 4y agoYou likely already know this, but just a reminder/tip that bash and zsh will let you edit the current command you’re entering in your editor of choice if you press ctrl+x ctrl+e (without releasing ctrl between). (Note if you’re using zsh without ohmyzsh, you’ll have to enable this manually [1]) [1]: https://nuclearsquid.com/writings/edit-long-commands/ https://nuclearsquid.com/writings/edit-long-commands/
- remram 4y agoI don't see how the shell could know whether you released the Ctrl key?
- chrisshroba 4y agoWhoops, you're right, I assumed my muscle memory was the source of truth heh.
- jwilk 4y ago
- jhspt 4y agoShameless plug: a tool I wrote to manage downloads directory :) https://github.com/jhspetersson/fselect https://github.com/jhspetersson/fselect
- Bessie69 4y ago[flagged]
- em-bee 4y agorelated topics that may be interesting: Ask HN: Best Command-Line Applications? https://news.ycombinator.com/item?id=18483460 https://news.ycombinator.com/item?id=18483460 Command line tools for productive programmers https://news.ycombinator.com/item?id=27992073 https://news.ycombinator.com/item?id=27992073 An Illustrated Guide to Useful Command Line Tools https://news.ycombinator.com/item?id=21363121 https://news.ycombinator.com/item?id=21363121
- bluenose69 4y agoAnother entry in such a list might be tig (https://jonas.github.io/tig/ https://jonas.github.io/tig/), which is an adjunct to various git commands.
- moontear 4y agoIt's on the list
- bluenose69 4y agoOh, I missed it. Thanks!
- voiper1 4y agoI use rpl as search and replace (in place update supported) instead of sed.
- michaelmior 4y agoMy favourite non-standard tool is pv[0]. In it'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'm waiting. [0] https://linux.die.net/man/1/pv https://linux.die.net/man/1/pv
- omair_inam 4y agoFrom the PV man page (https://linux.die.net/man/1/pv https://linux.die.net/man/1/pv) > A more complicated example using numeric output to feed into the dialog(1) > program for a full-screen progress display: ... > Frequent use of this third form is not recommended as it may cause the programmer to overheat. ^- is that a wisecrack hidden in an otherwise serious man page?
- jwilk 4y agoPSA: don't use linux.die.net. It's horribly outdated. This sentence was removed from the man page in pv 1.4.0, released in December 2012.
- michaelmior 4y agoJust happened to be the first result that came up, but good to know.
- encryptluks2 4y agoAgreed, actually enjoy using Arch manpages now: https://man.archlinux.org/man/community/pv/pv.1.en https://man.archlinux.org/man/community/pv/pv.1.en
- mariusor 4y agoI think tig warrants more than just a passing mention. For me it'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 "git add -i", through its "tig status" TUI interface. 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).
- seanw444 4y agoYeah if I was forced to give up Magit, I'd definitely roll with Tig. It's well done.
- omair_inam 4y agoMy personal go-to for intelligently tailing files is lnav (https://github.com/tstack/lnav https://github.com/tstack/lnav) tho it has crashed a couple of times for me when applying a bunch of filters, etc. Is anyone aware of any other comparable shell tool for tailing a set of logs?
- tstack 4y agoSorry for the crashes, have you sent the crash logs to support@lnav.org or opened an issue on https://github.com/tstack/lnav/issues https://github.com/tstack/lnav/issues ? I try to take a look at crash reports, but I’m not always able to figure out the issue from just the logs. If you have some time to spare in replicating the problem, I can take a deeper look.
- omair_inam 4y agoI do try to submit the logs when I can. tbh, it takes a combination of (In/Out) text filters along with some navigation to trigger the failures. If I re-encounter, I will try to spend some time to reproduce. You can find the last failure I submitted here[0]. [0] = https://groups.google.com/g/lnav/c/C2uORuyKmy8/m/5Knove9gBQAJ https://groups.google.com/g/lnav/c/C2uORuyKmy8/m/5Knove9gBQA...
- aisamu 4y ago+1. I miss it dearly, but unfortunately couldn't make the various AWS log shapes work as nicely as the Java ones did.
- timvisee 4y agoSome might find `ffsend` useful to securely share files from your command line: https://github.com/timvisee/ffsend https://github.com/timvisee/ffsend
- anaganisk 4y agoIs it still functional, correct me if I am wrong, wasnt firefox send deprecated?
- Beltalowda 4y agoYes, but people have set up alternative public servers, and you can run your own. It's the nice thing of open source software :-)
- liendolucas 4y agoNice list of new tools to take a look at. However I think there'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's why I lately I've investing more time reading man pages of some tools, maybe I'm missing an already existing cool feature. You can learn a ton of things from man pages, and if you follow the "SEE ALSO" section you might even learn some new commands.
- mmsimanga 4y agoThis. With companies getting ever security conscious installing any software is a long and tiresome exercise.
- gsliepen 4y agoI 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.
- gaganyaan 4y agoI like tools that come with nice defaults, so that I don't have to learn tricks like that. To make a somewhat bad analogy, one of the reasons that Ubuntu is so popular vs other distributions is that you have to futz with it less. Which isn't to say that it wasn't neat to learn that top can do that, but I'm probably still going to continue using htop.
- mihaitodor 4y agoI thought I’d share a few: - Diffing YAML files: https://github.com/homeport/dyff https://github.com/homeport/dyff - Inspecting Docker image layers: https://github.com/wagoodman/dive https://github.com/wagoodman/dive - Interactive HTTPS proxy: https://mitmproxy.org/ https://mitmproxy.org/
- bsagdiyev 4y agore: Dive -- there's a fork with some updates, https://github.com/jauderho/dive https://github.com/jauderho/dive
- mihaitodor 4y agoAwesome, thanks for that! It has a bunch of useful stuff merged, but it's still missing the export tree view feature (https://github.com/wagoodman/dive/pull/324 https://github.com/wagoodman/dive/pull/324), which can be handy.
- kkfx 4y ago#ifdef NOFLAME 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. 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 "killing" others etc) in a far more flexible than an unix CLI tool piped to an editor, results are the same of course, easiness it's at another level. Narrowing/Fuzzy searching? Similarly from Helm to Counsel passing through consult, ido, ... #endif // NOFLAME Anyway I still use CLI daily simply because much inhabited to it and for certain things it'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 "ah, yes, nix are powerful but I need to work no time to learn, ..." in the last decades have started much using GNU/Linux even inside Windows and more and more are accustomed to nix model. Emacs itself seems to have seen a sort of resurgent popularity and that's make me think: did we need so much time to learn? 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's power still giving something to end users. The unix revolution succeed but again for most is a thing of the past and it's successful model is it'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's Emacs, but at least composability via IPCs in CLI, from IDEs to editors, from DE to WM, perhaps tiling's ones, for some from unix model to Emacs. Long story short I see a trend that "knowledgeable" people veeeery slowly rediscover classic tech, if that's really a trend and we (society) really need such timeframe to learn... Well... It's a bit sad... What do you think?
- cyfex 4y agoI have found https://github.com/denisidoro/navi https://github.com/denisidoro/navi very useful for remembering nifty one-liners. It's like a bookmark manager for commands. Also good for sharing them with the rest of your team, via a git repo.
- wingworks 4y agoA little late to the party, but if you ever need to do basily anything with dates, check out dateutils (https://github.com/hroptatyr/dateutils https://github.com/hroptatyr/dateutils). Amazing collection of commands.