bash: /bin/ls: 参数列表过长

问题:bash: /bin/ls: 参数列表过长。

出现情况:当目录下文件过多时,

ls * >>../1.txt

将当前目录内的文件名保存在上一级目录内的1.txt中,但因为文件过多报错。

解决:

find ./ -type f -name "*"|xargs ls >>../all.txt

对于remove、cp、move等同样适用。

你可能感兴趣的:(bash: /bin/ls: 参数列表过长)