1024programmer Linux What is the linuxrm command – linux operation and maintenance

What is the linuxrm command – linux operation and maintenance

What is the linux rm command?

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

Recommendation: “linux tutorial

Grammar

rm [options]  name...

Parameters:

-i Ask for confirmation one by one before deleting.

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

-r delete the directory and the following files one by one.

Example

You can use the rm command directly to delete a file. If you delete a directory, you must cooperate with the option “-r”, for example:

# rm test.txt
 rm: Do you want to delete the general file "test.txt"? y
 # rm homework
 rm: cannot remove directory 'homework': is a directory
 # rm -r homework
 rm: Do you want to delete the directory "homework"? y

Delete all files and directories under the current directory, the command line is:

rm -  r *

Once the file is deleted by the rm command, it cannot be restored, so this command must be used with great care.

The above is the detailed content of the linux rm command. For more information, please pay attention to other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/what-is-the-linuxrm-command-linux-operation-and-maintenance/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索