Customizing Your Unix Environment

Article ID: 258
Last updated: 03 Dec, 2025

Taking the time to customize settings in your NAS environment will help make your workflow more convenient and efficient. This article covers some common user customizations that can be included in your startup configuration files, which contain information that is read by the Linux shell every time you log into the computer and/or open a new terminal window.

Common Shells and Their Startup Files

The current default shell is bash (unless you chose a different one in your NAS account request form). If you want csh to be your default, send a request to support@nas.nasa.gov.

bash
The startup file .profile is sourced when you log in. The file .bashrc is sourced when you start an interactive non-login shell.
csh
The startup files .cshrc followed by .login are sourced when you log in. The file .cshrc is sourced every time you start a new shell.

On your first login to a front end, such as a PFE, you can find the .profile, .login, and .cshrc files with default contents provided by NAS. You can modify them, or create new ones from scratch.

For the customization described below, you can choose which files to modify based on what changes you want to take effect.

With csh, it is common to include the following line in the .cshrc file to check whether a prompt exists:

if (! $?prompt) exit #exit if not interactive 

Important: If you want your customization to take effect for both interactive sessions (such as a login shell, new shell, or an interactive PBS shell) and non-interactive sessions (such as a PBS batch job), be sure to add them above this line.

Set Permission for New Files and Directories with umask

umask 077 

Sets the permission of all new files and/or directories to be read/write/execute by owner only.

umask 037 

Sets the permission to be read/write/execute by owner and readable by group members.

Load Software Modules

To use modules, be sure to include the following line in your startup configuration file:

  • For bash: source /usr/local/lib/global.profile
  • For csh: source /usr/local/lib/global.cshrc

No default software is loaded on NAS systems. If you want to automatically load some software when you log in, such as compilers and MPI library, use the module load command in your startup configuration file. For example:

module load comp-intel mpi-hpe

See Software on NAS Systems for more information.

Augment $PATH

If you normally use certain directory paths to find commands, scripts, or executables, you can add them to your path in your startup configuration file. You can add other directories to the path, such as the /bin directory under your $HOME, and the /u/scicon/tools/bin directory, where many useful, recommended tools are installed:

For bash: PATH=$PATH:$HOME/bin:/u/scicon/tools/bin 

For csh: set path = ($path ~/bin /u/scicon/tools/bin )

Set Aliases

Aliases allow you to replace one string with another string. For example, if you add the following line in your startup configuration file, the command ls -lrt is used whenever you type ls:

For bash: alias ll='ls -lrt'

For csh: alias ll 'ls -lrt'

Set Environment Variables

Set environment variables that you need regularly for the current shell and sub-shells. For example:

For bash: export CFDROOT=/u/your_nas_username/bin

For csh: setenv CFDROOT /u/your_nas_username/bin
Also read

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.