Command Reference Template

Overview

Command: command-name

Purpose: One-sentence description.

Package:

  • Arch

  • RHEL/Fedora

  • Debian/Ubuntu

sudo pacman -S package-name
sudo dnf install package-name
sudo apt install package-name

Syntax

command [OPTIONS] ARGUMENTS

Essential Options

Option Description Example

-v, --verbose

Increase output verbosity

command -v action

-q, --quiet

Suppress output

command -q action

-f, --force

Force operation

command -f action

-n, --dry-run

Show what would happen

command -n action

Common Patterns

Pattern 1: [Basic Usage]

# Description of what this does
command basic-action
Example output
[expected output]

Pattern 2: [Intermediate Usage]

# More complex example
command --option value | other-command

Pattern 3: [Advanced Usage]

# Pipeline or complex operation
command action | grep pattern | awk '{print $2}'

Real-World Examples

Example 1: [Scenario Name]

Situation: Describe the real-world scenario.

# Solution
command specific-options

Example 2: [Another Scenario]

Situation: Another real-world use case.

# Solution with pipe
command action | xargs other-command

Example 3: [Scripting Usage]

#!/bin/bash
# Script demonstrating command in automation

result=$(command --quiet action)
if [[ $? -eq 0 ]]; then
    echo "Success: $result"
else
    echo "Failed" >&2
    exit 1
fi

Configuration

Config File Location

Distro System Config User Config

RHEL/Fedora

/etc/command/config

~/.config/command/config

Arch

/etc/command.conf

~/.config/command/config

Debian/Ubuntu

/etc/command/command.conf

~/.commandrc

Key Configuration Options

# /etc/command/config
[section]
option = value
another_option = value2

Integration with systemd

Service Status

systemctl status command.service
journalctl -u command.service -f

Timer (if applicable)

# /etc/systemd/system/command.timer
[Unit]
Description=Run command periodically

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target

Troubleshooting

Debug Mode

# Enable verbose/debug output
command --debug action
COMMAND_DEBUG=1 command action

Common Errors

Error Cause Solution

Permission denied

Missing sudo or wrong perms

sudo command or check file permissions

Command not found

Not installed or not in PATH

Install package or export PATH=$PATH:/path

Invalid option

Version mismatch

Check version: command --version

Quick Reference

# Most common commands - copy-paste ready

# Basic
command action

# With common options
command -v action

# Pipeline
command list | grep pattern

# Output to file
command action > output.txt 2>&1

See Also