Copy Files from Multiple Directories OS X Unix Terminal

Today I downloaded all the images I had uploaded to Google Plus (Picasa) using Google's Takeout service. If you have never heard of this service it is well worth a look. You can export all the data you have across all the Google services you use: Google+, Buzz, Contacts, Drive, Latitude, Pages, Picasa, Profile, Reader, Voice & Youtube. It can be quite handy if you wish to transfer this data to a new location, such as today when I wanted to move all the images that have uploaded to Google+ Instant Upload.

Google Takeout puts all the file into an archive (zip) for you to download. When opened there is a directory for each date or gallery that the photos were uploaded on/to. This means you can have a large number of directories inside the archive and if you want to put all these images into one directory without the enclosing directories that they came in then it can be quite a task to remove them an image at a time. If only there was some way to make it easier. Well of course there is, there always is.

Open Terminal and in there you just need to type:

find [path to directory containing files you want to copy] -iname "[types of files you want to move]" -exec cp {} [path to directory you are copying files to] \;

REMOVE THE SQUARE BRACKETS then you can drag the corresponding directories into your terminal window which makes it slightly easier than typing out the path to the them. For me this looked like this:

find /Users/mjd/Downloads/me@somewhere.co.uk-takeout -iname "*.*" -exec cp {} /Users/mick/Downloads/1 \;

This will save you a lot of time moving over files in multiple directories.

Whilst the process looks like it is copying from just one directory what we are actually doing is copying from multiple directories within a single directory.

sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1

Get 25% off any VPN Plan with IPVanish VPN, using SEOM as a checkout code

  • Access geo-restricted content from anywhere
  • Encrypt and anonymise your internet traffic
  • No logs of your traffic
  • Kill Switch: Kills network if VPN connection is lost
  • 7 day money back guarantee