Home>Article>Operation and Maintenance> How to delete specified files in linux

How to delete specified files in linux

Linda Hamilton
Linda Hamilton Original
2020-12-18 11:50:49 10266browse

Linux method of deleting specified files: Use the delete command [find specified folder/ -name this.html~ |xargs rm -rf]. There is no file named [fingerprint.default_WFH.so] in the out directory. The files have been deleted.

How to delete specified files in linux

The operating environment of this tutorial: windows7 system, linux7.3 version. This method is suitable for all brands of computers.

【Recommended related articles:linux tutorial

Linux method of deleting specified files:

1. Sometimes it is necessary Delete the specified file name command in a certain folder directory, because sometimes the subdirectories inside contain many files with such file names. If you delete them one by one, it is very troublesome. Here is a good method. I have tested it myself. Yes, it can be used, and it is very convenient and efficient when used.

2. Command format:

find 指定的文件夹/ -name this.html~ |xargs rm -rf

3. I now want to delete all fingerprint.default_WFH.so files in the out/ directory.

4. First, let’s take a look at the current number of fingerprint.default_WFH.so files in the out directory of my project.

How to delete specified files in linux

5. Next execute the command:find out/ -name fingerprint.default_WFH.so |xargs rm -rfcommand, look at the result, out There is no file named fingerprint.default_WFH.so in the directory. They have all been deleted. It is a very powerful command.

How to delete specified files in linux

#6. Of course, this command can be expanded and is very practical.

A: Delete all files in the directory with the file name fingerprint.default_WFH.so:

find / -name fingerprint.default_WFH.so |xargs rm -rf

B: Delete all files in the directory with the suffix so:

find / -name *.so |xargs rm -rf

Related free learning recommendations:php programming(video)

The above is the detailed content of How to delete specified files in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn