What does source in Linux console commands mean?

From time to time you will come across this syntax

Using the source command when running a script guarantees the script is run with the current environment variables in the current shell. Instead of using source you could also use a “.” like this:

This method to run a script should not be confused with more common way to run scripts or programs with a leading “./”.

The use of “./” will use a new shell for the the script. Therefore the script will not be able to use current environment variables.


(172 Posts)

20 years of coding and working as software engineer but I am still eager to learn more. I am very passionate when it comes to open source, Linux and Java. But I made my peace with Windows long ago to fully enjoy my PC gaming hobby. I have a soft spot for 90s electronic music and Babylon 5. In the evenings you will find me roaming the endless space in Warframe (IGN k05h).