How to copy or transfer multiple files to Android devices

ADB (Android Debug Bridge) is a command-line utility that allows you to communicate with Android devices from your computer. Among other things, you can use ADB to copy file(s) to and from Android devices. As of this writing, ADB does not support wildcards to push or transfer multiple files (e.g., *.jpg) to Android devices.

So for example, the following will not work.

$ adb push *.jpg /sdcard/my_photo

If you would like to copy or transfer multiple files to an Android device, use the following trick.

First create a temporary directory, and copy to that directory all files that you want to transfer to your Android device. Then using ADB, push that entire temporary directory to the Android device. ADB will then push all individual files in the directory to the destination location of your Android device. For example:

$ mkdir tmp_dir
$ cp *jpg tmp_dir
$ adb push tmp_dir /sdcard/my_photo
push: tmp_dir/001.jpg -> /sdcard/my_photo/001.jpg
push: tmp_dir/002.jpg -> /sdcard/my_photo/002.jpg
push: tmp_dir/003.jpg -> /sdcard/my_photo/003.jpg
push: tmp_dir/004.jpg -> /sdcard/my_photo/004.jpg
. . . .

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of Xmodulo.com. He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.
Your name can also be listed here. Write for us as a freelancer.

2 thoughts on “How to copy or transfer multiple files to Android devices

Leave a comment

Your email address will not be published. Required fields are marked *

Current ye@r *