|
Why Use a Cluster?
|
High Performance Computing (HPC) typically involves connecting to very large computing systems elsewhere in the world.
These HPC systems can be used to do work that would either be impossible or much slower or smaller systems.
The standard method of interacting with such systems is via a command line interface such as Bash.
|
|
Connecting to the remote HPC system
|
To connect to a remote HPC system using SSH and a password, run ssh yourUsername@remote.computer.address.
To connect to a remote HPC system using SSH and an SSH key, run ssh -i ~/.ssh/key_for_remote_computer yourUsername@remote.computer.address.
Protect your SSH keys by managing them carefully!
2-factor authentication is a way to help ensure a user’s identity by requiring two forms of identity evidence.
|
|
Moving around and looking at things
|
Your current directory is referred to as the working directory.
To change directories, use cd.
To view files, use ls.
You can view help for a command with man command or command --help.
Hit tab to autocomplete whatever you’re currently typing.
|
|
Writing and reading files
|
There are many different text editors available on DiRAC.
Use nano to create or edit text files from a terminal.
Use cat file1 [file2 ...] to print the contents of one or more files to the terminal.
Use mv old dir to move a file or directory old to another directory dir.
Use mv old new to rename a file or directory old to a new name.
Use cp old new to copy a file under a new name or location.
Use cp old dir copies a file old into a directory dir.
Use rm old to delete (remove) a file.
File extensions are entirely arbitrary on UNIX systems.
Use scp to transfer files from and to a remote DiRAC resource.
Use tar to de-archive and archive sets of numerous and/or large files.
|
|
Wildcards and pipes
|
The * wildcard is used as a placeholder to match any text that follows a pattern.
Redirect a command’s output to a file with >.
Commands can be chained with |
|
|
Scripts, variables, and loops
|
A shell script is just a list of bash commands in a text file.
To make a shell script file executable, run chmod +x script.sh.
|
|
Using Bash Scripts in Pipes
|
You can include your own Bash scripts in pipes.
A common and useful pattern in Bash shell is to run a program or script that generates potentially a lot of output, then use pipes to filter out what you’re really after.
|
{:auto_ids}
key word 1
: explanation 1
key word 2
: explanation 2