mkunit show
Display the contents of a unit file.
mkunit show <name> [flags]
Description
The show command displays the contents of a unit file with syntax
highlighting. This is useful for quickly inspecting a unit's configuration without
opening an editor.
Arguments
| Argument | Description |
|---|---|
<name> |
Name of the unit (with or without extension) |
Flags
| Flag | Description | Default |
|---|---|---|
--system |
Show a system unit | false |
--no-color |
Disable syntax highlighting | false |
--path |
Only print the unit file path | false |
Examples
Show a user service
mkunit show myapp
Output:
# /home/user/.config/systemd/user/myapp.service
[Unit]
Description=myapp service
After=network.target
[Service]
Type=simple
ExecStart=/home/user/myapp/server
WorkingDirectory=/home/user/myapp
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
Show a system service
mkunit show nginx --system
Get the file path only
mkunit show myapp --path
# Output: /home/user/.config/systemd/user/myapp.service
Pipe to another command
mkunit show myapp --no-color | grep ExecStart
Show a timer unit
mkunit show backup.timer
See Also
- mkunit edit - Edit unit files
- mkunit validate - Validate unit files
- mkunit list - List all units