Basic Terminal Commands
There are many commands which are most commonly used for both the terminal and the KU Cluster. Commonly used commands are shown below; however, many more commands can be found within the KU Cluster Wiki.
Efficient Typing in the Terminal
With increased use of the terminal, speedy commands can save time and frustration. All example toggles are for Mac… Windows will have similar methods but can be found online.
CTRL + Awill reset your terminal cursor to the first character in the prompt. Useful for uploading multiple files to the cluster with different names, instead of rewriting the wholescp file_name1 ...repeatedly for a list of uniquefile_name1, file_name2, ....CMD + Rwill clear the current terminal screen, leaving only the prompt line.CMD + Twill open a new terminal tab.CMD + Dwill open a new terminal tab next to the current tab. This can be really nice for quick copy-paste procedures.CTRL + Uwill clear the entire terminal prompt from whatever text may currently be typed.
Editing Files
To edit files, you can use either vi, emacs, or VSCode. It is recommended to either use vim (vi) or emacs unless you are familiar with VSCode.
Using VSCode as a visual guide when navigating the cluster can be extremely helpful. You can download files without typing the entire command, edit files with added navigation and debugging assistance, as well as quickly access files to edit. Steps to implement VSCode for ssh use can be found here.
Copying and Removing
To copy or remove files/directories, cp and rm are used.
cp path/to/original path/to/copywill copy a file to a new path. The path to the copy is required (if you are copying to the same directory, you can simply just type the name of the new copied file instead).cp -R path/to/original/ path/to/copy/will copy a directory to a new path. Similarly to the generalcpcommand, a new location or name must be specified.mv path/to/file path/to/destinationmoves the file of interest without copying its contents.rm path/to/fileremoves a single file. This cannot be undone. Once files are removed, the action is permanent.rm -rf path/to/fileremoves a directory and its included contents.
Other Helpful Commands
du -sh path/to/directory/displays the amount of memory associated to a directory.scp KUID@login1.hpc.crc.ku.edu:path/to/file path/to/destinationwill download a file from the Cluster to your computer (where KUID is your KU Username). It is important tocdto the location you want the file to be downloaded to prior to downloading it from the Cluster itself.scp -r KUID@login1.hpc.crc.ku.edu:path/to/file path/to/destinationwill download a directory and its contents (including subdirectories and their associated files).
stat path/to/filedisplays information including the size, creation date, and modify date for a file.