UCL

UCL Department of Physics and Astronomy »

High Energy Physics

26 Jul 2025

UCL High Energy Physics

Shell Basics

The shell is the program that interprets your instructions (from keyboard or file). There are several alternatives available on UNIX but the default on our machines is bash.

Special characters

Shell variables

Globbing (wildcards)

Example

% ls
file1  file1.old  file2  file2.old  file3
% ls file?
file1  file2  file3
% ls file*
file1  file1.old  file2  file2.old  file3 
% ls file*.*
file1.old  file2.old 

Environment variables

Example

To tell the loader to check the current directory when looking for shared libraries.

export LD_LIBRARY_PATH=$PWD
      or
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH

Important environment variables

PATHlist of directories to search for executable files
LD_LIBRARY_PATHlist of directories to search for shared libraries
PWDmaintained by the shell: current working directory

Initialisation Files

/etc/profile

.bash_profile

.bashrc

History

Tab Completion

Previous section: Getting Started
Next section: Shell Process Control