How to use shell to delete a specific file in Linux?
In Linux, you can use the shell command rm to delete specific files. Here are some common ways to delete files:
- Delete a single file.
rm 文件名
- Delete multiple files.
rm 文件1 文件2 文件3 ...
- Remove all files in the specified directory.
rm 目录名/*
- Delete the specified directory and all of its contents.
rm -r 目录名
Please note that deleting a file is irreversible, so please use caution.