Commands

The HPC responds to UNIX commands and knowing how to use these commands is important when using the HPC. The commands in the command tables are not an exhaustive list of commands but rather a list of common commands that are frequently used when interacting with the HPC. 

Local Commands

These commands should be run on your machine and not on the HPC. Open Command Prompt and replace the [CatID] with your CatID to connect to the HPC or upload files you want to run on the HPC.

CommandDescriptionExample
ssh [Server Login]

Allows you to remotely connect to a server (the HPC) and run commands

RUN ON YOUR LOCAL MACHINE

ssh [CatID]@login.hpc.uni.edu
scp [File Path] [Server Login]:[Path]

Sends the specified file on your local machine to the HPC 

RUN ON YOUR LOCAL MACHINE

scp "example.txt" [CatID]@login.hpc.uni.edu:/home/[CatID]

 

 

Navigation Commands

These commands will be used on the HPC to navigate the different directories and make changes within the directories. You can run these commands in Command Prompt after you use the (local) ssh command to connect to the HPC. You can also use software like PuTTY to connect to the HPC and use these commands, but it isn't necessary.

CommandDescriptionExample
lsLists all files in the directoryls
cp [File Name] [File Name]Copy the contents of the first file to the second file. cp example.txt instructions.txt
cp -r [Folder Name] [Folder Name]Copy the contents of the first folder to the second folder. cp -r /downloads /programs
mv [Name] [Name]Moves the contents of the first file/folder to the second file/foldermv example.txt instructions.txt
  mv /downloads /programs
rm [File Name]Removes the specified filerm example.txt
rm -r [Folder Name]Removes all files in a folder and the folderrm -r programs
cd [Directory Path]Change your working directorycd /home/user/programs
 Back out of current foldercd ../
 Go back to user foldercd ~
pwdPrints the path of your working directorypwd
mkdir [Folder Name]Creates a new folder with the given namemkdir programs
rmdir [Folder Name]Removes a folder as long as it's emptyrmdir programs

 

 

File Commands

These commands are used to make changes to files or search through them if the file is very large.

CommandDescriptionExample
nano [File Name]Opens nano file editor and allows you to make changes to the file.nano example.txt
emacs [File Name]Opens emacs file editor and allows you to make changes to the file.emacs example.txt
chmod [Mode] [File Name]Change the mode of the file, this is useful if you want to make a file executable. The example shown would make example.txt an executable file.chmod +x example.txt
cat [File Name]Prints contents of the filecat example.txt
head [File Name]Prints first 10 lines of the filehead example.txt
tail [File Name]Prints last 10 lines of the filetail example.txt
grep [Word] [File Name]Finds every instance of a word in the file and prints itgrep why example.txt

 

 

Slurm Commands

Slurm commands are used when submitting or examining jobs that are submitted to the cluster. You can examine current jobs, create new ones, or terminate jobs. You can also check the queue and HPC resources. It is recommended you read about scripts before you use any of these commands.

CommandDescriptionExample
sbatch [Job Script]Submits the specified job to the queuesbatch job.pbs
squeueView the jobs that are currently running and jobs that are in queuesqueue
scancel [Job ID]Cancel the job using the assigned Job ID (the Job ID can be found when using squeue)scancel 12345