A basic knowledge of Linux is required in order to use HPC facilities. There are many tutorials on the web, just Google around and you will find them. We recommend this Online tutorial. You may want to print and keep handy our Linux Quick Reference Sheet for those who prefer a hard copy.
Linux is derived from Unix, and many of its commands are identical with, or very similar to, older Unix commands. Since Apple’s Mac OS X is also derived from a version of Unix (BSD Unix), many of these commands are the same as on a Mac.
Typically one interacts with a Unix/Linux system using a Command Line Interface (CLI), also known as a Terminal, a Shell or a Command Prompt. Instead of pointing mouse and clicking on menus and buttons you need to type text commands to perform specific tasks. Since you can directly control the computer by typing, many tasks can be performed more quickly, and some tasks can be automated saving you, potentially, loads of time in the process.
Some of the more common commands that just about everyone uses are listed below:
man <command>
- shows the manual page for the given <command>, press q to exit manual pagespwd
- “print working directory” prints the name of the current folderls
- list directory lists all the files in the current folderls -l
- long list lists the files along with permissions, creation dates, etcls -lSr
- list all files sorted by file size (-S) with the largest files at the bottom (-r)ls -ltr
- will sort the results by file time (-t) with the newest files at the bottom (-r)mkdir <foldername>
- make a new folder (folders are also known as directories)cd <pathname>
- change directory to the one named by <pathname>cd ..
- change directory to the directory directly above the current onecd
- change to home directorycat <filename>
- prints the contents of a text filecat <file1> <file2> > <file3>
- joins together text files <file1> and <file2> and puts the result in <file3> (cat - is short for concatenate)less <filename>
- lets you scroll up and down through a text file; use Q to quitcp <file1> <file2>
- makes a copy of <file1> named <file2> in the current folder; previous contents of <file2> (if any) are lostmv <file1> <file2>
- move <file1> to <file2>; used to rename a file (previous contents of <file2> are lost)mv <foldername1> <foldername2>
- rename a directoryrm <file>
- remove a file (delete it)rm -r *
- recursively remove all files and folders in the current folder (be VERY careful with this)rm -r <foldername>
- recursively remove the folder and all its contents, including subfolders and their filesrmdir <foldername>
- remove a folder (delete it); the folder must be emptynano <filename>
- edit the named fileemacs <filename>
- edit with the GNU Emacs editor; see the man page for help. Note that you must have an X-windows server installed and running on your machine before you can use the GUI editor. exit
- quits the current Terminal session; CTRL-D often does the same
Attached files:
Was this article helpful?
If you have any further comments, please put them below.
Please note that feedback is anonymous - if you require a reply or assistance, please raise a ticket via ServiceLine.
Thank you for your feedback, it is much appreciated.