• Introduction
  • Support
  • Glossary
  • License
  • Acknowledgement
  • Git Version Control
    • Git Basics
    • Git and Atom: GitLab
    • Git and Atom: GitHub
    • Git in the Command Line
    • Git Scenarios
  • Learning Linux
    • Learning Linux Commands
    • Essential Commands
      • Script: Backup
      • Script: Seconds
    • Managing Files
      • Script: Create Files
    • File Permissions
    • Working with Processes
    • Services
    • System Configuration
    • Environment Customization
    • Communication Protocols
    • Task Manager (crontab, at)
    • Bash Scripting
    • Command Line Shortcuts
  • Using the HPC
    • Overview
      • Hardware
      • Storage
      • Software
    • Prerequisites
    • Request an Allocation
    • Access your Allocation
    • Execute a Job
      • Working with C++
      • Working with Fortran
      • Working with Python
      • Working with Makefiles
      • More Job Details
    • Managing Jobs
    • Modules
      • CVMFS Modules
    • Compilers
    • Workflows
      • Crystal Workflow
  • Xsede Resources
    • IU/TACC Atmosphere on Jetstream
    • Using Jetstream Virtual Machines
  • Data Transfer and Storage
    • Moving Data
      • Graphical Client SFTP
    • Globus Data Transfer Tool
      • Globus Endpoints
      • Globus Transfers & More
      • Globus Command Line Interface
  • Tools
    • Docker Containers
    • Singularity Containers
Powered by GitBook
On this page
  • Before Starting
  • Initializing Your Environment
  • Know the Environment Variables
  • Working with the Environment Variables
  1. Learning Linux

Environment Customization

Before Starting

Consider these important facts:

  • Environment variables are all upper case.

  • To use their values, precede the name with a $.

Initializing Your Environment

Linux utilizes Bash as the default shell and when a session started it reads commands from ~/.bash_profile.

Environment variables are set in the file ~/.bashrc.

📝 Note: The files ~/.bash_profile and .bashrc are hidden. To list hidden files, type ls -a.

Know the Environment Variables

Here is a list of some common environment variables:

  • $HOME - Path of your home directory

  • $PATH - List of directories where the system checks for programs to run

  • $LD_LIBRARY_PATH - List of directories where the system checks for shared libraries to load

  • $HOSTNAME - The name of the host, e.g. tigris.doane.edu.

📝 Note: See the values of all your environment variables by typing env on your terminal.

Working with the Environment Variables

  • Display the value of an environment variable using echo:

    echo $HOME
    /home/UID
  • Modify the value of environment variables with export:

    export PATH=$PATH:/home/UID
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/UID/custom_lib_directory
  • Set a value for environment variables:

    export OMP_NUM_THREADS=12

    This command sets the value of the variable called OMP_NUM_THREADS (an OpenMP parameter) to 12.

PreviousSystem ConfigurationNextCommunication Protocols

Last updated 6 years ago