To delete files under Linux system, you can use the rm command. The rm command can delete one or more files or directories in a directory, or delete a directory and all its subordinate files and subdirectories.
How to delete files in Linux system:
1. First enter the Linux system terminal (here is the centos system), as shown below :
2. Let’s create a new file and use the touch command to create it, as shown below:
3. To view the file, use the command find to view it, as shown below:
#4. After viewing the file, use the command to delete the file, that is, use the rm command, as shown below:
5. Use the find command again to check, as shown below:
The system prompts No such file or directory, indicating that the file cannot be found. The file was deleted successfully.
The above is the detailed content of How to delete files in linux system?. For more information, please follow other related articles on the PHP Chinese website!