0

I need create folder with date and add some files into that folder and need to zip that folder. For example

I have directory called A which has files like pandi_yyyymmdd.csv, vino_YYYYMMDD.csv

I need to create folder like pandi_vino_YYYYMMDD need to add above files into this folder

Finally I need to zip folder pandi_vino_YYYYMMDD

I tried like below zip -q pandi_vino.`date +%Y%m%d`pandi.20200528.csv | mkdir pandi_vino.`date +%Y%m%d

1
  • 2
    Are you looking for a script to run on a huge set of files or a specific solution for just these two files? Does A only contain these two files, or more? If more, which of the files need to move into the newly created directory and how can your script identify them?
    – nohillside
    Commented May 29, 2020 at 12:33

1 Answer 1

0

I don't know if I understood

If you have to zip the whole A folder as pandi_vino:

FOLDER=pandi_vino_`date +%Y%m%d`; cp -r A $FOLDER && zip -r $FOLDER.zip $FOLDER

If you did mean anything else let me know, first time here

1
  • Is there really no zip option to provide the name of the folder and then have zip do that for you? seems like an important feature.
    – mathlete
    Commented Apr 24, 2022 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .