Tuesday, April 17, 2007

If your are "fortunate" enough to have to delete a lot of file from a directory on a Unix system, you are likely to encounter the "Parameter List Too Long" problem. This problem is caused by Unix trying to replace the "*" you just used by all names in the directory. This list is then passed to the rm command, which complains that it can not handle that much parameters.

To get around this limitation, you have a couple of options:

Delete all files in the current directory
By far the fastest and most compatible way to delete all files in the current directory without recursing into subdirectories is:
ls | xargs rm
This is the fastest command, because xargs makes sure the maximum allowed number of parameters is passed to rm, resulting in fewer calls/startups to rm.

Delete all files in the current directory and all subdirectories
To delete files not only from the current, but also from all subdirectories, use
find . -name "*" -exec rm -rf {} \;
This is somewhat slower, since rm is executed seperately for each file.

Above commands are tested on AIX and Linux.

posted @ 2:20 PM | Feedback (2)

When copy-pasting in Windows, sometimes the clipboard bar appears, and if you're really "lucky", it also pops up a waring, distracting you from your work. The clipboard holds only 12 items, and I have never met anyone who used more than one. There is no way to turn this irritating feature off, unless you want to use the dreaded registry editor.

Feeling brave? Follow the instructions at http://support.microsoft.com/kb/207438.

posted @ 9:31 AM | Feedback (1)