Home » Questions » Computers [ Ask a new question ]

Copying only JPG from a directory structure to another location Linux

Copying only JPG from a directory structure to another location Linux

I wish to recursively go through the folders of a directory structure and copy any .jpg I find into another directory.

Asked by: Guest | Views: 234
Total answers/comments: 1
Guest [Entry]

"This will preserve the directory structure.

find photos/ -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -print0 |xargs -0 tar c |(cd /cpjpg ; tar x)"