first, the purposeThis article describes the new file or directory, delete files, or directory commands under Linux.
Touch can create a new file, mkdir to create a new directory, and RM to delete a file or directory.
This article will select the ubuntu14.04 release as the basis for the description.
second, Touch commandThere are many ways to create a new file under Linux, such as using VI to create a new file, copying a file using the CP command, but most often using the touch command to create a new file.
Syntax: touch [options] FileName
-A: Change access time
-M: Change the modification time
-T Timestamp: Change the access time and modify time to timestamp
If you do not specify any options, the Touch command creates a new file.
If the-t timestamp option is specified, the touch command modifies the file's access time and modification time to timestamp.
If the-a option is used, the Touch command modifies the file's access time to the current time.
if the-M option is used, the Touch command modifies the file's modification time to the current time.
iii. mkdir Ordersyntax: mkdir [options] dirname
-P: Recursively create a directory
-
m mode: Create a new directory and set the file access mode for the directory as mode
The ZSY/HXN directory is created recursively using the-p option.
Use the-m option to specify that the file access mode for the new directory is 770, rwxrwx---。
Four, rm commandSyntax: RM [options] Filename/dirname
-F: Force a file or directory to be deleted, even if the directory is not empty
-r: Recursively delete files or directories
-I: Need confirmation before deleting files or directories
In practical use, the-R and-f options are generally used simultaneously to forcibly and recursively delete the specified file or directory.
for important files or directories, it is recommended to use the-I option when deleting, to avoid mis-operation.
v. Summary
This article describes the new File command touch, new Directory command mkdir and delete file or directory command RM under Linux.
Copyright Notice:original works, such as non-commercial reprint, please specify the source, such as commercial reprint publication, please contact the author.
Linux Essays---Touch and mkdir