Original: Linux unzip multiple. gz or. tar.gz files at once
Unzip multiple compressed packages
For extracting multiple .gz
files, use this command:
for gz in *.gz; do gunzip $gz; done
For extracting multiple .tar.gz
files, use the following command:
for tar in *.tar.gz; do tar xvf $tar; done
Extension: Tar command
Tar [-] A--catenate--concatenate | C--create | D--diff--compare | --delete | R--append | T--list | --test-label | U--update | x--extract--get [options] [pathname ...] -A,--catenate,--concatenate append tar files to an archive-c,--create create A new archive-d,--diff,--compa Re find differences between archive and file System--delete Delete from the archive (not on Mag tapes!) -R,--append append files to the end of a archive-t,--list list the contents of an Archive--test-label te St The Archive Volume label and Exit-u,--update only append files newer than copy in Archive-x,--extract,--get Extract files from a archive-a,--auto-compress use archive suffix to determine the compression program--add-file= File add given file to the archive (useful if it name starts with a dash)--anchored patterns match FILE name St art--no-anchored patterns match after any '/' (Default for exclusion)--atime-preserve PREserve access times on dumped files, either by restoring the times--no-auto-compress does not use archive suffix to det Ermine the compression program-b,--blocking-factor BLOCKS BLOCKS x bytes per record-b,--read-full-records Reblock as we read (for 4.2BSD pipes)--backup backup before removal, choose version control-c,--directory DIR C hange to directory Dir--check-device check device numbers when creating incremental archives (default)--no-check-devi Ce does not check device numbers when creating incremental Archives--checkpoint display progress messages every NU Mberth record (default)--checkpoint-action=action execute action on each Checkpoint--delay-directory-restore Delay setting modification times and permissions of Extracted--no-delay-directory-restore cancel the effect of--dela Y-directory-restore Option--exclude=pattern exclude files, given as a pattern--exclude-backups exclude backup an D Lock Files--exclude-caChes Exclude contents of directories containing Cachedir. TAG,--exclude-caches-all exclude directories containing cachedir. Tag--exclude-caches-under exclude everything under directories containing Cachedir. Tag--exclude-tag=file Exclude contents of directories containing FILE, except--exclude-tag-all=file exclude dire Ctories containing file--exclude-tag-under=file exclude everything under directories containing FILE--exclude-vcs Exclude version control system DIRECTORIES-F,--file ARCHIVE use ARCHIVE file or device archive-f,--info-script,- -new-volume-script NAME Run script at end of each tape (IMPLIES-M)--force-local archive file is local even if I t have a colon--full-time print file time to it full resolution-g,--listed-incremental file handle new Gnu-form At incremental backup-g,--incremental handle old Gnu-format incremental backup--group=name Force NAME as Group For added Files-h,--dereference follow symLinks Archive and dump the files they point to-h,--format format Create archive of the given Formatformat is one of the FO Llowing:--format=gnu GNU tar 1.13.x format--format=oldgnu GNU format as per tar <= 1.12--format=pax posi X 1003.1-2001 (Pax) Format--format=posix same as Pax--format=ustar POSIX 1003.1-1988 (ustar) format--format=v7 Old V7 tar format--hard-dereference follow hard links; Archive and dumps the files they refer To-i,--ignore-zeros ignore zeroed blocks in archive (means EOF)-I,--USE-COMPR Ess-program PROG filter through PROG (must accept-d)--ignore-case Ignore case--no-ignore-case case Sensiti ve matching (default)--ignore-command-error ignore exit codes of Children--no-ignore-command-error treat Non-zer o Exit codes of children as Error--ignore-failed-read do no exit with nonzero on unreadable files--index-file=file Send verbose output to File-j,--bzip2-j,--xz-k,--keep-old-files Don ' t replace existing files when extracting-k,--starting-file member-name begin at MEMBER Member-name in the Archi Ve--keep-newer-files don ' t replace existing files that is newer than their archive copies-l,--check-links prin t a message if not all links is dumped-l,--tape-length number change tape after writing number x 1024x768 bytes--level= Number dump level for created Listed-incremental archive--lzip--lzma--lzop-m,--touch don ' t extract file Modifie D time-m,--multi-volume create/list/extract multi-volume archive--mode=changes Force (Symbolic) mode CHANGES fo R added Files--mtime=date-or-file set Mtime for added files from Date-or-file-n,--seek archive is seekable-n,- -newer,--after-date date-or-file only store files newer than Date-or-file--newer-mtime=date compare date and Ti Me when data changed only--null-t reads null-terminated names, disable-c--no-null Disable the effect of the PR Evious--null Option--nuMeric-owner always use numbers for User/group names-o,--to-stdout Extract files to standard output--occurrence Process only the Numberth occurrence of all file in the archive;--old-archive,--portability same as--format=v 7--one-file-system stay in the local file system when creating Archive--overwrite overwrite existing files when extr Acting--overwrite-dir Overwrite metadata of existing directories when extracting (default)--no-overwrite-dir pre Serve metadata of existing directories--owner=name force NAME as owner for added Files-p,--preserve-permissions,--s Ame-permissions extract information about file permissions (default for Superuser)-P,--absolute-names don ' t str IP leading '/' s from File Names--pax-option=keyword[[:]=value][,keyword[[:]=value]] ... control pax Keywords--posix Same as--format=posix--preserve same as both-p and-s--quote-chars=string additionally quote characters fro M string--no-quote-chars=string disable quoting for characters from String--quoting-style=style set name quoting style; See below for valid STYLE Values-r,--block-number show block number within archive with each MESSAGE--RECORD-SIZE=NU Mber number of bytes per record, multiple of 512--recursion recurse into directories (default)--no-recursion Avoid descending automatically in Directories--recursive-unlink empty hierarchies prior to extracting Directory--re Move-files remove files After adding them to the archive--restrict disable use of some potentially harmful optio Ns--rmt-command=command use given RMT command instead of rmt--rsh-command=command use remote command instead of Rsh-s,--preserve-order,--same-order sort names to extract to match archive-s,--sparse handle sparse files eff Iciently--same-owner try extracting files with the same ownership as exists on the archive (default for Superuser)--n O-same-owner Extract files as yoursElf (default for ordinary users)--no-same-permissions apply the user's umask when extracting permissions from the ARC Hive (default for ordinary users)--no-seek archive are not seekable--show-defaults show tar Defaults--show-omitte D-dirs when listing or extracting, list each directory this does not match search criteria--show-transformed-names,- -show-stored-names Show file or archive names after transformation--sparse-version=major[. MINOR] Set version of the sparse format to use (implies--sparse)--strip-components=number strip number leading Components from file names to extraction--suffix=string backup before removal, override usual suffix (' ~ ' unless over Ridden by environment variable Simple_backup_suffix)-T,--files-from FILE get names to extract or create from FI Le--to-command=command pipe extracted files to another program--totals print total bytes after processing the AR Chive;--transform,--xform EXPRESSION use sedReplace EXPRESSION to transform file names-u,--unlink-first remove each file prior to extracting over It--unquote unquote filenames read with-t (default)--no-unquote do not unquote filenames read WITH-T--UTC print file mo Dification times in Utc-v,--verbose verbosely list Files processed-v,--label TEXT Create archive with volume n Ame TEXT; At list/extract time with TEXT as a globbing pattern for volume Name--volno-file=file use/update the volume numb Er in file-w,--interactive,--confirmation ask for confirmation for every action-w,--verify attempt to verify The archive after writing It--warning=keyword warning Control--wildcards use wildcards (default for exclusion)-- Wildcards-match-slash wildcards match '/' (Default for exclusion)--no-wildcards-match-slash wildcards does not mat Ch '/'--no-wildcards verbatim string matching-x,--exclude-from FILE exclude patterns listed in File-z,--gzip, --gunzip--ungZip-z,--compress,--uncompress
Linux command Linux unzip multiple. gz or. tar.gz files at once