Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

How it works...

In this section, we're using the systemctl command to query systemd.

We'll get gradually more granular with our requests, until we've eventually built a query that shows us only what we want to see, that being services that are running right-this-second.

There's an argument to be made for using pipes and grep to accomplish what you want and, depending on your preference, you may find one of these two commands neater than the other, though they accomplish roughly the same thing:

$ systemctl --no-pager | grep service | grep running | column -t

In the previous, we're first printing the default "all" list from systemctl, then we're passing it through grep a couple of times to filter what we want, and finally we're displaying it ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content