The CP command is used to copy files or directories and is one of the most commonly used commands in a Linux system. In general, the shell sets an alias, and when the file is copied at the command line, if the destination file already exists, it asks whether to overwrite it, regardless of whether you use the-i parameter. However, if the CP is executed in a shell script, no-i parameter is not asked whether t
Linux MV Command
MV [option] source file or directory destination file or directory
Example
For example, rename the m1.c file to m2.c, the command behavior:
$ mv m1.c m2.c
If you move all files and directories under/usr/student to the current directory, the command behavior:
$ mv/usr/student/*.
CP command
CP [Parameters] original file name or directory destination file name or directory/path
Often see commands like the following in blogs or forums the curly braces extend brace expansion {} Shell functions
Cp/etc/httpd/httpd. {,. Bakup}
Or is
MV Resume{z,}.doc
So what does it mean in the uinx/linux shell command?
{} has no practical meaning, but can be used as a brace expansion (curly braces extension or curly braces extension) to produce various groups. Here's what's translated from the Gnu/bash man page
Tags: Linux basic knowledge system operation and maintenanceThe operation of the text file is very basic and important, and you will be more comfortable with manipulating the text after mastering them. To copy a file, use the CP command, the CP command can be used in many ways, in addition to simple replication, you can also establish a shortcut to compare the old and new two files to determine whether to u
Unix cp command, unixcp
[Syntax]: cp [-p] [-r] File 1 [file 2...] Target
[Description]: Set file 1 (file 2 ...) if the object is a file name, only one file can be copied. if the object is a directory, multiple files can be copied, if the target file does not exist, create this file. If yes, overwrite the previous content. If the target file is a directory, copy the file to this directory.-I will prompt
CP Command for LinuxFeatures: Copying Files or directoriesNote: The CP instruction is used to copy files or directories, such as specifying more than two files or directories at the same time, and the final destination is an existing directory, it will copy all the previously specified files or directories into this directory. If you specify multiple files or directories at the same time, and the final dest
14:57 b.txt~-rw-r--r--1 root root 0 4 14:45 c.txt[[email protected] txt]# cat B.txt1234567890[[email protected] txt]# cat B.txt~abcdefghi5) Extension:-B does not accept parameters, and MV will read the environment variable Version_control as a backup strategy.--backup This option specifies a total of four backup strategies if the target file is present:1.control=none or off: not backed up.2.control=numbered or T: Digitally numbered backup3.control=existing or nil: if there is a digitally number
L CP command for InuxFeatures: Copying Files or directoriesNote: The CP instruction is used to copy files or directories, such as specifying more than two files or directories at the same time, and the final destination is an existing directory, it will copy all the previously specified files or directories into this directory. If you specify multiple files or directories at the same time, and the final des
This example of the book needs to be supported in Ubuntu's lower version of the system, and now basically does not support, want to implement it is very simple to write a script to back up and then delete.Alias has just made a replacement.Alias rm= ' CP [email protected] ~/backup; RM [email protected] 'RM text.txtwas converted into aCP [email protected] ~/backup; RM [email protected] text.txt thatCP ~/backup; RM text.txtYou can see that text.txt has b
Tags: LinuxDirectory processing command (bottom) Delete empty directoryrmdir【目录名】Delete a non-empty directory or filerm -rf 【目录/文件】-rDelete Directory-fForcedSimply rm or rm -r would you really want to delete files or directories?Do not hit rm -rf / will erase all files under the root directory!!!Copy commandcp 【选项】【原文件/目录】【目标目录】-rCopy Directory-pJoint file attribute replication-dWakahara file is a linked file, copy the link property-aEquivalent to-PDR, guaranteed to be identical to the original
The CP does not seem to exclude the directory functionality, you can use the rsync command to implement, such as:
Case
The/home/php-note directory contains the data directory, the data directory contains a, B, C, D, e five directories, now to the data directory in addition to the E directory of all directories copied to the/bak directory.
Operation
Yum Install rsync #安装rsync
cd/home/php-note/
Rsync-av--exclude data/a--exclude data/b--exclude dat
Transferred from: http://www.jb51.net/LINUXjishu/70474.htmlLinux provides us with two commands for file copy, one for CP and one for SCP, but they are slightly different.CP---mostly used to copy files between different directories on the same computerSCP---The main is to copy files between different Linux systems back and forthFor specific uses of CP:Command basic format:CP [OPTIONS] source DEST---from the source path copy file to the destination path
Because now mainly responsible for modem (CP), AP-side related code porting, now do a porting directory related collation, for future reference.
The new project needs to porting some necessary QMI interfaces, the related code of common at commands, the configuration of RF, etc.
1 QMI Interface:
CP End: modem_proc/mmcp/mmode/qmi/~
Qmi_voice.c
Qmi_voice.h
Qmi_voice_cm_if.c
Qmi_voice_cm_if.h
modem_proc/qmimsgs
> For reprinting, please specify the Source: piao2010's blog, the drifting code. Thank you! Pai_^
> Link to this article: Why does the dynamic library (SO) of the process overwritten by CP cause coredump?
The question behind the previous blog "Linux shared library (SO) Dynamic Loading and upgrade": Why does the dynamic library (SO) of the CP overwrite process (running program) Cause coredump?The previous an
> For reprinting, please specify the Source: piao2010's blog, the drifting code. Thank you! Pai_^
> Link: Linux cp mv rm ln command impact on inode and dentry
When reading the File System Section of "Advanced Programming in UNIX environment", I found that I am not very clear about the concepts related to the file system.First, we will introduce two basic concepts:The first important concept, inode (Chinese name: Index node), contains most of the infor
Despite specifying the destination, the asmcmd CP command still creates a file under + Data/ASM
Reference Original:
Asmcmd CP creates files in + Data/ASM instead of destination specified (Doc ID 1488934.1)
Applicable:
Oracle Database-Enterprise Edition-version 11.2.0.3 and later
Information in this document applies to any platform.
Symptoms:
In version 11.2.0.3, use the
Like-CP and-classpath, it is the path to the other classes that the specified class runs on, usually the class library, the jar package, and the full path to the jar package, the semicolon ";" JAVA-CP on the window. Myclass.jar Packname.mainclassnameThe jar file in the classpath can use wildcards, and if it is multiple jar files, it should be listed one by one, and in a sense the jar file is the path.To spe
from one directory to another, only files that do not exist in the destination directory or update files for the corresponding files in the destination directory are copied.-V,--verboseAn informational message is displayed when a file is copied.--helpDisplays help information.--versionDisplays version information.InstanceA) Copy the file F1 to F2. If F2 exists, it will be overwritten with F1 content. If F2 does not exist, the F2 is created.Date > F1 CP
CPcommands are used to copy files or directories, which areLinuxone of the most commonly used commands in the system. Under normal circumstances,Shellan alias is set, and when the file is copied at the command line, if the destination file already exists,will ask whether or not to overwrite, whether or not you use- I.parameters. But if it is inShellexecuted in scriptCPwhen, no- I.parameter is not queried for overwrite. This indicates the command line andShellof the scriptThere are some different
After downloading the sublime decompression, want to put the folder in the OPT directory, here with the command CP copy it oversudo CP -r ~/download/sublime_2. 0.2 /opt/[sudo for Johnny: [email protected]I use the Chinese deep Linux system, so some folders are Chinese characters.Usage of CPUsage: CP [options] ... [-t] source file destination fileOR:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.