English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux rm (full English name: remove) command is used to delete a file or directory.
rm [options] name...
Parameters:
Files can be deleted directly using the rm command, but if a directory is deleted, it must be accompanied by the option"-r", for example:
# rm test.txt rm: Do you want to delete the general file "test.txt"? y # rm homework rm: Cannot delete directory "homework": It is a directory # rm -r homework rm: Do you want to delete the directory "homework"? y
Delete all files and directories in the current directory, command line:
rm -r *
Once a file is deleted using the rm command, it cannot be restored, so extra care must be taken when using this command.