When you’re managing your shell’s variables and you wish to save them to your environment you can use the export command. In this article, we will show you the basic usage of the Linux export command.
Basic export usage
MY_VARIABLE=42 export MY_VARIABLE
Editing your Linux user’s PATH
PATH=/path/to/add:$PATH export PATH
Exporting a function
function MY_FUNC() { echo "In MY_FUNC" } export -f MY_FUNC