My Oracle Support Banner

Unable To Remove Files From Directory with Error 'Argument list too long' From Command Line (Doc ID 2400796.1)

Last updated on FEBRUARY 02, 2022

Applies to:

Linux OS - Version Oracle Linux 6.9 with Unbreakable Enterprise Kernel [4.1.12] and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86
Linux x86-64

Symptoms

 While trying to list or interact with large number of files from command line it results with following error:

$ ls -l *.xml | wc -l
bash: /bin/ls: Argument list too long
0
$ rm *.xml
bash: /bin/rm: Argument list too long

$ ls -l | wc -l
325532

or when trying to delete large number of files using find command it fails with below error message:

$ find /u01/oracle/apps/fs1/EBSapps/appl/xdo/12.0.0/temp/*.xml -mtime +120 -exec rm -v {} \;
bash: /usr/bin/find: Argument list too long

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.