3 ms·
In case anyone was wondering, the moreutils tools: chronic: runs a command quietly unless it fails combine: combine the lines in two files using boolean op
by bloopernova 3y ago
In case anyone was wondering, the moreutils tools:
chronic: runs a command quietly unless it fails
combine: combine the lines in two files using boolean operations
errno: look up errno names and descriptions
ifdata: get network interface info without parsing ifconfig output
ifne: run a program if the standard input is not empty
isutf8: check if a file or standard input is utf-8
lckdo: execute a program with a lock held
mispipe: pipe two commands, returning the exit status of the first
parallel: run multiple jobs at once
pee: tee standard input to pipes
sponge: soak up standard input and write to a file
ts: timestamp standard input
vidir: edit a directory in your text editor
vipe: insert a text editor into a pipe
zrun: automatically uncompress arguments to command
from https://rentes.github.io/unix/utilities/2015/07/27/moreutils-package/ https://rentes.github.io/unix/utilities/2015/07/27/moreutils...
Similarly, there's some lesser-known useful stuff in GNU Coreutils:
https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_com...
paste: Merges lines of files
expand: Converts tabs to spaces
seq: prints a sequence of numbers
shuf: shuffles its input
- koolba 3y agoseq is “less known”? I’d assume anyone familiar with shell scripting would know about it. It’s a great starting point for entertaining children on a terminal: seq 99 -1 0 | xargs printf ‘%s bottles of beer on the wall…\n’
- foobarian 3y agoBash kinda broke seq for me since you can just write {99..0}
- o11c 3y agoOr if you need dynamic arguments, you probably want: N=9; for ((i=0; i<=N; ++i)); do echo "$i"; done
- andrewshadura 3y agoWhy use this form of for when you can just use seq and it works in any shell including fish?
- o11c 3y agoBecause capturing the output of `seq` requires spawning a whole separate process (significant for small sequences) and shoving all the data into a single buffer (significant for large sequences) rather than working incrementally.
- bloopernova 3y agoLess known maybe for most people who read HN, but you're right that a lot of shell scripting folks would know about it.
- deleted 3y ago[deleted]
- agumonkey 3y agothanks for the tl;dr moreutils and similar pops up every year but it's still easy to forget.. they should be part of core distributions nowadays..
- jeffbee 3y agoConfusingly, moreutils parallel is not "GNU parallel". Moreutils parallel is very simple, while the other parallel is very featureful. Linux distributions can deal with the conflict, but bad package managers like homebrew cannot.
- mlk 3y ago"rename" shares the same fate, there are several implantations, completely different from each other