Live data from Hacker News

New(ish) command line tools

jvns.ca

231–240 of 252 posts

Re: New(ish) command line tools

#231
post #184

None 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 tryin…

> Someone once said the best interface is no interface. Was this from an article by Golden Krishna, later turned into a book by the same title? Archived article (or, how to open your car door in 13 steps): https://web.archive.org/web/20120831083217/http://www.cooper... Previous HN discussions: https://news.ycombinator.com/item?id=4616945 (2012, 87 comments) https://news.ycombinator.com/item?id=4454004 (2012, 34 comme…

The article on The Verge looks like it's about mobile phones, i.e., pocket-sized computers meant to be operated with touchscreens. Granted, today we can plug tactile USB keyboards into some of these "phones" and we have options like Termux, but the subject here, unlike the The Verge article, is command line programs.

Maybe no one besides me ever actually said those exact words with respect to command line programs. What did happen is someone wrote that he found user interfaces on command line programs are not "good" interfaces. He then suggested that writing command line programs that did not have to parse options could be a "security" tactic when programming. See "5. Don't parse" in the text file below.

   tnftp -4o"|tar xOz qmail-1.03/SECURITY|less"  https://cr.yp.to/software/qmail-1.03.tar.gz

Re: New(ish) command line tools

#232
post #184

None 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 tryin…

> Someone once said the best interface is no interface. Was this from an article by Golden Krishna, later turned into a book by the same title? Archived article (or, how to open your car door in 13 steps): https://web.archive.org/web/20120831083217/http://www.cooper... Previous HN discussions: https://news.ycombinator.com/item?id=4616945 (2012, 87 comments) https://news.ycombinator.com/item?id=4454004 (2012, 34 comme…

[deleted]

Re: New(ish) command line tools

#233

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.

Everything that needs manual entry can utilize text editor features greatly! Search and replace, multiple cursors, duplication, formatting etc. However, there will require some fancy ways to put result back in input sources.

Re: New(ish) command line tools

#234

I 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…

I'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.

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

Re: New(ish) command line tools

#235

Some might find `ffsend` useful to securely share files from your command line: https://github.com/timvisee/ffsend

Is it still functional, correct me if I am wrong, wasnt firefox send deprecated?

Yes, but people have set up alternative public servers, and you can run your own. It's the nice thing of open source software :-)

Re: New(ish) command line tools

#236

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.

ZSH has mmv for this.

Re: New(ish) command line tools

#237

A new fave I recently discovered - render markdown in the terminal for easy reading (and proofing): https://github.com/charmbracelet/glow

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

Re: New(ish) command line tools

#238

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 glue together ripgrep with fzf and bat like this: rg --line-number --no-heading --color=always --smart-case "$@" | fzf -d ':' -n 2.. --ansi --no-sort --preview-window 'down:20%:+{2}' --preview 'bat --style=numbers --color=always --highlight-line {2} {1}' I get a small preview of the file in the bottom 20% of my terminal, and I can use fzf's matching to further filter, or to exclude things I capture the output and t…

Thank you for this

Re: New(ish) command line tools

#239

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.

Given 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.m…

You 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/

Re: New(ish) command line tools

#240
post #213

#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-m…

> 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?

Resurgence? Google tells me otherwise... https://imgur.com/a/urcePZq

Post reply on HN