Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copying files with the same extension from a folder with subfolders

Posted on 2004-10-14
9
Medium Priority
?
197 Views
Last Modified: 2010-04-22
Hi,

I'd like to copy all the pdfs that reside within all the folders withing one folder.I tried this, but it didn;t work. It says 'no match'.

cp -r /Users/desiree/Library/Page\ Sender/In/*.pdf /Users/desiree/Desktop/Pdfs

The computer is an OS X machine not Linux, but that didn't seem to matter much with other commands. :-)

Any ideas?

Thanks,
agi
0
Comment
Question by:akapas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12314203
find . -name "/Users/desiree/Library/Page\ Sender/In/*pdf" -exec cp {} /Users/desiree/Desktop/Pdfs \;

The copy command does not recursively copy files, you need to call find first to search for all PDF files, and then copy the files that were found.

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12314255
Cut&paste error... Sorry about this.

find "/Users/desiree/Library/Page Sender/In" -name "*pdf" -exec cp {} /Users/desiree/Desktop/Pdfs \;
0
 

Author Comment

by:akapas
ID: 12315094
Thanks, but didn't work. It says "No such file or directory".

Agi
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 80 total points
ID: 12315127
Try
find /Users/desiree/Library/Page\ Sender/In -name "*.pdf"  -exec cp {} /Users/desiree/Desktop/Pdfs \;


If you still get this error message, try to just list the PDF file names:
find /Users/desiree/Library/Page\ Sender/In -name "*.pdf"  -print

Does this work?
0
 

Author Comment

by:akapas
ID: 12574449
Sorry, I'm still new here, wasn't sure how to accept.
0
 

Author Comment

by:akapas
ID: 12574791
Thanks. :-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question