Say I run
systemctl | grep running | column -t
I get an output that looks like this:
init.scope loaded active running System and Service Manager
session-23.scope loaded active running Session 23 of user admin
auditd.service loaded active running Security Auditing Service
chronyd.service loaded active running NTP client/server
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
getty@tty1.service loaded active running Getty on tty1
gssproxy.service loaded active running GSSAPI Proxy Daemon
irqbalance.service loaded active running irqbalance daemon
named.service loaded active running Berkeley Internet Name Domain (DNS)
NetworkManager.service loaded active running Network Manager
nfs-idmapd.service loaded active running NFSv4 ID-name mapping service
nfs-mountd.service loaded active running NFS Mount Daemon
nfsdcld.service loaded active running NFSv4 Client Tracking Daemon
oddjobd.service loaded active running privileged operations for unprivileged applications
polkit.service loaded active running Authorization Manager
postfix.service loaded active running Postfix Mail Transport Agent
rpc-gssd.service loaded active running RPC security service for NFS client and server
rpc-statd.service loaded active running NFS status monitor for NFSv2/3 locking.
rpcbind.service loaded active running RPC Bind
rsyslog.service loaded active running System Logging Service
serial-getty@ttyS1.service loaded active running Serial Getty on ttyS1
smartd.service loaded active running Self Monitoring and Reporting Technology (SMART) Daemon
How can I maintain a similar output, but format the "DESCRIPTION" column so it's not splitting it into more columns based on the space? E.g. how do I format the 5th column in a readable manner like in the original output of systemctl
?
I have looked at this question which got me so close: https://stackoverflow.com/questions/6462894/how-can-i-format-the-output-of-a-bash-command-in-neat-columns
grep
in this context? How aboutsystemctl list-units --state=running