Unix: Find: The Parameter list is too long.

Discussion in 'Programming' started by wgre0111, Aug 25, 2009.

  1. wgre0111

    wgre0111 New Member

    Joined:
    Oct 19, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    find ./* -prune -name "pkg*" -ctime +30 -exec rm -rf {} \;

    ksh: /usr/bin/find: 0403-027 The parameter list is too long.


    List grew too long and now i need help finding a alternative way to accomplish this task.. It deletes all of the pkg files that are greater then 30 days. PLEASE HELP. Would be nice to just be able to modifiy slightly to accomplish same thing. Or maybe assistance with breaking this down into batches of files at once. Please advise. thanks!
     
  2. asha

    asha New Member

    Joined:
    Nov 9, 2006
    Messages:
    44
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Homemaker
    Location:
    Kolkata
    Home Page:
    http://whatanindianrecipe.com
    Code:
    ls -1|xargs -n 1 -L % find ./% -prune -name "pkg*" -ctime +30 -exec rm -rf {} \;
    Try this!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice