Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004

    Need help with zipping files

    find . | egrep 'avi|wmv|mpeg|mpg|asf|' -exec zip '{}' ';'

    What is wrong with this command

    1. Find the files find . (the . specifies the directory im in)
    2. | pipe that into egrep so that it finds files with extensions
    'avi, wmv, mpeg, mpg and asf'
    3. then exec to execute the find into a zip command

    Although I dont understand the last bit ->'{}' ';'

    My goal is to find video files and then zip them up.
    So say I have over 200 video files already on the server, with one command I would like them all zipped into seperate files.
    Last edited by Blueheaven; 04-19-2005 at 11:13 PM.

  2. #2
    Join Date
    Apr 2004
    I found out from the DC that you can do this

    find . -type f -print | grep -Ei '.(avi|wmv|mpeg|mpg|asf)$' | while read i; do zip "$" "$i" && rm -f "$i"; done

    smashing ...

  3. #3
    Out of interest are you finding that you get much reduction in size when you do this ? I was under the impression video was pretty well compressed anyway with most encoders.


  4. #4
    Join Date
    Apr 2004
    Yes I did notice an improvement but that it really dependent on how the video was encoded. Because there were a large number of files, from a 50 gb drive - a 97% drive dropped to 89% in terms of size.

    But the main benefit was to stop the streaming of video files.

Posting Permissions

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