Chris
Chris

Reputation: 12201

cp filename* backup/* (Bash)

I want to copy all files that begin with a string to a folder in the same directory. I've tried cp foo* backup/foo* but get

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
   cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

How can I copy accomplish this?

Upvotes: 0

Views: 306

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 755074

cp foo* backup/

Just specify the target directory. This isn't a DOS command window.

Upvotes: 6

Related Questions