Handle file Touch, mkdir, CP, MV, RM

Source: Internet
Author: User
Tags touch command

First, create a file touch

Touch file1 Create an empty file

The touch command can also be used to change the access time and modification time of an existing file without changing the contents of the file

Touch File1

File1 file modification time has been updated from the original time, if only change the access time can be used as-a parameter, if only change the modification time, can use the-m parameter; By default, Touch uses the current time and can specify the time by using the-t parameter plus a specific timestamp:


Second, create the directory mkdir

mkdir Dir1

Third, copy file CP

CP [Original file] [target file]

CP Command Parameters

Parameters

Describe

-A Archive files and retain their existing properties
-B Create a backup of a target file that already exists, rather than overwrite it
-D Keep
-F Force overwrite the existing target file without prompting
-I. Prompt before overwriting the destination file
-L Create a file link rather than copy a file
-P If possible, keep the file properties
-R To copy a file recursively
-R Recursively replicate directories
-S Create a symbolic link rather than copy a file
-S Overwrite the suffix of the default backup file (default is ~)
-U Copy only if the source file is newer than the target file (equivalent to the update)
-V Verbose mode, explaining exactly what happened.
-X Replication only for current file systems

Four. renaming files MV

MV Dir1 Dir2

V. Delete file RM

RM file1 Deleting files

Rm–f File1 Forced Delete, not prompted

Rm–rf Dir1 forcibly delete a non-empty directory without prompting

Handle file Touch, mkdir, CP, MV, RM

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.