Mac Terminal Scp Download File
Updated 2019-06-14
Overview¶
I am using the Terminal window to ssh into a unix server. I am not sure how to copy a file from my mac onto the unix server. What command do I enter and how do I type the file I want to upload Example. Say my file is named Test1.doc and it is on the usr/me/test/working/ directory and I want to upload into to the Unix directory listed as me/test2/ what command do I need to enter? I am using the Terminal window to ssh into a unix server. I am not sure how to copy a file from my mac onto the unix server. What command do I enter and how do I type the file I want to upload Example. Say my file is named Test1.doc and it is on the usr/me/test/working/ directory and I want to upload into to the Unix directory listed as me. Apr 20, 2020.
- Every user has access to the datamover node which allows for fast file transfer, and prevents slow down from sending files directly to the head node.
- You can send files to whatever dir you want on the cluster, (home / personal dirs in home, scratch, or data) altough some directories might be better than others for certain files.
- Ex: if you want to upload a very large data set that you only want to use for a couple computations, upload it to
/scratch
- This guide uses the secure tool
scp
which stands for Secure Copy. Its easy to use, safe, and reliable, and is run in the terminal. However, it will be noticeably slower than globus if transfering large files
I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance. The command I used was: scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all. May 30, 2020.
From Local Computer to Cluster (Onto Cluster)¶
- Say I wanted to send a PBS script, a python file, and data set in the form of a .csv file to the cluster.
- Im going to send them to scratch, since I plan on running the python file on the data set only a couple times, gathering the results, and then deleting the files off scratch (I don't plan on using them anymore)
- The first step is to make sure you are in the directory of the files you want to send
- The template to send files from a local machine to a remote host is:
From Cluster to Personal Computer (Off of Cluster)¶
- Lets say a job had just finished running, and had created a log file with its results.
- To move those result files off of the cluster to your computer, you can use scp.
- For this scenario I will be moving
weather.csv
, a csv file that contains the results of a python program I have run on the cluster, to my personal laptop. - The template to send files from the cluster to a local machine is this:
Moving Directories¶
- To move a directory, simply use the
-r
flag which tells scp to copy the directory and anything contained in it recursively - Copying
/scripts
dir From Remote (cluster) to/PACE-GT
on local machine (laptop):
Terminal User Guide
Scp Download Free
In Terminal, you can move and copy files locally or remotely using the mv
, cp
, and scp
command-line tools.
Tip: It’s easier to move and copy files using the Finder. See Organize files in folders.
Move a file or folder locally
In the Terminal app on your Mac, use the
mv
command to move files or folders from one location to another on the same computer. Themv
command moves the file or folder from its old location and puts it in the new location.For example, to move a file from your Downloads folder to a Work folder in your Documents folder:
% mv ~/Downloads/MyFile.txt ~/Documents/Work/MyFile.txt
You can also change the name of the file as it’s moved:
% mv ~/Downloads/MyFile.txt ~/Documents/Work/NewFileName.txt
See the mv command man page.
Copy a file or folder locally
In the Terminal app on your Mac, use the
cp
command to make a copy of a file.For example, to copy a folder named Expenses in your Documents folder to another volume named Data:
% cp -R ~/Documents/Expenses /Volumes/Data/Expenses
The
-R
flag causescp
to copy the folder and its contents. Note that the folder name does not end with a slash, which would change howcp
copies the folder.
See the cp command man page.
Mac Terminal Scp Download File Linux
Copy a file or folder remotely
In the Terminal app on your Mac, use the
scp
command to copy a file or folder to or from a remote computer.scp
uses the same underlying protocols asssh
.For example, to copy a compressed file from your home folder to another user’s home folder on a remote server:
% scp -E ~/ImportantPapers.tgz username@remoteserver.com:/Users/username/Desktop/ImportantPapers.tgz
You’re prompted for the user’s password.
The
-E
flag preserves extended attributes, resource forks, and ACL information.The
-r
flag, which isn’t used in this example, causesscp
to copy a folder and its contents.
Mac Terminal Scp Download File Extractor
See the scp command man page.