Find the answer to your Linux question:
Results 1 to 2 of 2
Hi Team, I have over 1 lakh pdf files. I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    24

    Create folder by script


    Hi Team,

    I have over 1 lakh pdf files.

    I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it by script? Please help me.

    Thanks & Regards
    Parag Nehete

  2. #2
    Just Joined!
    Join Date
    Oct 2011
    Posts
    22
    Yes you can.

    Code:
    #!/bin/bash
    
    for ((j = 0 ; j <= 5 ; j++ ))
    do
    mkdir -p Disk-$j
    cp pathtopdffiles/*.pdf Disk-$j/
    done

Posting Permissions

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