Quick Reference Guide access
Quick Reference Guide
Overview
This page provides a quick reference for basic Linux and Slurm concepts commonly used on a high-performance computing (HPC) cluster.
It is intended as a starting point for new users. The Linux section introduces basic terms, commands, and keyboard shortcuts. The Slurm section lists common job submission and job monitoring commands.
For introductory Linux training videos, see the Linux command videos.
How to use this page
Use the following sections based on what you need:
- Go to Linux definitions for basic terminology.
- Go to Linux commands for common file system and software commands.
- Go to Linux shortcuts for useful keyboard shortcuts.
- Go to Slurm commands for batch and interactive job commands.
Linux
Below are the minimum Linux definitions, commands, and shortcuts that are useful for working on an HPC cluster.
Linux definitions
| Term | Definition |
|---|---|
| Command | A word or set of letters typed into a terminal to make the computer do something. A command is executed by pressing Enter after typing it. |
| Command line | The line in the terminal where your cursor appears. This term is also used more generally to describe working without a graphical user interface, also called a command-line interface (CLI). |
| Command prompt | The text at the beginning of the command line, before your cursor. It often looks like [username@computername].
|
| Directory | Another word for a folder. The term is often shortened to dir in commands, documentation, and conversation.
|
| Terminal | A type of software that lets you interact with a computer by typing commands. A terminal can also be used to connect to a remote computer through a command-line interface. |
| Path | The location of a file or directory. A path is a series of directories that leads to a file or directory, for example /home/john/file.txt.
|
| First slash in a path | The first / in a path represents the root directory, which is the starting point of the Linux file system.
|
| Absolute path | A path that begins with /, meaning it starts from the root directory.
|
| Relative path | A path written relative to the current directory. It does not begin with /.
|
| Option | An extra letter or word placed after a command to modify its behavior, such as -x or --help.
|
Linux commands
Getting help
| Command | Description | Example |
|---|---|---|
command --help
|
Print a command's help output in the terminal. | ls --help
|
man command
|
Open a command's manual page. Press q to exit the manual.
|
man ls
|
Directories
| Command | Description | Example |
|---|---|---|
ls
|
List the contents of a directory. If no path is given, it lists the current directory. | ls /scratch/MyID
|
mkdir
|
Create a new directory at the specified path. | mkdir /scratch/MyID/workdir
|
cd
|
Change to a different directory. If no path is given, it changes to your home directory. | cd /scratch/MyID/workdir
|
rmdir
|
Remove an empty directory. | rmdir tmpdir
|
Files
| Command | Description | Example |
|---|---|---|
nano
|
Create or edit a file with the nano text editor. To save and exit, press Ctrl + X, then Y, then Enter.
|
nano sub.sh
|
cat
|
Print the contents of a file to the terminal. This is usually best for short files. | cat slurm-42342.out
|
less
|
View the contents of a file in a pager. This is usually better for longer files. | less slurm-42342.out
|
cp
|
Copy one or more files from a source path to a destination path. | cp /scratch/MyID/workdir/sub.sh /work/labgroup
|
mv
|
Move one or more files from a source path to a destination path. | mv /scratch/MyID/workdir/sub.sh /work/labgroup
|
rm
|
Remove a file. | rm oldfile.txt
|
rm -r
|
Remove a directory and all of its contents recursively. | rm -r /home/MyID/olddir
|
dos2unix
|
Remove DOS or Windows line endings from a file. | dos2unix file.txt
|
mac2unix
|
Remove older Mac-style line endings from a file. | mac2unix file.txt
|
Software
| Command | Description | Example |
|---|---|---|
ml spider <software name>
|
Check whether software is available and see which versions are installed. | ml spider Blast+
|
ml <software name>
|
Load a software module. | ml BLAST+/2.16.0-gompi-2024a
|
For more information, see the Software page and the software section of the FAQ.
Linux shortcuts
Terminal shortcuts
| Shortcut | Description |
|---|---|
Ctrl + l (lowercase L)
|
Clear the terminal screen. You can still scroll up to see previous output. |
| Up and down arrow keys | Cycle through previously entered commands. |
Tab
|
Auto-complete a file or directory name while typing a path. Press Tab twice to see multiple matches. |
Esc, then .
|
Cycle through arguments used in previous commands. |
Ctrl + w
|
Delete typed text on the command line one word at a time. |
Ctrl + c
|
Cancel typed text on the command line. |
less shortcuts
| Shortcut | Description |
|---|---|
Shift + g
|
Go to the end of the file. |
gg
|
Go to the beginning of the file. |
-N, then Enter
|
Show or hide line numbers. |
/SomePattern
|
Search forward through a file for text matching SomePattern. Press Enter again to continue searching for the same pattern.
|
?SomePattern
|
Search backward through a file for text matching SomePattern. Press Enter again to continue searching for the same pattern.
|
q
|
Exit less.
|
Slurm commands
Below are the minimum Slurm commands that are useful for working on an HPC cluster.
The first table lists standard Slurm commands. The second table lists GACRC wrapper commands that provide additional convenience or formatting.
Default Slurm commands
| Command | Description | Example |
|---|---|---|
sbatch
|
Submit a batch submission script to the cluster. | sbatch sub.sh
|
squeue
|
Check the status of currently running or queued jobs. Use --me to show only your jobs.
|
squeue --me
|
sacct -X
|
Check the status of your jobs started since midnight of the current day. The -X option shows one line per job.
|
sacct -X
|
sacct -X -S yyyy-mm-dd
|
Check the status of your jobs starting from a specified date. | sacct -X -S 2021-10-20
|
sacct -j jobID
|
Check the status of a particular job by job ID. | sacct -j 234213
|
scancel jobID
|
Cancel one of your running or queued jobs by job ID. | scancel 456781
|
sinfo
|
Check the status of partitions. | sinfo -p batch
|
GACRC Slurm commands
| Command | Description or equivalent | Example |
|---|---|---|
interact
|
Start an interactive job. This is similar to qlogin and provides additional flexibility.
|
interact -c 4 --mem 10gb --time 01:00:00
|
sq
|
Wrapper for squeue.
|
sq --me
|
sacct-gacrc -X
|
Wrapper for sacct.
|
sacct-gacrc -X
|
Related resources
Notes
This guide is intended as a quick reference. For fuller documentation, consult the related wiki pages and command help output.