How to delete files in linux

尚
Original
2019-12-06 16:31:378643browse

How to delete files in linux

Introduction to the command to delete files under Linux:

Recommended linux related video tutorials: linux video tutorial

1. Open Linux system, create an empty file and empty folder;

2. rm file name (function: delete file);

Prompt: whether to delete the file, enter yes

3. rm * (Function: delete all files under this path);

4. rm -f file name (Function: delete files without asking whether to delete them) ;

5. rm -r folder (function: delete the folder recursively);

6. rm -rf file or directory (function: delete the file recursively) Delete directory, most commonly used);

Example:

1. Delete folder instance: rm -rf /var/log/httpd/access will delete /var/log/ httpd/access directory and all files and folders under it

2. Example of deleting files: rm -f /var/log/httpd/access.log will forcefully delete /var/log/httpd/access .log this file

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to delete files in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn