Home  >  Article  >  Operation and Maintenance  >  A very simple way to solve the problem of deleting too many files and being restricted by the shell in Linux

A very simple way to solve the problem of deleting too many files and being restricted by the shell in Linux

巴扎黑
巴扎黑Original
2017-09-04 15:36:142300browse

I recently discovered a problem. Under Linux, if there are too many files in a directory and the file names are too long, if you want to delete the file system, you will be prompted for Argument list too long. If you use rm -rf * to delete, It will prompt that this is a Linux shell restriction issue. You can use the following method to achieve this:

Enter the directory you want to enter as root
Execute:

ls|xargs rm -f

#You can delete them all
This is more efficient

The above is the detailed content of A very simple way to solve the problem of deleting too many files and being restricted by the shell 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