Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi, i have this directory with multiple images 'pics' and the size is 20mb, and i want to make a .zip or .rar package of this directory but with an increased size so the .zip/.rar file will be 100mb, and then when you extract it the file size is the original 20mb.
I just tested this with a directory I have with about 28 megs in it. Using the Nautilus right-click-->create archive-->zip menu choice, I zipped it into a zip that was slightly less than 28 megs.
I've used compressed files for years, but this is truly unusual. No solutions, but three ideas for testing:
1. This is a wild guess, but have you looked at the folder contents with "view hidden files" turned on and verified that there are no hidden files in there? (But even hidden contents should show up the folder size).
2. If you point to the archive in a file manager, right click, and select "view archive" or the equivalent from the menu, do you see anything in there that doesn't belong?
3. Have you tried creating a tar.gz compressed file from the command line. Here's the command syntax with a link to a nice explanation:
It sounds like you want the zip file to be 100 MB. Is that correct? Zip and rar are supposed to make the archive file smaller than the sum of the original files.
OK, I have tested that and it is rather simple.
Let's say you have compressed your images with rar and the resulting file, i.E. images.rar, is 20MB in size. That means, to get a file, that has a size of 100MB we have to add 80MB to that file.
The command to do that is :
This will push 80 1MB-blocks with zeroes through the pipe to the cat command, which will send them to stdout. With the >>-redirector we will append them to our rar-file.
And see, we will have a rar that is 100MB in size.
If you unrar it, the extraction command will simply ignore the added zeroes.
Sure this creates a separate file, but it also allows you to specify precisely how big you want it. Again, zip didn't seem to like this, but if TobiSGD is correct, then rar might work ok.
I also wouldn't be too hasty to dismiss using a hidden file to inflate a zip archive:
OK, I have tested that and it is rather simple.
Let's say you have compressed your images with rar and the resulting file, i.E. images.rar, is 20MB in size. That means, to get a file, that has a size of 100MB we have to add 80MB to that file.
The command to do that is :
This will push 80 1MB-blocks with zeroes through the pipe to the cat command, which will send them to stdout. With the >>-redirector we will append them to our rar-file.
And see, we will have a rar that is 100MB in size.
If you unrar it, the extraction command will simply ignore the added zeroes.
I just wonder what purpose this should have?
i tested this with rar and it works!!! thank you very much TobiSGD!
i needed this for uploading to a filehost in wich i need my files to be 100mb minimum.
i tested this with rar and it works!!! thank you very much TobiSGD!
i needed this for uploading to a filehost in wich i need my files to be 100mb minimum.
Thanks for the update, and especially for telling us WHY you needed this - the WHY might be just the detail that makes this thread helpful for others who are in the same boat, but to whom it has not occurred to artificially enlarge the archive.
Cheers! And, if/when the issue is solved to your satisfaction, please remember to mark the thread [SOLVED] using "Thread Tools" menu near the top of the thread, if you have not yet done so. That'll help others find the thread if they search specifically for solved threads.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.