Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (9.5k points)

I have to download a file from the server to my desktop (UBUNTU 10.04) on Mac OS X and iTerm 2 terminal. Can anyone tell me how to download a file from the server using ssh? 

1 Answer

0 votes
by (19.7k points)

Try the command below: 

scp [email protected]:foobar.txt /local/dir

You can replace the username, host, remote filename, and local directory as appropriate. To access EC2 (or any services which requires authentication with private key), use the -i option like below: 

scp -i key_file.pem [email protected]:/remote/dir/foobar.txt /local/dir

Check this website: http://www.hypexr.org/linux_scp_help.php

Interested in Linux? Check out this Linux Certification by Intellipaat.  

Related questions

0 votes
1 answer
0 votes
1 answer
asked Nov 28, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 9, 2021 in Linux by sheela_singh (9.5k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...