LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2016, 09:10 AM   #1
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Rep: Reputation: Disabled
Sending multiple files via scp


I have this code that sends one file to a folder:

scp -p report1.xlsx username@hostname://export/home/exg85/reports

But let's say I have 2 more reports(report2.xlsx, report3.xlsx).

Instead of calling the scp command three separate times, is there a way I can send all three files in one scp command WITHOUT using wildcards?
 
Old 12-14-2016, 09:19 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,258

Rep: Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838Reputation: 6838
scp file1 file2 file3 user@host:path
works for me.
 
1 members found this post helpful.
Old 12-14-2016, 09:57 AM   #3
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
The above code has resolved my issue!! Thank you pan64!!!!! This forum is AWESOME!!!!!!!!!!!!!
 
Old 12-14-2016, 10:15 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
Keep in mind you can do multiples in the opposite way as well,. as a download.

Downloading multiple files with scp:

Code:
scp root@192.168.100.1:"file1 file2" /root/Downloads/
 
1 members found this post helpful.
Old 12-14-2016, 10:27 AM   #5
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@szboardstretcher.................good code!! Thank you very much!!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SCP - multiple files at a time and run in background jack2 Linux - General 1 03-31-2016 10:37 AM
Bash quesion - scp on multiple hosts to multiple directories in each one mierea.ciprian Programming 2 06-22-2012 12:27 PM
scp shortcut for multiple files lailai Linux - General 2 03-05-2012 05:38 PM
scp - multiple files at once rpd25 Linux - Newbie 3 01-30-2012 01:47 AM
problem sending files with scp illiniguy3043 Linux - Newbie 1 06-27-2004 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration