<<

Viewing and editing text files

ACCRE Cheat Sheet Print entire content of filename ​ ​ Guide to Linux, Lmod and SLURM commands file Incrementally display content of filename ​ ​

less file Similar to more, but with additional features ​ file Display file header Accessing ACCRE ​ file Display file footer ​

Logging in from a terminal emacs Extensible and customizable text editor ssh [email protected] vim Minimalist yet powerful text editor ​ ​ nano Simple text editor Transferring files between ACCRE and your system scp source [email protected]:destination ​ ​ ​ ​ ​ scp [email protected]:source destination More advanced file management ​ ​ ​ ​ ​ Changes read//execute permissions Windows/Mac clients: cmd Lists the full file of a command PuTTY SSH client for Windows ​ whereis cmd Lists possible file paths of a command WinSCP SCP client for Windows

dir Lists size of dir and its FileZilla FTP client for Linux, Windows, Mac ​ ​ ​ ​ subdirectories

Xming/XQuartz X11 server for Windows/Mac Finds files in a directory

Basic Linux file management Aliases and system variables man command Displays the manual page for command ​ ​ Automatically one command with

Prints out the present another

Lists the files in the current directory env Lists all system variables

ls -lh Show long listing of files export var=val Create $var and set ​ ​ ​ ​ ​ ls -a Show hidden files as well value to val ​ ls dir Lists files inside directory dir Print text to the screen ​ ​ file Deletes file echo $var Print the value of variable var ​ ​ ​ ​ dir Creates empty directory called dir .bashrc Define default aliases and system variables ​ ​ dir Removes empty directory dir ​ ​ Input and output redirection rm -r dir Removes directory dir and all of its content ​ ​ ​ ​ ​ ​ $(command) Runs the command inside $() first, then inserts dir Changes directory to dir ​ ​ ​ ​ the output to the rest of the command. Same as

cd .. Changes working directory to parent putting grave marks (`) between the command

cd Changes working directory to home < Standard input redirection

file1 file2 file1 into file2 > Standard output redirection ​ ​ ​ ​ ​ ​ cp file dir Makes a copy of file file inside directory dir 2> Standard error redirection ​ ​ ​ ​ ​ ​ file1 file2 Renames file file1 as file2 2>&1 Standard error and output redirection ​ ​ ​ ​ ​ ​ mv file dir Moves file file inside directory dir cmd1 | cmd2 Pipe command; redirects output of command ​ ​ ​ ​ ​ ​ ​ ​ cmd1 to input of cmd2 cp -i, mv -i Display a warning before copying or moving to ​ ​

an existing file path

Filters rm -i Display a warning before removal

Word count ~ (tilde) Home directory

Gets a regular expression and prints it . (period) Current directory

Sort input .. (double dot) Parent directory

Filter duplicate lines wget URL Downloads a file from URL in Internet ​ ​ ​ Cuts specific fields or columns unzip file.zip Extract a ZIP file ​ ​ Stream editor for search and replace xzf Extract a gz compressed tarball

file.tar.gz Extensive tool for complex filtering tasks ​

vanderbilt.edu/accre ● Hill Center Suite 201 ● 1231 18th Ave. South, Nashville, TN 37212-2807 Revised 11/2018 ​ Cluster directories #SBATCH directives (continued)

/home GPFS, backed up nightly --=min Time limit; either min or ​ -hh:mm:ss /data GPFS, backed up nightly

--mem=count RAM per node; e.g. 5G /dors GPFS, backed up nightly ​

--output=file Standard output; defaults to /scratch GPFS, higher quotas, not backed up ​ slurm-jobid.out if omitted ​ ​ /tmp Temporary local storage for I/O intensive tasks --error=file Write standard error to file ​ Lmod --array=arrayspec Define job array ​ ​ --gres=gpu:cores GPUs per process module avail Shows all available modules ​

--mail-user=email Email for job alerts module load module Loads module in the environment ​ ​ ​ ​ ​ --mail-=type Email alert types: BEGIN, END, FAIL, module spider string Searches for module names ​ ​ REQUEUE, ALL matching string ​ --account=account Account to charge module keyword string Searches for modules containing ​ ​ string in name or description --depend=state:jobid Job dependency. state = after, ​ ​ ​ ​ ​ ​ afterok, afterany, afternotok module list List currently loaded modules

--job-name=name Job name module unload module Removes module from environment ​ ​ ​ ​ --constrain=attribute Request CPU type: westmere, module purge Removes all modules from ​ sandy_bridge, haswell, eight, twelve, environment sixteen

module save collection Saves currently loaded modules to ​ --partition=name Submit to partition: production , collection ​ , maxwell, pascal

module savelist Returns all saved modules

collections SLURM Environment Variables module describe Get modules in a saved collection ​ SLURM_JOBID Job ID

module restore Restore modules from collection ​ SLURM_SUBMIT_DIR Job submission directory collection SLURM_SUBMIT_HOST Name of host from which job was

SLURM submitted ​ SLURM_JOB_NODELIST Names of nodes allocated to job sbatch filename Submits a job script filename ​ ​ SLURM_ARRAY_TASK_ID Task id within job array squeue -u vunetid Show job queue for user vunetid ​ ​ SLURM_JOB_CPUS_PER_NODE CPU cores per node allocated to job scancel jobid Deletes the job with jobid ​ ​ SLURM_NNODES Number of nodes allocated to job scontrol hold jobid Hold job jobid ​ ​ scontrol release jobid Release job jobid ​ ​ ACCRE-specific utilities sinfo Cluster status ​ accre_storage Check storage quota usage

salloc Starts an interactive job rtracejob jobid Check resources utilization for job ​ xalloc Starts an interactive job with X jobid

window support q3 Get recent jobs by user, group and

srun Launch parallel job step account

sacct Display job accounting information qSummary -g group Queue summary for group and its ​ ​ ​ users

#SBATCH directives showLimits -g group Get resource limits for specific ​ --nodes=count Number of nodes group ​ --tasks-per-node=count Processes per node SlurmActive Show cluster’s CPU/node utilization ​ --ntasks=count Total processes gpustate Show GPU cluster utilization ​ --cpus-per-task=count CPU cores per process sinfofeatures Get node availability based on ​ features --nodelist=nodes Preferred nodes ​ --exclude=nodes Nodes to avoid ​

vanderbilt.edu/accre ● Hill Center Suite 201 ● 1231 18th Ave. South, Nashville, TN 37212-2807 Revised 11/2018 ​