"Go" Linux folder file creation and deletion

Source: Internet
Author: User
Tags create directory touch command

[From: Linux folder file creation, deletion-the Wind-blog Garden]

1. Delete a folder

RM-RF filenamede>

-Delete a folder instance:
Rm-rf/var/log/httpd/access

the/var/log/httpd/access directory and all files and folders under it will be deleted
To be reminded: Use this RM-RF with extreme caution, Linux does not have a recycle Bin

2. Deleting files
De>rm-f filenamede>
Use RM-RF with extreme caution, Linux does not have a recycle Bin 

3. linux Add Files command

Create directory: mkdir (make Directories)

Function Description: Establish directory  
Syntax:mkdir [-p][--help][--version][-m < directory property >][directory name]
Supplemental Note: mkdir can create a directory and set permissions for the directory at the same time.
Parameters:
  -m< Directory properties > or –mode< Directory properties >    set permissions on the directory at the same time as the directory is established.
  -p or –parents    if the upper-level directory to which you want to create the directory is not currently established, the upper-level directory is created.
Example:mkdir  Test
Creating a file Touch

Function Description: Change the file or directory time.
Syntax: Touch [-acfm][-d < datetime >][-r < reference file or directory >][-t < datetime;] [--help] [--version][file or directory ...] or touch [-acfm] [--help] [--version] [Date Time] [File or directory ...]
Supplemental Note: Use the touch command to change the date and time of a file or directory, including access time and change time.
Parameters
-A or –time=atime or –time=access or –time=use only change the access time.
-C or –no-create does not create any files.
-d< Time Date > Use the specified datetime, not the current time.
-F This parameter ignores non-processing and is responsible only for compatibility issues with BSD version touch directives.
-M or –time=mtime or –time=modify only change the change time.
-r< reference file or directory > set the date and time of the specified file or directory to the same date and time as the reference file or directory.
-t< Date Time > Use the specified datetime, not the current time.
Example: Touch test.txt (Note: Linux does not have file suffix name to differentiate file type, System file type only executable files and non-execute files)

 

"Go" Linux folder file creation and deletion

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.