Re: Copying a bunch of images to one directory.
- From: Janis <janis_papanagnou@xxxxxxxxxxx>
- Date: Mon, 26 Nov 2007 00:55:38 -0800 (PST)
On 26 Nov., 02:28, Dave Kelly <daveekel...@xxxxxxxxxxxxxx> wrote:
On Nov 24, 4:40 pm, Janis Papanagnou <Janis_Papanag...@xxxxxxxxxxx>
wrote:> William's 'find' example collects the files from all subdirectories;
wasn't that what you wanted? Did you try the suggestions?
Janis
Tried this:
find -name '{*.jpg,*.png,*.JPG,*.gif}' -o -name
'{*.jpg,*.png,*.JPG,*.gif}' | xargs cp --target-directory=~/
xmasparty07
And got this error
cp: missing file argument
Tried this:
SilverNail:~/tffwebsite/httpdocs/images# find -name '*.jpg' -o -name
'*.jpg' | xargs cp --target-directory=~/xmasparty07
And got this error
cp: `~/xmasparty07': specified destination directory does not exist
Tried this:
find -name '*.jpg' --o name '*.jpg' | xargs cp --target-directory=/
root/xmasparty07
And got this error
cp: cannot stat `enhanced': No such file or directory
cp: cannot stat `1.jpg': No such file or directory
cp: cannot stat `./Belize2005/Norbert': No such file or directory
cp: cannot stat `Bonefish': No such file or directory
cp: cannot stat `at': No such file or directory
So I tried --o name "'*.jpg'" and -o name '"*.jpg"' and
still get the cannot stat errors.
Does the man page of your find command specifies to write two slashes
with option -o? Option 'name' requires a slash -name. Quoting of the
find arguments is necessary to prevent the shell to expand the names
to a matching file in the current directory and thereby producing
errors or wrong results; use just one pair of quotes, either single or
double (the latter in case you want to have shell variables inside the
string expanded before find is called). Try
find . -name "*.jpg" -o -name "*.gif" -o -name "*.png" -print0 |
xargs -0 cp --target-directory=/root/xmasparty07
Add more filename (patterns) by using a -o ("or") and -name.
(The 0 is a zero digit in case your font obscures it.)
Janis
.
- Follow-Ups:
- Re: Copying a bunch of images to one directory.
- From: Othmar Wigger
- Re: Copying a bunch of images to one directory.
- References:
- Copying a bunch of images to one directory.
- From: Dave Kelly
- Re: Copying a bunch of images to one directory.
- From: William Park
- Re: Copying a bunch of images to one directory.
- From: Dave Kelly
- Re: Copying a bunch of images to one directory.
- From: Janis Papanagnou
- Re: Copying a bunch of images to one directory.
- From: Dave Kelly
- Copying a bunch of images to one directory.
- Prev by Date: leave & xargs
- Next by Date: reading lines from standard input or a two way pipe into an array
- Previous by thread: Re: Copying a bunch of images to one directory.
- Next by thread: Re: Copying a bunch of images to one directory.
- Index(es):
Relevant Pages
|