'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.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ortomala Lokni