Cheat sheet for bash and SLURM
HPC
Bash
Slurm
Quick reference cheatsheet for frequently used bash commands and SLURM commands to submit or manage jobs on a HPC
Bash quick reference
| Command | Purpose | Example |
|---|---|---|
~ |
Your home directory | cd ~ |
/ |
Filesystem root and path separator | cd /scratch |
pwd |
Print working directory | pwd |
ls |
List files and directories | ls -lh results |
cd |
Change directory | cd data/raw |
cd .. |
Move up one directory | cd .. |
mkdir -p |
Create directory/directories | mkdir -p logs results |
head |
Show the beginning of a file | head -n 5 file.txt |
less |
View a file interactively; press q to exit |
less file.txt |
grep |
Search for text in a file | grep "value" file.txt |
wc -l |
Count lines | wc -l file.txt |
curl -L -o |
Download URL into a named file | curl -L -o file.txt URL |