Results 1 to 2 of 2

Thread: Batch zip with rules

  1. #1
    Join Date
    Nov 2010
    Beans
    1

    Batch zip with rules

    Hi everyone.
    I have a folder with many many files which should be filed in groups according to the beginning of their names.

    Eg:
    P10001 Form
    P10001 Budget
    P10002 Form 3
    P10002 Budget
    P10002 Schedule

    I want the two files beginning with P10001 in one zip file and the three files beginning with P10002 in another zip file.

    Thanks in advance!

  2. #2
    Join Date
    Sep 2008
    Location
    Ohio
    Beans
    963
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Batch zip with rules

    Code:
    for i in {1..100}
    do
        zip P1000$i.zip P1000$i*
    done

    Assuming we go from P10001 to P1000100.

Tags for this Thread

Bookmarks

Posting Permissions

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