Live data from Hacker News

Ask HN: What are the best and worst command-line interfaces you have used?

news.ycombinator.com

51–60 of 85 posts

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#51

worst is git by far. i'm used to it now but when I was learning, "what the fuck did `git reset --hard` do? where is --soft? Is there a no-flag version? What the fuck did I leave mercurial for. God damn I miss svn." I still kind of miss Mercurial and TortoiseHG.

Some day I will burn a day of my life to learn it inside out and be done with it. Meanwhile I use magit.

Mercurial was much better IMO but people argued about performance, because, you know, the CPU is the bottleneck when I merge code. How much time has been wasted navigating Stack Overflow?

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#52
post #44

Earlier quoted context omitted.

Long ago someone taught me this memory trick for tar: imagine an angry German stereotype saying “eXtract Ze Vucking File”, thus -xzvf. No idea what it stands for but it does what I need most of the time.

x = extract, z = compress/decompress, v = verbose (list files added or extracted), f = filename follows. You can leave off the 'z' if it's a tar without compression. If it's compressed, the extension is usually tgz, tar.Z, bz2, or something else other than tar. You can leave off the 'v' if you don't want to see a list of which files are being added or extracted.

In recent versions of (maybe only GNU?) `tar` you can leave off the `z` flag and it will still decompress based on the filename.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#54
post #15

Nearly everything that packs or unpacks stuff. tar, gunzip, and else. I can never remember if they are going to unpack everything into a subdirectory or spill everything into my home, and conversely I never know if after zipping there's gonna be a directory inside or not. Luckily dtrx and atool do the thing you want most of the time. From the time I was a teen I think I remember that mount was difficult to use, and m…

Relevant xkcd comic: https://xkcd.com/1168/

tar --version

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#55
post #9

The ImageMagick utility mogrify. By default (without specifying extra command-line options) it overwrites the input files. [1] In decades of computer use, that is the only command line tool that tricked me into destroying my data because I didn't realize it works differently from all the other tools I use that don't do that. Usually, a command line utility with less options specified is relatively "safe" and you have…

well, use convert instead. It's the only difference...

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#56
post #3

My niggle is with commands that cannot be composed, ie. consumed by other tools or shell scripts or built into pipelines. There are lots of small things that break composition: Not exiting with a non-zero code on error, sending error messages to stdout, not producing output that can be easily parsed by another command. Too many commands suffer from one of these problems, unfortunately.

One that's unfortunately quite common is unconditionally outputting ANSI colour escape sequences even when the output isn't the terminal.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#57

worst is git by far. i'm used to it now but when I was learning, "what the fuck did `git reset --hard` do? where is --soft? Is there a no-flag version? What the fuck did I leave mercurial for. God damn I miss svn." I still kind of miss Mercurial and TortoiseHG.

Obligatory: https://git-man-page-generator.lokaltog.net/

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#59
rsync is probably my least favourite. I literally don't think I have ever correctly written a command that does what I intended on the first attempt.

I do like anything that's a nice well-structured representation of an API though – things like the AWS CLI are pretty good in practice, IMO.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#60
post #42

The combination of mosh and screen has been a big productivity booster for me. The shell alias server1='mosh root@server1 -- screen -xRR -D' keeps the connection forever even if I change networks. The only pity is that mosh breaks compatibility with earlier versions once in a while.

Why use screen when tmux, an improved version, exists?

screen vs tmux is like vim vs emacs. A matter of taste.
Post reply on HN