Basic Linux Commands

RSPH HPC runs on the Linux operating system, similar to how your personal computer might run Windows or Mac OS. However, unlike Windows or Mac OS, our system does not utilize a graphical user interface (GUI) where you can use a mouse to navigate and initiate commands. Instead, we use a command-line interface (CLI), where the user types in commands which are then processed and text output is displayed on the screen. The default shell used is Bash. Bash may seem complicated to learn at first, but with just a small handful of commands, you can do anything that you would usually do with a mouse. In fact, once people become proficient in Bash, many of them prefer it over graphical interfaces due to its versatility and performance.

Below, we have compiled a list of common commands and usage examples. For more information, check out one of these references:

Linux Commands Reference List:

  • ls list: Lists the files and directories located in the current directory
  • cd change directory: this allows users to navigate in or out of file directories
  • mv move: used to move a file or directory to another location
  • cp copy: used to copy a file or directory to another location
  • man manual: displays documentation for commands Note: Use up and down arrows to scroll through the text. To exit the manual display, press ‘q’
  • mkdir make directory: creates a directory with the specified name
  • rmdir remove directory: deletes a directory with the specified name Note: rmdir only works on empty directories
  • rm remove: deletes file or files with the specified name(s)
  • nano nano text editor: opens the nano text editor Note: To access the menu options, ^ indicates the control (CTRL) key.
  • clear clear: clears the screen of all input/output
  • less less: opens an extended view of a file Note: Use up and down arrows to scroll through the text. To exit the extended view, press ‘q‘
  • cat concatenate: sends file contents to standard input – used frequently with pipes

Text Editing

Basic text editing tools include nano, vi/vim, emacs, etc. For beginners, we recommend using nano since it is more user-friendly. Please refer to this page for a detailed demonstration of nano.