I have a folder with 36,348 files gz files. I want to unzip all of them.
-bash: /usr/bin/gunzip: Argument list too long
Whats the easiest way to get around this?
This assumes that current directory only contains files that you want to unzip.
The limit is in the kernel and is on the cumulative size of the arguments and environment passed to the
POSIXly (and with
(beware that one will also uncompress the hidden
Or you can raise that limit on some systems. On recent versions of Linux:
A bit efficient solution would be,
But if your find does not have -print0 option and your files/dir does not have space in naming, then you can skip -print0 and -0 arguments.
A less efficient ( but long-run very flexible ) process is make a batch file:
shows you what will happen so a simple typo doesn't annihilate your system
does it right now
does it overnight
(note this example does not account for spaces in filenames.)