Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    9

    Unanswered: deleting files based on the size

    can files be deleted based on the file size??? any example is appreciated....

    Thanx in advance.......

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Code:
    find . -size 1000 -exec 'rm -f {}' \;
    You may want to read the man page for find on your platform for the proper size specification.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Oct 2007
    Posts
    9
    Hi n_i,

    Thanks for prompt reply....i appreciate that.....could you pls also let me know if the size which is shown when we list (ls -al) the files is in kb......you gave size as 1000, is that in kb? I want to delete files which have sizes 100 and 99.....can that be done in one shot??

    Your help is highly appreciated....thanks in advance...

    sonali007

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by sonali007

    Thanks for prompt reply....i appreciate that.....could you pls also let me know if the size which is shown when we list (ls -al) the files is in kb......you gave size as 1000, is that in kb? I want to delete files which have sizes 100 and 99.....can that be done in one shot??
    Quote Originally Posted by n_i
    You may want to read the man page for find on your platform for the proper size specification.
    -----------------------------------------------------------------------
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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