Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-04-2014, 12:25 PM   #1
Registered: May 2009
Posts: 111

Rep: Reputation: 17
Angry scp -r $FOLDER but omit ONLY $FOLDER/$SUBFOLDER2 ??

SO lets say I have the following folder with subfolders in a host machine:


From my client, I want to copy all the folder but omit ONLY the subfolder $SUBF2?
How can I do so?
Old 11-04-2014, 08:16 PM   #2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288

you could use rsync instead and make use of the --exclude option. Eg
rsync -r -e ssh --exclude $SUBF2 $FOLDER user@otherhost:somedir

PS. You probably don't need the '-e ssh' since this is the default on most systems.


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
make multiple folder on samba linux & each folder can be access each person only Aneesh.T .S Linux - Server 1 01-31-2013 06:01 PM
MyLQ, subscription folder, empty current folder fails with more than 100? threads zhjim LQ Suggestions & Feedback 2 06-08-2012 11:14 AM
[SOLVED] How to copy a folder with sub directories using scp sanjay87 Linux - Server 5 05-24-2012 06:40 AM
Auto syncing folder from Linux to Windows, SCP/Rsync? batfastad Linux - Software 2 11-26-2010 02:08 AM
scp restriction to particular folder malickhat Linux - Newbie 9 09-26-2010 05:25 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:59 PM.

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