<<

Viewing and editing text files

Print entire content of file ​ ​ file Similar to , but with additional features Beta Cheat Sheet ​ Guide to general Linux (Bash) and Slurm commands file Print first 10 lines of file ​ ​ ​ ​ ​ ​ ​

file Print last 10 lines of file ​ ​ ​ Accessing Beta nano Simple, easy to use text editor

Logging in from a terminal (Duo required) vim Minimalist yet powerful text editor ssh [email protected] ​ ​ emacs Extensible and customizable text editor

Transferring files between Beta and your system scp source [email protected]:destination Advanced file management ​ ​ ​ scp -r source [email protected]:destination ​ ​ ​ Change read//execute permissions scp [email protected]:source destination ​ ​ ​ ​ ​ cmd List the full file path of a command ​ GUI Clients cmd List all related file paths (binary, source, ​ PuTTY SSH client for Windows manual, etc.) of a command

WinSCP SCP client for Windows dir List size of and its subdirectories ​ FileZilla FTP client for Windows, Mac, and Linux 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 working directory Lists all environment variables List the files in the current directory export var=val Create $var with value ​ ​ ​ ​ ​ val ls -lh Show long, human-readable listing $var Print the value of variable $var ls dir List files inside directory dir ​ ​ ​ ​ .bashrc File that defines user aliases and variables rm file Delete file ​ ​ 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 overall 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 Copy 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 character count mv file1 dir Move file1 into directory dir ​ ​ ​ ​ Find and print text matching a regular ~ (tilde) Home directory 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 replace tar xzf file Extract a gzip compressed tarball (common ​ Extensive tool for complex filtering tasks extensions, .tar.gz and .tgz) ​ ​ ​ ​ arc-ts.umich.edu/beta Revised 11/2018 ​ Beta directories #SBATCH directives and #PBS counterparts

/home/uniqname For use with running jobs, 80 GB quota #SBATCH #PBS Description ​ --job-name==name -N name Job name /tmp Small file reads/writes, deleted after 10 days ​ ​ --account=name -A name Account to charge ( /scratch Large file reads/writes, purged periodically ​ ​ ​ on Beta) /afs Only on login node, 10 GB backed up --partition=name -q name Submit to partition: ​ ​ standard, gpu. Lmod largemem, debug

module keyword string Search for module names or --=-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 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: module save collection Save all currently loaded modules to jobName-jobID.log ​ collection --error=%x-%j-E.log -e filepath Standard error log ​ ​ module savelist Return all saved module collections --export=ALL - Copy environment

module describe Return all modules in collection --export=var=val -v var=val Copy env variable ​ ​ ​ ​ ​ ​ ​ collection --depend=var:jobid - Job dependency states ​ ​ ​ module restore Restore all modules from collection depend=var:jobid (var): after, afterok, ​ ​ ​ ​ ​ ​ collection afterany, afternotok ---user=email -M email Email for job alerts ​ ​

Slurm --mail-=type -m type Email alert types: BEGIN, ​ ​ sbatch filename Submit a job script filename END, NONE, FAIL, ​ ​ REQUEUE squeue -u uniqname Show job queue for user uniqname --nodelist=nodes n/a Preferred nodes ​ ​ ​ scancel jobid Delete job jobid --exclude=nodes n/a Nodes to avoid ​ ​ ​ scontrol hold jobid Hold job jobid ​ ​ scontrol release jobid Release job jobid ARC-TS custom commands ​ ​ sinfo Cluster status my_usage Usage in CPU minutes srun Launch parallel job step my_accounts Show account membership and resource limits sacct Display job accounting information slurm-quota -s Show user disk quota and usage

Slurm Environment Variables ARC-TS Documentation & Support SLURM_JOBID Job ID Beta User Guide: https://arc-ts.umich.edu/beta/user-guide ​ SLURM_SUBMIT_DIR Job submission directory Email [email protected] for further Beta support ​ ​ ​ SLURM_SUBMIT_HOST from which job was submitted Sensitive data should not be stored or processed on Beta ​ ​ SLURM_JOB_NODELIST Node names allocated to job SLURM_ARRAY_TASK_ID Task ID within job array SLURM_JOB_PARTITION Job partition

arc-ts.umich.edu/beta Revised 11/2018 ​