ico4 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.

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/copy will 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 general cp command, a new location or name must be specified.

  • mv path/to/file path/to/destination moves the file of interest without copying its contents.

  • rm path/to/file removes a single file. This cannot be undone. Once files are removed, the action is permanent.

  • rm -rf path/to/file removes 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/destination will download a file from the Cluster to your computer (where KUID is your KU Username). It is important to cd to 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/destination will download a directory and its contents (including subdirectories and their associated files).

  • stat path/to/file displays information including the size, creation date, and modify date for a file.