3. Introduction to Linux and High-Performance Computing#
An OS is a resource manager that is used to access system resources by users and application programs. Linux is an open source OS developed by Linus Torvalds. Linux is based on Unix, and therefore shares much of its functionality with other unix based operating systems (such as MacOS.) Linux is the most widely used OS in computational research groups and runs much of the internet because it is freely available.
3.1. The Linux Terminal#
Please make sure you can open a terminal
You issue commands in the terminal
more complicated than you’re used to, but much more powerful once mastered
this lets you navigate file systems, edit files, and run code
start by typing
ls
ls
lists files in your current directorymost common command
3.1.1. Moving Through File Structures#
run
pwd
This stands for “print working directory”
shows you where you are
you’re inside a file system in your “home directory”
There is the “root” directory which is “/” and a few beneath it
“Users” is where user home directories are kept
3.1.1.1. The ls Command#
run
ls -F
shows the slashes
run
ls -F /
ls -f /tmp
ls --help
for helpman ls
give the manual (press “q” to exit this)ls -j
doesn’t workwhat does
ls -l
do?ls -F -a
to see hidden files
3.1.1.2. The cd Command#
cd
lets you change directoriescd /
this takes us to the root directory
cd ~
tidle is always your home directory
.
is the current directory..
is one directory upcd .
cd ..
3.1.1.3. Quick Problem#
if pwd
shows /Users/thing
what will ls -F ../backup
display
3.1.1.4. Making Files and Directories#
mkdir
makes directoriesmkdir thesis
cd data
nano draft.txt
write something
ctrl + X
saves and quits^
isctrl
editing files in terminal is important for research
Questions
3.1.1.5. Removing Files#
be extremely careful
no recycle bin in linux
rm [filename]
rm -r
for folders
3.1.1.6. Running Code#
for our purposes we’ll use
python [program name]
make a python script
run script
3.1.2. Scripts, Environments, and Aliases#
terminals are running a “shell” program. Most commonly, basic shell, or “bash” (other options: c shell, fish, etc.)
shell commands can be strung together and combined with loops/conditions to form “scripts” (usually .sh files)
by default, a “run commands” or “rc” script will be run when the shell starts (usually ~/.bashrc)
shells can access “environment variables” which tell them where files live (e.g. \(PATH, \)PYTHONPATH)
aliases can be used to create shortcuts and make new commands
3.1.3. Using ssh To Get Onto The Supercomputer#
ssh is a secure remote linux terminal
can be done through other programs on windows like Putty
ssh -X [username]@pace-ice.pace.gatech.edu
-X
allows visual data to be sent to your computer
3.2. Linux Cluster Supercomputers#
pace is a Linux cluster supercomputer
It is several computers all running linux connected together
Supercomputers are not one big fast computer, it is many reasonably fast computers connected together
If you want to learn more about PACE-ICE works, you can visit [PACE-ICE]{https://pace.gatech.edu/pace-ice-instructional-cluster-environment-education}.