What is the linux rm command?

藏色散人
Release: 2020-05-29 10:18:59
Original
5097 people have browsed it

What is the linux rm command?

What is the linux rm command?

Linux rm command is used to delete a file or directory.

Recommended: "linux tutorial"

Syntax

rm [options] name...
Copy after login

Parameters:

-i Before deletion Ask for confirmation one by one.

-f Even if the original file attribute is set to read-only, it will be deleted directly without confirming one by one.

-r Delete the files in the directory and below one by one.

Example

To delete files, you can use the rm command directly. If you want to delete a directory, you must use the option "-r", for example:

# rm  test.txt 
rm:是否删除 一般文件 "test.txt"? y  
# rm  homework  
rm: 无法删除目录"homework": 是一个目录  
# rm  -r  homework  
rm:是否删除 目录 "homework"? y
Copy after login

Delete all files in the current directory and Directory, command line:

rm  -r  *
Copy after login


Once a file is deleted through the rm command, it cannot be recovered, so this command must be used with extreme caution.

The above is the detailed content of What is the linux rm command?. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template