How Do I Copy Two Files at Once in Linux?
Contents

Multiple files or directories can be copied to a destination directory at once. In this case, target must be a directory. To copy multiple files you can use wildcards (cp *. extension) having same pattern.

How do I copy multiple files in Linux?

To copy multiple files using the cp command pass the names of files followed by the destination directory to the cp command.

How do you copy multiple files in Unix?

The short answer is no. You can not use GNU/cp or BSD/cp to copy a single file to multiple directories. However, you can use combination of cp and xargs/parallel and other commands to copy a single file to multiple directories in MacOS, Linux, FreeBSD, OpenBSD, NetBSD and Unix-like systems.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest