Search code examples
bashscp

Bash: scp all files in a directory, but not the subdirectory


I would like to copy all files from a remote destination in a particular directory writegrid, but not the subdirectories, e.g. the files in writegrid/output_files.

This

scp -r cory@blah.com:~/writegrid/* ./

will copy the files in the writegrid/output_files over as well.

Thank you.


Solution

  • Don't use the -r flag. It tells scp to copy recursively.