4 ms·
As a Unix person, 'Restart-Service' seems a lot easier to remember than 'systemctl'. Edit: Restart-Service is also easier to remember than /etc/init.d was. Ed
by nailer 11y ago
As a Unix person, 'Restart-Service' seems a lot easier to remember than 'systemctl'.
Edit: Restart-Service is also easier to remember than /etc/init.d was.
Edit 2 (rate limit): `service` on RHEL is great, but it's a Red Hat-ism. Which is fine, I used to work at Red Hat, but still.
It's also pretty limited: you use service to start/stop/restart, but you still use systemctl to list services, or list /etc/init.d (technically /etc/rc.d/init.d on RHEL) on older boxes.
On Windows, to get services, it's `get-service`
Fun exercise for readers, given that you now know `restart-service` and `get-service`:
- Guess what the powershell command to get processes is.
- Guess what the powershell command to stop a process is.
- Guess what the Powershell command to install a package is.
There's some weird ones - dmidecode on Linux becomes get-wmiobject on Powershell (see the rosetta stone link posted earlier) - but for the most part it makes more sense than Linux and Unix.
- mcguire 11y agoRestart-Service:Windows :: service:RHEL ?
- vezzy-fnord 11y agoIt's not like 'systemctl' is the only game in town, though.
- deleted 11y ago[deleted]
- itaibn 11y agoYou say that as if that makes remembering things easier.
- tokenizerrr 11y agoWhat about service apache2 restart
- yellowapple 11y agoOr /etc/rc.d/apache2 restart, as one would find in the BSD world (and Slackware, with a bit of modification). This isn't to mention that it should be relatively trivial to map "restart-service $foo" to "/etc/rc.d/$foo restart" or "systemctl $foo.service restart" or whatever if one so chooses.
- nailer 11y agoSure you could write functions or aliases to everything to give them more predictable names. But you shouldn't have to.
- bbatha 11y agoFreeBSD uses the service command these days too.
- yellowapple 11y agoGood to know. In that case, "BSD Land minus FreeBSD and possibly its descendants".
- tokenizerrr 11y agoRegarding your edit: service works just fine on ubuntu as well
- tokenizerrr 11y agoAs do stop, start, and restart (as long as you have /sbin on your path)