We had to copy many files that were located in a very complex directory structure. The following snippet searches the current directory and its subdirectories for *.xml files & executes the cp command on every file it finds (the braces {} represent the file):
find -type f -iname '*.xml' -exec cp {} /target/dir/for/all/xmls/ \;
The target dir now contains all *.xml files without directories.
The correct command is : find -type f -iname '*.xml' -exec cp {} /target/dir/for/all/xmls/ \;
AntwortenLöschenNo "-" before the "f" of the parameter type.
Hi igl,
AntwortenLöschenthank you very much for pointing that out. I corrected it in the example.
Kind regards
Marc
I'm all new to linux and it helps me learn these commands when I know the
AntwortenLöschen"full anatomy" of it, so to speak.
I can see what each bit of it represents, except the last "\;", what does it mean?