Comment by IgorPartola
1 year ago
When it comes to starting and stopping services I want the verb to go last. Way easier to press up, backspace backspace backspace o p to change service ssh start to service ssh top. This is a frequent pattern I follow as I start/stop/restart/reload. Having to go back at least one word adds keystrokes that aren’t necessary.
Do you use your space bar to handle heating ?
What do you mean?
It's a reference to an XKCD comic https://xkcd.com/1172/ that pokes fun at users with strong attachments to some software behaviours and/or interfaces.
Also, it looks like you are one of today's lucky 10,000 ! https://xkcd.com/1053/
1 reply →
Doing it the way it does allows specifying multiple services.
systemctl status myapp mydb
I would rather do that as two commands than to scroll to see the output of each.
There is no output for success.
1 reply →
NOBODY ask for a status of two services.
Hence the verb-last CLI rulez!
Why not allow for both and accept the option at any location?
Something like:
systemctl --stop myapp mydb
systemctl myapp mydb --stop
All `--` strings should be "options". Starting/stopping a service is not an option, it's a command. I don't enjoy `pacman` for this very reason.
unnecessary flexibility brings unnecessary bugs
I agree, but here's a handy Bashism:
^art^op
Converts the "start" in "foo start bar" to "stop", ie runs "foo stop bar". Append :p to do the substitution but print the command instead of running it.
Learn something new every day. What is the ^ representing in this case?
Caret is a word designator in bash's history scheme. Here it acts as a way to mark the thing with the thing being replaced. There's a more detailed explanation in [1] and a quick read in [2]. Essentially bash let's you do manipulation and re-execution of commands from your history and one of the manipulations is via word substitution.
[1] https://www.gnu.org/software/bash/manual/html_node/Word-Desi...
[2] https://www.johndcook.com/blog/2022/10/21/shell-replace-word...
Press alt+B twice?
Alt + Bikeshed?
(Kidding aside, quick reminder that on Mac you have to enable Settings>Profiles>Keyboard>Use Option as Meta key, or else Alt doesn't work)
It actually should be possible to switch them around. No-ones going to call their service 'stop' or 'service' right?
Someone should create a set of systemd units that show something funny when entered, like how `sl` does for `ls`.
Just use an alias. I don't understand why a problem with such a simple solution should cause such issues.
Because I switch computers (often, for work), and what's muscle memory on one then becomes "command not found" on others without the alias. Many of those computers I don't control and can't say "well, everyone should just run my aliases".
Because I have to share commands with other people who are troubleshooting their own systems, and copy/paste from history becomes useless if I have specific aliases.
Because someday I or someone will want to script these interactions, and aliases are not available in subprocesses.
People are telling you why. You're just choosing to disregard their answers as insufficient. This is not a them-problem. It's a you-problem.