The Linux cp command copy command is very useful. The cp command can copy files (directories) in the specified path to another file or directory, which is equivalent to the COPY and XCOPY commands under DOS. The cp command syntax is as follows: cp [options] <source file or directory> <target file or directory> or cp [options] source1 source2 source3 …. The first command in the directory is a single file or directory copy, the next one is Copy multiple files to the last directory. Options options include: ■- a Retain link and file attributes, recursive copy directory, equivalent to the following three combinations of d, p, r options. ■- d Keep the link when copying. ■- f Delete the existing target file without prompting. ■- i A confirmation prompt will be given before the target file is overwritten, which is an interactive copy. ■- p After copying the contents of the source file, it will also copy its modification time and access rights to the new file. ■- r If the source file is a directory file, cp will recursively copy all subdirectories and files in that directory. Of course, the target file must be a directory name. ■- l No copy, just a link file. ■-s is copied into a symbolic link (symbolic link), which is a "shortcut" file; ■-u updates destination if destination is older than source. Example of using the cp command: 1. Copy the file file1 to file2. After copying, the name is changed to file2cp -i file1 file2 or cp file1 file22. Copy the file file1 to the dir1 directory. After copying, the name is still not file1cp -i file1 dir1 or , cp file1 dir13, copy the directory dir1 to the dir2 directory, the replication result directory is renamed to dir2cp -r dir1 dir24, all files in the directory dir1 include folders, all copied to the dir2 directory cp -r dir1/*.* Common error of dir2: 1. Prompt cp: omitting directory error When copying directory, use -r option to recursively copy, as follows: cp -r dir1 dir2
A few days ago, a Linux system administrator asked the author for help. He said th
I. Manually compile and install 1, download the installation package, wget https://ohse.de/uwe/rele
How to effectively perform Linux patch management Red Hat LinuxOSRHEL patch can be installed throug
A flash drive is one of the most useful tools a person can have. With it, you can back up critical d
How to delete data by mode in Redis
Configure Network Bonding on CentOS 6 /RHEL 6
Linux mkdir function mode permission setting method
Win7 resource manager unsightly icon tips
Linux Squid build transparent proxy gateway server
Compile command for c mysql program under Linux
Restore deleted files under Ext3
A Shell tool: jsondiff.sh Using the basic tutorial
Detailed YUV format, detailed explanation of YUV420 data format
Learning tips about interprocess communication
Windows 7 configuration IPv6 needs to pay attention to the thing
Windows8 can not uninstall Word manuscript paper add-on how to do
Linux system JDK installation and configuration basic tutorial
Win8 uses the Rubik's landscaping master to create IE icon
Four essentials for Linux system security protection
Reasons and solutions for Vista SP1 not being automatically updated
How to edit the start menu under Ubuntu?
Coping with windows7 system program response time has a coup