AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  remove files

    Posted Tue March 23, 2010 11:59 AM

    Originally posted by: sajid1


    Hi,

    Can i remove files from the particluar folder which have exact 1mb size?

    Thanks
    #AIX-Forum


  • 2.  Re: remove files

    Posted Tue March 23, 2010 12:34 PM

    Originally posted by: MarkTaylor


    yes ;)

    cd /your_directory

    find . -size 1048576c | xargs -i ls -l {}
    1. find . -size 1048576c | xargs -i rm {}

    Use with extreme caution .. this will go into sub directories .. check out the -prune flag to stay in the same dir ..

    You could also use ..

    cd /your_directory
    ls -l | awk '$5==1048576{print $9}' | xargs #### etc blah blah

    HTH
    Mark Taylor
    #AIX-Forum


  • 3.  Re: remove files

    Posted Wed March 24, 2010 02:46 AM

    Originally posted by: sajid1


    Thanks Mark,

    Provided steps The first one worked but second one did not?
    Kindly provide also for time,date and month.

    Regards
    #AIX-Forum


  • 4.  Re: remove files

    Posted Thu March 25, 2010 05:22 AM

    Originally posted by: SystemAdmin


    Check the man page for the options mtime/mmin/atime/amin

    r/
    R
    #AIX-Forum