top of page
uni datacenter

Useful CLI Commands (Command Line Interface)

Updated: Jul 21, 2024

For beginners, learning the Command Line Interface could be a vital tool in your arsenal. Master CLI commands to easily navigate between High-Performance Computing (HPC) clusters and your personnel computer.


Here are some of the most helpful CLI commands -


Manuals

  • man <command>: Show manual for <command>. This is a great tool to start the learning journey. Whenever you are in doubt how to use a particular <command>, you should try to use the 'man'.


Directory Path

  • pwd: Shows the complete path to the current directory.


Show Directory Content

  • ls: list the contents of the current directory. This is a wonderful tool to check the directory's content while navigating through directories in the Command Line Interface.

  • ls -a: List the contents of the current directory including the hidden files.

  • ls -l: List the content of the current directory including the information related to the files, e.g., permissions, user and user-group who created the files, size, and date.


Create Directory

  • mkdir <path / foldername>: Creates a directory named <foldername> at the specified <path>. Since no path is specified, the new folder is created at the current directory.


Change Directory

  • cd <foldername>: Changes the current directory to the specified location at <foldername>.

  • cd : Changes the current directory to the $home directory.

  • cd - : Go to the last accessed directory.

  • cd ../ : Go to the upper directory


File Editors

  • Vim

  • Emacs

  • Nano


Copy Files

  • cp <source> <destination> : Copies files from the <source> path to the <destination> path.

  • cp -r <source> <destination> : Copies folders/directories recursively from the <source> path to the <destination> path.


Move Files

  • mv <source> <destination> : Move the files from <source> path to the <destination> path.


Remove Files

  • rm <filename> : Remove the file at the path <filename>.

  • rm -r <foldername> : Remove the folder from the path <foldername> recursively.


File Viewers

  • cat <filename> : Prints the content of the file on the terminal.

  • less <filename> : Opens the file in read-only mode.

  • head <filename> : Prints the first 10 lines of the file on the terminal.

  • tail <filename> : Prints the last 10 lines of the file on the terminal.


If you have any queries or problems related to logging into your computing space, please contact cluster-admin@uni-datacenter.com.


 
 
bottom of page