There are many commands under Linux, there is a command, I always use the problem, that is CP command. Each time you use this command, you are prompted to cp:omitting directiory error. Finally, Baidu to understand that the original CP command to copy the directory when the need to take command parameters. No wonder I used the CP command to complain. Here are some tips for using this command:
1. CP command syntax
CP [Options] <source file or directory> <target file or directory> or CP [options] Source1 Source2 ... director Y
The preceding syntax is a single file or directory copy, which is a copy of multiple files to the final directory. Options parameters include:
-a preserves the link and file attributes, recursively copies the directory, equivalent to the following D, P, r three option combinations.
-D Keep links when copying.
-F Deletes the destination file that already exists without prompting.
-I will give a confirmation prompt before overwriting the target file, which is an interactive copy.
-P Copies the contents of the source file and also copies its modification time and access rights to the new file.
-R If the source file is a directory file, the CP will recursively replicate all subdirectories and files in the directory. Of course, the destination file must be a directory name.
-L do not copy, just link file.
-s copy into the symbolic link file (symbolic link), the "shortcut" file;
-U if destination is newer than source old destination.
2. Use examples
I started using the command is CP file./direc This command works fine, but when you use CP Direc/DIRECT2 later, you report to cp:omitting directory.
Directory to directory replication using Cp-r Direc direc2, if all files under the directory including folders are copied to the DIREC2 directory, you can use the command cp-r direc/* to implement.
File to file copy (operation in same directory, equivalent to backup and renamed) Cp-i file1 file2 or CP file1 file2
At present, I still have such a low-level error, that I command or not familiar Ah, hey, later to learn more about Linux commands.
The above is a small series to introduce the Linux copy File command cp Use commentary, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!