<<

Viewing and editing text files

Print entire content of file Great Lakes Cheat Sheet file Prints content of file page by page Guide to general L inux () a nd S lurm ommands file Print first 10 lines of file

file Print last 10 lines of file Accessing Great Lakes nano Simple, easy to use

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 i nput uniqname@ greatlakes-xfer.arc-ts.umich.edu:o utput Advanced file management scp - i nput uniqname@ greatlakes-xfer.arc-ts.umich.edu:o utput scp u niqname@ greatlakes-xfer.arc-ts.umich.edu:i nput o utput Change read//execute permissions

cmd List the full file of a command GUI Clients PuTTY SSH client for Windows cmd List all related file paths (binary, source, manual, etc.) of a command WinSCP SCP client for Windows dir List size of and its subdirectories FileZilla FTP client for Windows, Mac, and Find file in a directory

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

ls dir List files inside directory dir $var Print the value of variable $ var file Delete file .bashrc File that defines user aliases and variables

dir Create empty directory called dir Input and output redirection 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 over all command

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 file1 file2 file1 as file2 cmd1 | cmd2 Pipe the output of cmd1 to cmd2 cp file1 dir Copy file1 into directory dir Filters file1 file2 Rename file1 as file2 Word, line, and char acter count mv file1 dir file1 into directory dir Find and text matching a regular ~ (tilde) expression . (period) Current (working) directory Sort input .. (2 periods) Parent directory Filter duplicate lines wget URL Download a file from Internet URL Cut specific fields or columns unzip file .zip Extract a ZIP file Stream editor for search and xzf file Extract a compressed tarball (common Extensive tool for complex filtering tasks extensions: .tar.gz and .tgz )

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=n ame -N n ame Job name /scratch Large file reads/writes, pur ged periodically --account=n ame -A n ame Account to charge /afs Only on login node, 10 GB backed up --partition=n ame -q n ame Submit to partition: standard, gpu. viz,

largemem, oncampus, Lmod

module keyword string Search for module names or --=d d-hh:mm:ss -l walltime=t ime Time limit (walltime) descriptions matching string --nodes=c ount -l nodes=c ount Number of nodes

module spider string Search for modules matching string --tasks-per-node=c ount -l ppn=c ount Processes per node

module avail Show modules that can be loaded --cpus-per-task=c ount n/a CPU cores per process now --mem=c ount -l mem=c ount RAM per node (e.g. module load module Load module in the environment 1000M, 1G)

module show module Show the and variables set by --mem-per-cpu=c ount -l pmem=c ount RAM per CPU core module --gres=gpu:c ount -l gpus=c ount GPUs per node module list List currently loaded modules --nodelist=n odes -l nodes=n odes Request nodes module unload module Remove module from environment --array=a rrayspec -t a rrayspec Define job array module purge Remove all modules from --output=% x-%j.log -o filepath Standard output in run environment directory, formatted: module save collection Save all currently loaded modules to jobName-jobID.log collection --error=% x-%j-E.log -e f ilepath Standard error log

module savelist Return all saved module collections --export=ALL - Copy environment

module describe Return all modules in collection --export=v = v al -v v ar= v al Copy env variable collection --depend=v ar: j obid - Job dependency states module restore Restore all modules from collection depend=v ar: j obid (v ar) : after, afterok, collection afterany, afternotok ---user=e mail -M e mail Email for job alerts

Slurm --mail-=t ype -m t ype Email alert types: BEGIN, sbatch filename Submit a job script filename END, NONE, FAIL, REQUEUE squeue -u user OR sq user Show job queue for user --exclude=n odes 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 allel job step home-quota Show home quota and usage per user sacct Display job accounting Show scr atch quota and usage per scratch-quota 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 from which job was submit ted GL User Guide: ht tps://arc-ts.umich.edu/greatlakes/user-guide SLURM_JOB_NODELIST Node names allocated to job OnDemand/remote desktop: ht tps://greatlakes.arc-ts.umich.edu SLURM_ARRAY_TASK_ID Task ID within job arr ay Email [email protected] 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