File search - Unix

This is a discussion on File search - Unix ; I am a newbie to Unix. Can someone help me with a command which will list all the zipped files which have a size of 6 MB when they are unzipped? Will the search look in the sub directories too? ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: File search

  1. File search

    I am a newbie to Unix. Can someone help me with a command which will
    list all the zipped files which have a size of 6 MB when they are
    unzipped? Will the search look in the sub directories too?

    Thank you!


  2. Re: File search

    "raghu" writes:

    > I am a newbie to Unix. Can someone help me with a command which will
    > list all the zipped files which have a size of 6 MB when they are
    > unzipped? Will the search look in the sub directories too?


    Why do you ask?

    I'm learing of aswering such specific questions that don't sound like
    they're based on real world usage needs because I did my own homework
    in college, and I think current students should do theirs too.

    The find command with the -exec option and -size options will be very
    very helpful to you though.

    The tough part of that problem is that you may have to unzip all files
    encountered to get a read on the unzipped filesize. Unless the unzip
    command has a way to pretend or report unzipped size that I've never
    had occasion to use in the real world.

    Best Regards,
    --
    Todd H.
    http://www.toddh.net/

  3. Re: File search

    On 31 Oct 2006 21:49:30 -0800, raghu wrote:
    > I am a newbie to Unix. Can someone help me with a command which will
    > list all the zipped files which have a size of 6 MB when they are
    > unzipped?


    Think about that for a minute. How much compression did you get when
    zipped. Pick two files with same number of bytes before compression.
    One binary and other one is an ascii file full of spaces between
    sevelal columns of numbers that are 0 to 999.

    Compress each and check size of each compressed result.


    > Will the search look in the sub directories too?


    Here is an example to print files greater than a meg.

    find / -size +1048000c -print -exec ls -al '{}' \;

  4. Re: File search


    raghu wrote:
    > I am a newbie to Unix. Can someone help me with a command which will
    > list all the zipped files which have a size of 6 MB when they are
    > unzipped? Will the search look in the sub directories too?
    >
    > Thank you!


    Hello if you want to see the file size after the unzip process you
    could use
    unizip -l
    or
    zipinfo -l
    if you has that utilities in your system

    those tools list the files in the zip file and the original files
    sizes.
    with these info you can select the files with the correct uncompresed
    size.


    If in doubt, please post again

    Best regards Henry


+ Reply to Thread