Make a locally written executable reportctl available by command name to all users.
Keep it separate from distribution-managed package files.
Which location is conventional?
/usr/local/bin is the conventional location for locally installed commands and is commonly included in users' PATH.
Detailed explanation
/tmp/reportctlIncorrect. /tmp is temporary and is not normally a shared command location.
~/bin/reportctlIncorrect. ~/bin is specific to one user's home directory.
/usr/local/bin/reportctlCorrect. /usr/local/bin is intended for local administrator-installed commands.
/var/log/reportctlIncorrect. /var/log is for log data, not executable commands.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' "$PATH" | tr ':' '\n' | grep -Fx /usr/local/bin || trueExpected result
PATHに含まれる環境では/usr/local/bin。最小環境では出力なしKey points
- /usr/local is for local additions
- bin contains commands
- PATH and execute permission still matter
Notes
- Environment: FHS準拠Linux / 読み取りのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Shell function
A reusable group of commands that runs in the caller's shell context.
Positional parameter
A numbered argument or special value supplied to a script or function.
Control flow
Conditions, loops, and exit statuses determine which shell commands run.