- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /usr/bin/find argument list too long
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:23 PM
03-26-2007 08:23 PM
/usr/bin/find argument list too long
We have a script running for months to
do a bit cleanup in the /tmp.
And since yesterday it produced/usr/bin/find argument list too long.
I checked the modification date of script,
and that was nov 6 as expected.
When I replayed the find command on the command line I could reproduce consistently.
What is even more strange that there are only
6 files that fit the criteria see below.
Okay, there are 871 files in /tmp, could that be the reason, when we try so hard to narrowing it down.
Even when I increased mtime to say +15,
so is should not find any, it complaint
that argument list is too long.
output from this morning:
[root@oradb1:]/tmp<>>> find /tmp/* -name "del*" -type f -prune -mtime +1 -print -exec rm {} \;
sh: /usr/bin/find: The parameter list is too long.
[root@oradb1:]/tmp<>>> cd /tmp
[root@oradb1:]/tmp<>>> ls -altr | wc -l
871
[root@oradb1:]/tmp<>>> find /tmp/* -name "del*" -type f -prune -mtime +4 -print -exec rm {} \;
sh: /usr/bin/find: The parameter list is too long.
[root@oradb1:]/tmp<>>> find /tmp/* -name "del*" -type f -prune -mtime +14 -print -exec rm {} \;
sh: /usr/bin/find: The parameter list is too long.
[root@oradb1:]/tmp<>>> find /tmp/* -name "del*" -type f -prune -mtime +15 -print -exec rm {} \;
sh: /usr/bin/find: The parameter list is too long.
[root@oradb1:]/tmp<>>> find /tmp/* -name "del*" -type f -prune -mtime +15 -print
sh: /usr/bin/find: The parameter list is too long.
[root@oradb1:]/tmp<>>> ls -altr /tmp/del*
-rw-rw-rw- 1 rvs users 0 Mar 26 08:00 /tmp/del_file.out
-rw-rw-rw- 1 rvs users 0 Mar 26 08:00 /tmp/del_file.err
-rw-rw-rw- 1 root sys 0 Mar 27 04:05 /tmp/del_dbe.d0032a.out
-rw-rw-rw- 1 root sys 0 Mar 27 04:05 /tmp/del_dbe.d0032a.err
-rw-rw-rw- 1 rvs users 0 Mar 27 06:50 /tmp/delete_bingo.err
-rw-rw-rw- 1 rvs users 0 Mar 27 06:50 /tmp/delete_bingo.out
Only 6 files match the -name "del*"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:33 PM
03-26-2007 08:33 PM
Re: /usr/bin/find argument list too long
Try this one.
find / -path '/tmp/*' -name "del*" -type f -prune -mtime +15 -print | xargs rm
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:38 PM
03-26-2007 08:38 PM
Re: /usr/bin/find argument list too long
be wrong?
find /tmp [...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:39 PM
03-26-2007 08:39 PM
Re: /usr/bin/find argument list too long
your command did not run
but a slight modification made it fly:
find /tmp -path '/tmp/*' -name "del*" -type f -prune -mtime +0 -print
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:40 PM
03-26-2007 08:40 PM
Re: /usr/bin/find argument list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:42 PM
03-26-2007 08:42 PM
Re: /usr/bin/find argument list too long
The problem is that "/tmp/*" is too big, not
that "/tmp/del*" is too big. Your command
doesn't say "/tmp/del*", it says "/tmp/*".
(And, without the quotation marks, the shell
tries to expand "/tmp/*".)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:44 PM
03-26-2007 08:44 PM
Re: /usr/bin/find argument list too long
try your find statement with
-exec rm {} \+ # backslash plus
SEE find(1) section -exec:
When + is used, cmd aggregates a set of path names and executes on the set. Any command arguments between the first occurrence of {} and + are ignored. The reason for preferring + to a ; is vastly improved performance.
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 08:51 PM
03-26-2007 08:51 PM