Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does the Linux system copy all the files under a folder to another folder

Shulou Source: shulou.com Published: 2022-06-01 15:51:12 09月28日 Update

This article mainly explains the "Linux system how to copy all the files under the folder to another folder", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux system how to copy all the files under the folder to another folder" bar!

We can use the cp or copy command to copy or copy files on a Linux system, but how do we copy all the files in one folder to another? Let's give a brief introduction.

Copy command

1. Copy, cp, the function of this command is to copy the given file or directory to another file or directory. Syntax: cp [option] source file or directory destination file or directory

2. For example, create two subfolders, test1 and test2, under the / TEST directory. Suppose you copy the test01 file under the source file test1, and the target directory is test2.

Can be used directly: cp / TEST/test1/test01 / TEST/test2

3. For example, create two subfolders, test1 and test2, under the / TEST directory. Suppose you copy the source file test1 folder and the destination directory is test2.

Direct use: cp-r / TEST/test1 / TEST/test2

4. But how do you copy all the files in one folder to another?

5. Cp-r / TEST/test1/. should be used / TEST/test2 . Copy the folders and files in test1 to test2.

6. You can also use cp-r / TEST/test1/* / TEST/test2. Get the same effect.

Thank you for your reading, the above is the "Linux system how to copy all the files under the folder to another folder" content, after the study of this article, I believe you on the Linux system how to copy all the files under the folder to another folder this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Files folders directories systems commands source files targets learning two content copy function that is ideas situations effects articles more knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Docker Linux Microsoft