Linux cp command usage is mainly used to copy files, plus parameters can also copy the directory, the following with the small series to understand the specific use of the cp command under Linux.
In general, shell will set up an alias when copying files, if the target file already exists, it will ask whether to overwrite the command line, regardless of whether you use the -i parameter. However, if cp is executed in a shell script, it will not be asked if it is overwritten without the -i parameter. This shows that the command line and shell scripts are executed in a different way.
1. Command Format:
Usage:
cp [options]. . . [-T] Source Purpose
or :cp [options]. . . source. . . Directory
or :cp [options]. . . -t directory source. . .
2. Command function:
Copy the source file to the target file or copy multiple source files to the target directory.
3. Command parameters:
-a, --archive is equal to -dR --preserve=all
--backup[=CONTROL Create a backup for each existing target file
-b is similar to --backup but does not accept arguments
--copy-contents in recursive processing is to copy special file contents
-d equals --no-dereference --preserve=links< Br>
-f, --force Remove the target file if it cannot be opened and try again (you don't need to select this option when the -n option
exists)
-i, --interactive Overwrite pre-inquiry (disable the previous -n option)
-H Follow the command line symbolic link in the source file
-l, --link link file Do not copy
-L, --dereference always follow symbolic links
-n, --no-clobber Do not overwrite existing files (make the previous -i option invalid)
-P, --no-dereference does not follow symbolic links in the source file
-p equals --preserve=mode, ownership, timestamp
--preserve[= List of attributes Hold the specified attribute (default: mode, ownership, timestamp), if
may maintain additional attributes: environment, link, xattr, etc.
-R, -r, --recursive copy directory And all the items in the directory
Previous12Next page Total 2 pages
When the Linux kernel is booted, we can increase the Linux kernel boot parameters.
Linux users must be quite familiar with the various command lines, but today Xiaobian still brings y
In the Ubuntu system, sometimes the screen brightness is adjusted because the scree
After installation of CentOS 6.5, many people can not connect to the wireless network, most of the r
What is the use of the pwd command in Linux?
CentOS open Eclipse error Failed to load the JNI shared how to solve?
What should I do if the NIC cannot be started after the Linux virtual machine is cloned?
Redistribution of IP addresses in Linux systems
Linux system xinetd service can not start how to do?
Linux Tools Installation Guide for VMware Tools
Two styles of chmod command format under Linux/Ubuntu
How to put the files deleted by the Linux rm command into the garbage bin
Let Win8.1 upgrade Win8.1 RTM top secret method (graphic)
Win7 system right click on the desktop icon does not have "open" option how to do
How to match LOL new hero Millennium Rune
Linux Ubuntu tab key auto-completion command method
Windows10 sets the standby network to let the download hang up normally
Windows7 Ultimate system under the u disk read replication speed is slow to solve
How does the winXP system use the registry to speed up the window startup?
What is Adobe AIR? What is the use?