techniclog

Technical logs..

Working with large directories in AIX/UNIX

leave a comment »

I faced this strange issue today when an AIX directory contained more than 250000 files and I couldnt find an easy way to delete them.

ls or rm commands would return the error:  The parameter or environment lists are too long

My very dear friend and colleague suggested a way out and it worked. Here it is:

find . -name ‘http*’ -print -exec rm {} \;  

This script finds every file that matches http* (the files that I wanted to delete) and deletes them!

Advertisements

Written by techniclog

December 21, 2011 at 4:35 pm

Posted in Tech

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: