0% found this document useful (0 votes)
127 views3 pages

Linux & Slurm Commands Guide

UMich supercomputers

Uploaded by

Yujie Liu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views3 pages

Linux & Slurm Commands Guide

UMich supercomputers

Uploaded by

Yujie Liu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Viewing and editing text files

cat file Print entire content of file

Great Lakes Cheat Sheet less file Prints content of file page by page
Guide to general Linux (Bash) and Slurm commands head file Print first 10 lines of file
tail file Print last 10 lines of file
Accessing Great Lakes
nano Simple, easy to use text editor
Logging in from a terminal (Duo required) vim Minimalist yet powerful text editor
ssh uniqname@greatlakes.arc-ts.umich.edu
emacs Extensible and customizable text editor
Transferring files between Great Lakes and your system
scp input uniqname@greatlakes-xfer.arc-ts.umich.edu:output Advanced file management
scp -r input uniqname@greatlakes-xfer.arc-ts.umich.edu:output
scp uniqname@greatlakes-xfer.arc-ts.umich.edu:input output chmod Change read/write/execute permissions
which cmd List the full file path of a command
GUI Clients
PuTTY SSH client for Windows whereis cmd List all related file paths (binary, source,
manual, etc.) of a command
WinSCP SCP client for Windows
du dir List size of directory and its subdirectories
FileZilla FTP client for Windows, Mac, and Linux
find Find file in a directory

Basic Linux file management


Aliases and system variables
man command Display the manual page for command
alias Create shortcut to command
pwd Print out the present working directory
env Lists all environment variables
ls List the files in the current directory
export var=val Create environment variable $var with value
ls -lh Show long, human-readable listing val

ls dir List files inside directory dir echo $var Print the value of variable $var

rm file Delete file .bashrc File that defines user aliases and variables

mkdir dir Create empty directory called dir


Input and output redirection
rmdir dir Remove empty directory dir
$(command) Runs command first, then inserts output to the
rm -r dir Remove directory dir and all contents rest of the overall command
cd dir Change working directory to dir < Standard input redirection
cd .. Change working directory to parent > Standard output redirection
cd Change working directory to home 2> Standard error redirection
ls List the files in the current directory 2>&1 Standard error to standard output redirection
cp file1 file2 Copy file1 as file2 cmd1 | cmd2 Pipe the output of cmd1 to cmd2
cp file1 dir Copy file1 into directory dir
Filters
mv file1 file2 Rename file1 as file2
mv file1 dir Move file1 into directory dir wc Word, line, and character count

~ (tilde) Home directory grep Find and print text matching a regular
expression
. (period) Current (working) directory
sort Sort input
.. (2 periods) Parent directory
uniq Filter duplicate lines
wget URL Download a file from Internet URL
cut Cut specific fields or columns
unzip file.zip Extract a ZIP file
sed Stream editor for search and replace
tar xzf file Extract a gzip compressed tarball (common
extensions: .tar.gz and .tgz) awk Extensive tool for complex filtering tasks

arc-ts.umich.edu/greatlakes Revised 5/2020


Great Lakes directories #SBATCH directives and #PBS counterparts
/home/uniqname For use with running jobs, 80 GB quota #SBATCH #PBS Description

/tmp Small file reads/writes, deleted after 10 days --job-name=name -N name Job name

/scratch Large file reads/writes, purged periodically --account=name -A name Account to charge

/afs Only on login node, 10 GB backed up --partition=name -q name Submit to partition:


standard, gpu. viz,
largemem, oncampus,
Lmod debug

module keyword string Search for module names or --time=dd-hh:mm:ss -l walltime=time Time limit (walltime)
descriptions matching string --nodes=count -l nodes=count Number of nodes
module spider string Search for modules matching string --tasks-per-node=count -l ppn=count Processes per node
module avail Show modules that can be loaded --cpus-per-task=count n/a CPU cores per process
now
--mem=count -l mem=count RAM per node (e.g.
module load module Load module in the environment 1000M, 1G)

module show module Show the help and variables set by --mem-per-cpu=count -l pmem=count RAM per CPU core
module
--gres=gpu:count -l gpus=count GPUs per node
module list List currently loaded modules
--nodelist=nodes -l nodes=nodes Request nodes
module unload module Remove module from environment
--array=arrayspec -t arrayspec Define job array
module purge Remove all modules from --output=%x-%j.log -o filepath Standard output in run
environment directory, formatted:
jobName-jobID.log
module save collection Save all currently loaded modules to
collection --error=%x-%j-E.log -e filepath Standard error log
module savelist Return all saved module collections --export=ALL -V Copy environment

module describe Return all modules in collection --export=var=val -v var=val Copy env variable
collection
--depend=var:jobid -W Job dependency states
module restore Restore all modules from collection depend=var:jobid (var): after, afterok,
collection afterany, afternotok

--mail-user=email -M email Email for job alerts


Slurm --mail-type=type -m type Email alert types: BEGIN,
END, NONE, FAIL,
sbatch filename Submit a job script filename
REQUEUE
squeue -u user OR sq user Show job queue for user --exclude=nodes n/a Nodes to avoid
scancel jobid Delete job jobid
scontrol hold jobid Hold job jobid ARC-TS custom commands
scontrol release jobid Release job jobid my_usage Usage in CPU minutes

sinfo Cluster status my_accounts Show account membership and


resource limits
srun Launch parallel job step
home-quota Show home quota and usage per user
sacct Display job accounting info
scratch-quota Show scratch quota and usage per
account_root account
Slurm Environment Variables
maxwalltime Show walltime available for jobs
SLURM_JOBID Job ID (including upcoming maintenance)

SLURM_SUBMIT_DIR Job submission directory


ARC-TS Documentation & Support
SLURM_SUBMIT_HOST Host from which job was submitted
GL User Guide: https://arc-ts.umich.edu/greatlakes/user-guide
SLURM_JOB_NODELIST Node names allocated to job
OnDemand/remote desktop: https://greatlakes.arc-ts.umich.edu
SLURM_ARRAY_TASK_ID Task ID within job array
Email hpc-support@umich.edu for further Great Lakes support
SLURM_JOB_PARTITION Job partition
Sensitive data should not be stored or processed on Great Lakes

arc-ts.umich.edu/greatlakes Revised 5/2020


arc-ts.umich.edu/greatlakes Revised 5/2020

You might also like