source
Quick Reference
Command Name:
source
Category:
shell builtin
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
Syntax
source filename [arguments]
Options
| Parameter | Description |
|---|---|
filename |
The file containing shell commands to execute |
arguments |
Optional arguments that become positional parameters ($1, $2, etc.) in the sourced script |
Note: The source command has no specific options like --help or --version as it's a shell built-in command. The dot (.) command can be used as an alternative to source in Bash and is the standard in POSIX-compliant shells.
Examples
How to Use These Examples
The examples below show common ways to use the source command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.