Results 1 to 8 of 8

Thread: /bin/rm: Argument list too long - deleting tons of files Share/Save - My123World.Com!

  1. #1
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744

    /bin/rm: Argument list too long - deleting tons of files

    You might confront issue deleting tons of files from a directory using command # rm *
    Error Message: bash: /bin/rm: Argument list too long

    Following commands are the saviours, though few more surely be there:

    find . -type f -print -delete
    find . -name "*" -print | xargs rm

    Cheers!
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  2. #2
    I have download Long Path Tool and it is the best solution of your problem.

  3. #3
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744
    Quote Originally Posted by rebeccazoly View Post
    I have download Long Path Tool and it is the best solution of your problem.
    Dude, the solution I posted is for *nix flavors. Your Long Path Tool is for windows (
    • No special system requirements. LONG PATH Tool works on any Windows version (NT/2000/XP/Vista/Windows 7/Windows 8).)
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  4. #4
    thanks for your information, but I have not encountered problem as it..
    what causes so it appears like it?

  5. #5
    Garage Member
    Join Date
    Aug 2012
    Location
    India
    Posts
    97
    Blog Entries
    1
    Something I stumbled across on Quora.

    $ mkdir empty_dir$
    $ rsync -a --delete empty_dir/ yourdirectory/

    Source - http://qr.ae/uErOf
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who
    keeps learning stays young. The greatest thing in life is to keep your mind young.
    - Henry Ford

  6. #6
    Garage Member
    Join Date
    Aug 2012
    Location
    India
    Posts
    97
    Blog Entries
    1
    Also, since I can't edit my last reply, here's the interesting comparison of various methods,

    http://g33kinfo.com/info/archives/5630
    http://www.slashroot.in/which-is-the...files-in-linux

    rsync does seem to be very fast.

    Hope this helps.
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who
    keeps learning stays young. The greatest thing in life is to keep your mind young.
    - Henry Ford

  7. #7
    ... I am no Expert b0nd.g4h@gmail.com b0nd's Avatar
    Join Date
    Jul 2010
    Location
    irc.freenode.net #g4h
    Posts
    744
    rsync indeed is very fast and the best so far I've found for my usages. But it almost freezes your computer and shouldn't be used on any production server.

    Cheers!
    [*] To follow the path: look to the master, follow the master, walk with the master, see through the master,
    ------> become the master!!! <------
    [*] Everyone has a will to WIN but very few have the will to prepare to WIN
    [*] Invest yourself in everything you do, there's fun in being serious

  8. #8
    Garage Member
    Join Date
    Aug 2012
    Location
    India
    Posts
    97
    Blog Entries
    1
    Oh, another thing. There's one more faster way, Perl. Here is the Perl syntax for doing that,

    Code:
    $ perl -e 'for(<*>){((stat)[9]<(unlink))}'
    OR

    Code:
    $ perl -e 'unlink <*>'
    Source: http://www.quora.com/Linux-why-stat+...23&__nsrc__=2#
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who
    keeps learning stays young. The greatest thing in life is to keep your mind young.
    - Henry Ford

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •