Shell

source

Execute commands from a file in the current shell environment (same as dot command).

Synopsis

syntax
source FILENAME [ARGUMENTS]

Examples

Reload bash configuration
source ~/.bashrc
Load environment variables from .env file
source .env
Source using dot notation
. ./setup.sh
Source from process substitution
source <(kubectl completion bash)

About source

The `source` command execute commands from a file in the current shell environment (same as dot command). Shell commands configure your interactive environment — variables, aliases, history, and shell options.

The shell is your primary interface with Linux, and customizing it improves productivity. These commands work across bash, zsh, and other POSIX-compatible shells with minor differences.

The command accepts 0 commonly used flags shown above, though the full set of options is available in the man page (`man source`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Shell Commands

Other commands in the Shell category

Related tools