Operating System - HP-UX
1753467 Members
5039 Online
108794 Solutions
New Discussion

Re: Max arguments for rm command

 
Dennis Handly
Acclaimed Contributor

Re: Max arguments for rm command

>the next best is to use command lines that will work and avoid those that fail or take enormous amounts of time (and disk I/O).

 

What's why plan B should be used.

 

>the first commands to avoid are simple ls and ll commands. The result will scroll off the top of your screen,

 

You can always redirect the output.

>If you need to remove all the files in a directory (with no subdirectories), then use rm -r mydirname and *not* rm mydirname/*

 

Right.  And copy the permissions/owners if needed to recreate the directory.

>If the directory has subdirectories, you'll have to be more creative by breaking the filenames into manageable groups.

 

Plan B doesn't have any issues with this, unless you don't want to remove subdirectories.  And then with the appropriate -prune, that will work too.