LINUX-14 Basic command-copy (CP) move (MV), delete (RM), copy file (DD)

Source: Internet
Author: User

1. CP command for copying files or directory format: cp[options] Source file destination file

  There are three ways to replicate a directory:

@1, the target file is a directory, the source is copied to the directory;
  @2, the target file is a file that overwrites the file with the source file;

@3, file file does not exist, the source file will be copied and modified to the name of the target file;

equivalent to-PDR (P,d,r for the above parameters) Td>
CP Command Parameters
parameter function
-p Preserve the original file's properties
-d If the object is "Connection file", leave the "Connection file" property
-r recursive continuous replication
-i   if the destination file exists, ask whether to overwrite
-a

For example: Create a file named Install.log

Touch  Intall.log

Copy Install.log to Xxx.log

CP  -ai xxx.log   111. Log

2, MV command for moving files or renaming format: mv[options] File name [destination file path] [target filename]

Rename file AAA to BBB

MV AAA BBB

3, rm command to delete files or directories, format: "rm[Options" File "

Delete normal files and prompt for confirmation: "RM file name"

Delete normal file or directory file, do not prompt: "RM-RF file or directory"

RM command
Parameters Role
-F Ignore warnings
-I. Ask before deleting
-R Delete a folder

4. DD command is used to specify the size of the copied file or to specify the converted file in the format: dd "parameter"

DD parameter
Parameters Role
If The file name entered
Of The file name of the output
Bs Set the size of each "block"
Count Set the number of "blocks" to copy
Conv=ucase Convert letters from small to uppercase
Conv=lcase Convert letters from uppercase to lowercase

LINUX-14 Basic command-copy (CP) move (MV), delete (RM), copy file (DD)

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.