4 ms·
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 star
by IgorPartola 2y 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.
- brontitall 2y agoDoing it the way it does allows specifying multiple services. systemctl status myapp mydb
- autoexec 2y agoWhy not allow for both and accept the option at any location? Something like: systemctl --stop myapp mydb systemctl myapp mydb --stop
- IgorPartola 2y agoI would rather do that as two commands than to scroll to see the output of each.
- okanat 2y agoThere is no output for success.
- BikiniPrince 2y agoOnly failure is rewarded!
- egberts1 2y agoNOBODY ask for a status of two services. Hence the verb-last CLI rulez!
- gf000 2y agoPress alt+B twice?
- smallmancontrov 2y agoAlt + 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)
- kjellsbells 2y agoI 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.
- IgorPartola 2y agoLearn something new every day. What is the ^ representing in this case?
- kjellsbells 2y agoCaret 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-Designators.html https://www.gnu.org/software/bash/manual/html_node/Word-Desi... [2] https://www.johndcook.com/blog/2022/10/21/shell-replace-word/ https://www.johndcook.com/blog/2022/10/21/shell-replace-word...
- emmelaich 2y agoIt actually should be possible to switch them around. No-ones going to call their service 'stop' or 'service' right?
- Ayesh 2y agoSomeone should create a set of systemd units that show something funny when entered, like how `sl` does for `ls`.
- johnchristopher 2y agoDo you use your space bar to handle heating ?
- IgorPartola 2y agoWhat do you mean?
- johnchristopher 2y agoIt's a reference to an XKCD comic https://xkcd.com/1172/ 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/ https://xkcd.com/1053/
- IgorPartola 2y agoHaha excellent! Thank you!
- noumuon 2y agoJust use an alias. I don't understand why a problem with such a simple solution should cause such issues.
- zbentley 2y agoBecause 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.
- lee_ars 2y agoPeople 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.