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