source Command Generator
Execute a script in the current shell (source file [args])
Getting Started with source
## What is source?
The `source` command (also written as `.`) reads and executes a script **in the current shell** rather than a subshell. This means any variables, functions, or aliases the script defines stay available after it finishes. It is the standard way to reload shell configuration and load environment setup files.
## How to Use
1. **Set the File**: Enter the path to the script (e.g., `~/.bashrc`, `./setup.sh`). 2. **Add Arguments** (optional): Pass positional arguments the script expects (e.g., `arg1 arg2`). 3. **Copy & Run**: Paste the generated command into your terminal. Changes take effect immediately in the current shell.
Common Options
### Positional file argument
`source` takes the script path as its first argument: `source ~/.bashrc`.
### Positional arguments
Any remaining tokens become `$1`, `$2`, ... inside the script: `source ./setup.sh dev` makes `$1=dev` available within `setup.sh`.
### The `.` synonym
In POSIX shells, `.` is the same command: `. ~/.bashrc` is identical to `source ~/.bashrc`. Use `source` in Bash/Zsh for readability; use `.` for portability.
▶What is the difference between source and running a script directly?
▶Why doesn't `source .env` automatically load my variables into the environment?
▶How do I reload my shell config after editing ~/.bashrc?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee