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.
Command | Description | Example |
---|---|---|
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.
Command | Description | Example |
---|---|---|
ls | Lists all files in the directory | ls |
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/folder | mv example.txt instructions.txt |
mv /downloads /programs | ||
rm [File Name] | Removes the specified file | rm example.txt |
rm -r [Folder Name] | Removes all files in a folder and the folder | rm -r programs |
cd [Directory Path] | Change your working directory | cd /home/user/programs |
Back out of current folder | cd ../ | |
Go back to user folder | cd ~ | |
pwd | Prints the path of your working directory | pwd |
mkdir [Folder Name] | Creates a new folder with the given name | mkdir programs |
rmdir [Folder Name] | Removes a folder as long as it's empty | rmdir programs |
File Commands
These commands are used to make changes to files or search through them if the file is very large.
Command | Description | Example |
---|---|---|
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 file | cat example.txt |
head [File Name] | Prints first 10 lines of the file | head example.txt |
tail [File Name] | Prints last 10 lines of the file | tail example.txt |
grep [Word] [File Name] | Finds every instance of a word in the file and prints it | grep 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.
Command | Description | Example |
---|---|---|
sbatch [Job Script] | Submits the specified job to the queue | sbatch job.pbs |
squeue | View the jobs that are currently running and jobs that are in queue | squeue |
scancel [Job ID] | Cancel the job using the assigned Job ID (the Job ID can be found when using squeue) | scancel 12345 |