Home > Article > Operation and Maintenance > How to copy files in linux
Copying files in Linux generally requires such a process. If there is no file, create the file first. If there is a file, you can use the CP command to copy the file to the current directory or to other directories. , if there is no directory, you need to create a directory.
For better display, I operate by adding commands through the interface. First, create a dog directory in the tmp directory for display. cd /tmp enters the tmp directory, mkdir dog creates the dog folder.
Now there is no file in the dog folder. Create a file a. Now the directory we are in is tmp. We need to enter the dog directory and create the file.
The file has been created. Next, copy a.txt to b.txt and use the cp command.
cp a.txt b.txt
Recommended: linux video tutorial
The above is the detailed content of How to copy files in linux. For more information, please follow other related articles on the PHP Chinese website!