Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running scp and copying a folder from remote server, I'm running with -rl , so i see the files being copy, is it possible to skip current file some way?

share|improve this question

No you can't. But you can stop scp and use rsync instead. It will copy only the differences left from the partial copy and you can exclude any files or dirs you don't want to transfer.

rsync -avP -e ssh --exclude=somefile --exclude=somedir ./localdir/ user@server:remotedir/
share|improve this answer
This is useful, yes, but unfortunately it doesn't answer the question that was asked. – Dusty W Dec 9 '12 at 13:15
It answers the question perfectly; the question asks if it is possible to do something and this answer answers "no". It then provides a helpful, on-topic alternative. – Christopher Shroba Feb 22 at 2:13

No, not with -r or any other syntax that performs multiple file transfers within one scp command.

That said, scp also follows the UNIX paradigm: write programs that provide simple, precise functionality that can be chained together in interesting ways. This means it would be possible to write a loop that interactively performs individual invocations of the command, one per file. You would then be able to break out of the individual commands as they're being run. (Ctrl-C)

The code for this is being left as an exercise to the reader, but the need for this loop to execute within an interactive shell must be emphasized. Breaking out of a non-interactive shell would terminate the entire job.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.