Can you name any commands or interfaces that take the variable before the argument?
Can you name any commands or interfaces that take the variable before the argument?
grep <pattern> <file>
Convenient when you're looking for <pattern> in a bunch of <file> (and for some reason cannot glob or list them). Less so if you're looking for a bunch of <pattern> in some one <file>.I've been known to write one-liner shell functions to put the variable component of a list of commands at the end of the commandline for easy editing.
cp [list of a great many items] [here]
or service service [item] [action]
whereas systemd is systemctl [action] [list of great many items]
There appears to be no hard and fast rule, though - argument ordering is different to flag ordering (-f -z etc). I never see anyone put flags at the end, though plenty of tools work fine that way.My problem with systemctl is that it's so woeful to tab-complete. At 'syst[TAB]c[TAB]', you may as well just type out the whole thing, because tabbing only saves you two characters. Why not just take 'ctl', that doesn't seem to be taken by anyone?
cp -t [here] [list of a great many items]
And there is one area outwith Unix but still at the command line where one does sometimes see people putting flags at the end (even though this is not the documented syntax): dir *.txt /s
Be wary of the service command, incidentally.* http://homepage.ntlworld.com./jonathan.deboynepollard/Softwa...
As for "ctl": Bear in mind that there are a lot of "ctl" commands. initctl (from upstart), netctl (from Arch), rcctl (from OpenBSD), pfctl (from OpenBSD), ip6addrctl (from FreeBSD), ntpctl (from OpenBSD), hastctl (from FreeBSD), swapctl (from 4BSD), rctl (from FreeBSD), pppctl (from FreeBSD), smartctl, journalctl, bootctl, localectl, busctl, coredumpctl, hostnamectl, machinectl, timedatectl, loginctl ...
Pick unadorned "ctl" for the systemd one, and one begs the question of why systemd alone is special enough not to require its name in the command.
find /some/directory/ -name *.txt | xargs cp -t all-the-textfiles/
The systemctl interface has the same useful property: systemctl --failed | awk '/.service/{print$1}' | xargs systemctl restarthttps://github.com/zsh-users/zsh-history-substring-search