Copy multiple files?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 07 2025
0232

To copy multiple files to a directory in Linux, you can use the cp command followed by the names of the files you want to copy and the destination directory. The syntax is:

cp [options] file1 file2 file3 destination_directory/

For example, to copy file1.txt, file2.txt, and file3.txt to a directory named backup, you would use:

cp file1.txt file2.txt file3.txt backup/

If you want to copy all .txt files in the current directory to the backup directory, you can use a wildcard:

cp *.txt backup/

0 Comments

no data
Be the first to share your comment!