This article mainly introduces the folder file creation, deletion, specific as follows:
Linux Delete Folder command
Linux Delete directory is very simple, many people are still accustomed to using rmdir, but once the directory is not empty, into deep distress, now use the RM-RF command.
Direct RM is OK, but add two parameters-rf namely: RM-RF directory Name
Delete directory, file rm (remove)
Feature Description: Deletes a file or directory.
Syntax: RM [-dfirv][--help][--version][file or directory ...]
Supplemental Note: Perform RM directives to delete files or directories, and if you want to delete the directory you must add the parameter "-r", otherwise the preset will only delete the file.
-D or –directory deletes the hard connection data of the directory to be deleted directly to 0, deleting the directory.
-F or –force forcibly deletes a file or directory.
-I or –interactive ask the user before deleting the existing file or directory.
-R or-R or –recursive recursively, all files and subdirectories under the specified directory are processed together.
The-V or –verbose displays the instruction execution process.
1 Deleting folders
-Delete Folder instance:
The/var/log/httpd/access directory and all the files and folders under it will be deleted
Need to be reminded: Use this RM-RF must be extra careful, Linux has no Recycle Bin
2 Deleting files
You must be careful when using RM-RF, Linux does not have a recycle Bin
Linux Add File command
Create directory: mkdir (make Directories)
Function Description: Create a catalogue
Syntax: mkdir [-p][--help][--version][-m < directory properties >][directory name]
Supplemental Note: mkdir can create a directory and set permissions on the directory at the same time.
-m< Directory properties > or –mode< Directory properties > Set permissions for the directory while establishing the directory.
-P or –parents if the top-level directory you want to create a directory is not currently established, the top-level directory is created together.
Create a file Touch
Function Description: Change file or directory time.
Syntax: Touch [-acfm][-d < date time >][-r < reference file or directory >][-t < date time] [--help] [--version][file or directory ...] or touch [-acfm] [--help] [--version] [Date Time] [File or directory ...]
Supplemental Note: Use touch instructions to change the date and time of a file or directory, including access time and change time.
Only the access time is changed by-A or –time=atime or –time=access or –time=use.
-C or –no-create does not create any files.
-d< Time Date > Use the specified date time, not the current time.
-F This parameter ignores no processing and is responsible for resolving the issue of compatibility of the BSD version of touch instructions only.
-M or –time=mtime or –time=modify only change the change time.
-r< reference file or directory > the date and time of the specified file or directory, all set to the same date and time as the reference file or directory.
-t< Date Time > Use the specified date time, not the current time.
Example: Touch test.txt (Note: Linux does not have a file suffix under the name of the file type, the system file type is only executable and cannot execute files)
Original link: http://www.cnblogs.com/end/archive/2012/06/05/2536835.html
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.