Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CVM: Linux folder file creation and deletion

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1 Delete folder CVM

De > 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

Need to be reminded: you must be very careful when using this rm-rf. Linux does not have a Recycle Bin.

2 delete files

De > rm-f fileNamede >

Be careful when using rm-rf. Linux does not have a Recycle Bin.

Linux add File command

Create a directory: mkdir (make directories)

Function description: create a directory

Grammar: mkdir [- p] [--help] [--version] [- m] [directory name]

Additional note: mkdir can establish a directory and set the permissions of the directory at the same time.

Parameters:

-m or-mode sets the permissions of the directory at the same time it establishes the directory.

-p or-parents if the upper directory of the directory to be created has not been created yet, the upper directory will be created as well.

Example: mkdir test

Create a file touch

Function description: change the file or directory time. ?

Grammar: touch [- acfm] [- d] [- r] [- t] [--help] [--version] [file or directory.] Or touch [- acfm] [--help] [--version] [date and time] [file or directory.]

Note: use the touch directive to change the date and time of a file or directory, including access time and change time.

Parameters:

-an or-time=atime or-time=access or-time=use only changes the access time.

-c or-no-create does not create any files.

-d uses the specified date time instead of the current time.

-f this parameter is ignored and not processed, and is only responsible for resolving the compatibility issue of the BSD version of the touch directive.

-m or-time=mtime or-time=modify only changes the time of change.

-r set the date and time of the specified file or directory to the same date and time as the reference file or directory.

-t uses the specified date time instead of the current time.

Example: touch test.txt (Note: there is no file suffix under Linux to distinguish file types, system file types are only executable files and non-executable files)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 264

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report