Score:0

Create multiple ZIP files from a single folder without zipping the whole folder

au flag

I have a problematic web server install where someone has dumped all photo files into a single directory - there are over 250k files - 23 gigs in total on a server with limited space.

I'm looking for a terminal command that would help me extract these files from the server.

What I'm trying to do is create a smaller number of manageable zip files from this single directory, leaving the original directory intact.

For example, create 10 ZIP files each containing 25000 images myfiles1.zip myfiles2.zip myfiles3.zip and so on

Is this even possible?

I know I can ZIP the whole directory, but I dont have the disk space to zip 23gb and then run a split, creating another 23gb of files.

Thanks in advance.

guiverc avatar
cn flag
You've not provided any OS or release details. Why ask here?
terdon avatar
cn flag
Can we assume sane (no newlines, no spaces, no globbing characters or apostrophes) file names or do our solutions need to work for arbitrary names?
Chris A avatar
au flag
Firstly, I'm asking here because this is all new to me - I'm using the Terminal window on CPANEL on a webserver
Chris A avatar
au flag
All file names are something.jpg - mostly camera files eg IMG_12345.jpg
ChanganAuto avatar
us flag
*I'm using the Terminal window on CPANEL on a webserver*... Yes, but is it Ubuntu? For Linux questions about anything there's Unix&Linux. AU is exclusively for Ubuntu and official derivatives.
waltinator avatar
it flag
Read `man find xargs head tail seq`. Use these tools and it's easy.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.