What is the command to delete files in linux

清浅
Release: 2019-04-16 17:33:03
Original
106191 people have browsed it

In Linux systems, we can delete files through the rm-rf command. -r means to delete files recursively downwards regardless of how many levels there are. -f means to delete files directly without any prompt. .

Deleting a directory in a Linux system is very simple. We can use the rmdir command to delete it, but we will run into trouble when the directory is non-empty. Now we can directly use the rm -rf command to delete it

What is the command to delete files in linux

[Recommended course: Linux tutorial]

Syntax:

rm -rf 目录名字
Copy after login

Parameter details:

-r is recursive downward, no matter how many levels of directories there are, delete them all

-f means to delete directly without any prompts

Example: Delete files

rm -f /var/log/httpd/access.log
Copy after login

This command means that it will be forced Delete the file /var/log/httpd/access.log

Example: Delete the folder

rm -rf /var/log/httpd/access
Copy after login

means that /var/log/httpd/ will be deleted access directory and all files and folders under it

Note when using the rm command:

Be very careful when using this rm -rf, there is no such thing in the Linux system Recycle bin. Therefore, it is difficult to retrieve it after deletion

Summary: The above is the entire content of this article, I hope it will be helpful to everyone

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

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template