4 ms·
cp, rm, rsync, scp tar... cp [list of a great many items] [here] or service service [item] [action] whereas systemd is systemctl [action] [list
by vacri 11y ago
cp, rm, rsync, scp tar...
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?
- JdeBP 11y agoGNU toolset: 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/Softwares/nosh/bsd-service-command.html 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.
- majewsky 11y agoThe "-t" switch in "cp" exists to support the use with xargs, e.g. 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 restart
- bigbugbag 11y agoTab completion has its limits. Using zsh and some added awesomeness from fish: sys<alt+f> and it completes to systemctl sys<ctrl+e> and it completes to the full last systemctl command I used https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting