Sometimes we want to see the content of a Systemd unit file. One obvious way to do it is to just cat/vim the content of the unit file directly.

For example, to display the content of systemd-tmpfiles-clean.timer, we can perform the following step:

➜ systemctl status systemd-tmpfiles-clean.timer | grep Loaded
     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static)

➜ cat /usr/lib/systemd/system/systemd-tmpfiles-clean.timer;
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Daily Cleanup of Temporary Directories
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
ConditionPathExists=!/etc/initrd-release

[Timer]
OnBootSec=15min
OnUnitActiveSec=1d

But, can we do better than manually looking up the unit file and read it? Sure, can!

➜ systemctl cat systemd-tmpfiles-clean.timer
# /usr/lib/systemd/system/systemd-tmpfiles-clean.timer
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Daily Cleanup of Temporary Directories
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
ConditionPathExists=!/etc/initrd-release

[Timer]
OnBootSec=15min
OnUnitActiveSec=1d
       cat PATTERN...
           Show backing files of one or more units. Prints the "fragment" and "drop-ins" (source files) of units. Each file is
           preceded by a comment which includes the file name. Note that this shows the contents of the backing files on disk,
           which may not match the system manager's understanding of these units if any unit files were updated on disk and the
           daemon-reload command wasn't issued since.

           Added in version 209.

This is cool. You can learn more about this option in the man systemctl manual.