← Back to context

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.

Doing it the way it does allows specifying multiple services.

systemctl status myapp mydb

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.

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.