steve
steve

Reputation: 63

What does "source" do in Mac iTerm2 terminal?

I put in the command source followed by my file path and I was wondering what the source command does in the iTerm2 terminal?

Any help on this would be welcome.

Upvotes: 2

Views: 2584

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62723

source is a shell builtin related to a shell such as tcsh, bash, or zsh and not to a terminal application such as iTerm2.

According to man source:

Shell builtin commands are commands that can be executed within the running shell's process.

You can find more details, in the zsh manual:

source file [ arg ... ]

Same as ‘.’, except that the current directory is always searched and is always searched first, before directories in $path.

and

. file [ arg ... ]

Read commands from file and execute them in the current shell environment.

In few words, source file executes the commands in file.

Upvotes: 3

Related Questions