Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here are several command line tools to make managing files easier:

scp (

...

Secure Copy)

Secure copy or SCP is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol. From the command line interface, the local host is always represented by the text before the $ in your command line prompt.

Expand
titleExample detailing Command Line Interface anatomy when performing an scp

Example: user@hostname:location$ This prompt reference the username of the user you’re logged in as, the hostname (the computer you're logged into on the command line prompt) and location, the folder you're currently in. For example if Cowboy Joe were logged into Beartooth and in his home folder, the prompt may like: [cowboyjoe@blog1 ~]$ Since users usually connect to Beartooth over a login node, blog1 references the current node on the Beartooth HPC that Cowboy Joe was assigned to, when he logged into the cluster. This is the specific node on the cluster he's using. ~ is an abbreviation and reference to his /home folder in the cluster which he's currently "in". The [hostname] from the login prompt represents the local host in all following SCP examples.

Copy Copying a file or folder from a remote host to your local host SCP example host using SCP:

Code Block
$ scp username@from_host:/path_to_file/file.txt /local/folder/
Code Block
$ scp -r username@from_host:/path_to_folder/folder  /local/folder

Copy Copying a file or folder from local host to a remote host using SCP example:

Code Block
$ scp file.txt username@to_host:/remote/folder/
Code Block
$ scp -r /local/folder username@to_host:/remote/folder

Copy Copying a file from one remote host to another remote host using SCP example:

Code Block
$ scp username@from_host:/remote/folder/file.txt username@to_host:/remote/folder/

Copy all of the contents from a local host folder into a remote host folder using SCP:

Code Block
$ scp -r /local/folder/. username@to_host:/remote/folder/

...