How to Use “export” Command in Linux [8 Practical Examples] | LinuxSimply

preview_player
Показать описание

Want to learn how to set environment variables, manage paths, and more ? The export command is there to help you in this scenario.

The export command is a built-in bash command that we can use to create environment variables. In this video, I have presented 8 practical examples demonstrating how to effectively use the "export" command in the Linux terminal. Whether you're a Linux user or a system administrator, these examples will guide you through setting environment variables, managing paths, and more. Enhance your command line proficiency and streamline your Linux experience.

💡 Key Topics Covered:
1. Understand the basics of export command, export command syntax and its options.
2. Learn how to view all exported environment variables.
3. Learn how to export a declared function
4. Learn how to export a declared variable
5. Learn how to remove specified variable/function from the environment
6. Learn how to export java installation path variable
7. Learn how to change the default language for the system
8. Learn how to export multiple variables
9. Learn how to set an email address to receive mail notifications

Embark on an exploration into Linux mastery, delving deep into the export command! Effortlessly manage your environment variables and functions. Subscribe now to immerse yourself in a comprehensive learning experience that will reshape your Linux skills.

Content Index
0:00 Introduction
0:13 What is export Command ?
1:10 Example 1: View All Exported Environment Variables
1:50 Example 2: Export Declared Function
2:47 Example 3: Export Declared Variable
3:40 Example 4: Remove the Specified Variable/Function from the Environment
4:40 Example 5: Export Java Installation Path Variable
5:27 Example 6: Change the Default Language For the System
6:26 Example 7: Export Multiple Variables
7:14 Example 8: Set an Email Address to Receive Mail Notifications

Instructor Details
Fahmid Bin Kibria

Editor Details
Reshma Raj

📚 ⯆ Read the Full Article
The “export” Command in Linux [8 Practical Examples]

Commands Used
--------------------------------
What is export Command ?
a. export [OPTION]... [[NAME]=[VALUE]]...
b. help export

Example 1: View All Exported Environment Variables
export
a. export -p

Example 2: Export Declared Function
a. myFunction() { echo "LinuxSimply";}
b. export -f myFunction
c. myFunction

Example 3: Export Declared Variable
a. myVariable=10
b. export myVariable
c. echo $myVariable

Example 4: Remove the Specified Variable/Function from the Environment
a. export -n myVariable
b. export | grep myVariable

Example 5: Export Java Installation Path Variable
a. export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
b. bash
c. echo $JAVA_HOME

Example 6: Change the Default Language For the System
a. export LANG=fr_FR.UTF-8
b. bash
c. echo $LANG

Example 7: Export Multiple Variables
a. x=1
y=2
z=3
b. export x y z
c. printenv x y z

Example 8: Set an Email Address to Receive Mail Notifications
b. bash
c. echo $MAIL
---------------------------------------------------------------------------

👉 Follow Us

#linux
#linuxsimply
#linuxtutorial
#ubuntu
#command
#export
Рекомендации по теме
Комментарии
Автор

really nice tutorial on export command
Thanks!.

danielgx
Автор

Thanks for turotial !!!! is the bettere that i found for export comand !!!!

gibbohack
welcome to shbcf.ru