I am trying to grep some of the services but it does not print exactly what I am looking for.
One thing I see in the grep strings is that the names are having dot . jointed names.
I am trying below but not getting the desired output.
# systemctl list-unit-files | egrep -w "autofs.service|sssd.service"
autofs.service disabled
sssd-autofs.service indirect
sssd.service disabled
or
# systemctl list-unit-files | egrep "autofs|sssd[.service]"
autofs.service disabled
sssd-autofs.service indirect
sssd.service disabled
sssd-autofs.socket disabled
Expected Output:
# systemctl list-unit-files | egrep -w "autofs.service|sssd.service"
autofs.service disabled
sssd.service disabled