Get the App
SLTechnology News&Howtos  ›  Servers  › 

What dare the rm command in linux?

Shulou Source: shulou.com Published: 2022-06-03 05:04:38 09月19日 Update

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

Grammar

Rm [options] name...

Parameters:

-I ask for confirmation one by one before deletion.

-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

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

# rm test.txt rm: do you want to delete the general file "test.txt"? Y # rm homework rm: unable to delete directory "homework": is a directory # rm-r homework rm: do you want to delete directory "homework"? Y

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

Rm-r *

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

These are the details of what the linux rm command is, please pay more attention to other related articles!

Tags: Directories commands files files read-only contents parameters instances that is properties articles more behavior syntax Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi vpn NVidia Shulou Tech Info macOS