Live data from Hacker News

New(ish) command line tools

jvns.ca

131–140 of 252 posts

Re: New(ish) command line tools

#131

Has 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 ...

I use a makefile to set up a new computer. https://github.com/peteryates/dotfiles/blob/master/Makefile#...

This 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.

Re: New(ish) command line tools

#133
post #83

Any terminal based solutions for Postman/Insomnia/Nightingale? I am just using curl and text files for api testing.

From 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

[2] https://hurl.dev

[3] https://github.com/Orange-OpenSource/hurl

Re: New(ish) command line tools

#134

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/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 a…

I use skim / `sk` for this kind of task: https://github.com/lotabout/skim . For example, for iterating on jq incantations, I have in my shell rc file:

  function jqsk {
    sk --tac --ansi --regex  --query . --multi --interactive --cmd '{}' \
       --bind 'enter:select-all+accept,ctrl-y:select-all+execute-silent(for line in {+}; do echo $line; done | pbcopy)+deselect-all' \
       --cmd-history=${HOME}/.sk_history --cmd-history-size=100000 \
       --no-clear-if-empty \
       --cmd-query "cat $1 | jq --raw-output --color-output --exit-status '.'"
  }
I should look into whether fzf or any of the other tools in this thread can be coerced into doing the same thing, the above is pretty verbose and arcane, and it doesn't always behave the way I expect.

Re: New(ish) command line tools

#135

A 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

As an alternative allowing the use of any shell command/pipeline on the results interactively, see also: https://github.com/akavel/up

Re: New(ish) command line tools

#136

A 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

fzf is a wonderful little tool. I use this script so much: git branch | fzf | xargs git checkout

[deleted]

Re: New(ish) command line tools

#138
I really like the approach of 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.

Re: New(ish) command line tools

#139
post #97

Earlier quoted context omitted.

Alternatively, you can use less(1) in tail mode to search growing logs. less +F -p pattern /path/to/log (Ctrl-C to break out of tail mode. /pattern to interactively set search pattern.)

Also while inside less: & shows you only lines which match a pattern. You can hit & multiple times and less will show you only those lines which match every input pattern. A ^N right after & negates the pattern. & respects the -I switch (case insensitive pattern matching). I use this all the time, especially when I'm on a machine that I don't want to bother installing something like fzf on.

Good tips. Small correction: `&` only filters by the most recent pattern.
Post reply on HN