【Linux命令】linux一次性解压多个.gz或者.tar.gz文件

您所在的位置:网站首页 两个压缩文件一起解压 【Linux命令】linux一次性解压多个.gz或者.tar.gz文件

【Linux命令】linux一次性解压多个.gz或者.tar.gz文件

2024-07-08 21:11| 来源: 网络整理| 查看: 265

原文:linux一次性解压多个.gz或者.tar.gz文件

解压多个压缩包

对于解压多个.gz文件的,用此命令:

for gz in *.gz; do gunzip $gz; done

对于解压多个.tar.gz文件的,用下面命令:

for tar in *.tar.gz; do tar xvf $tar; done 扩展:tar命令 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, --compare find differences between archive and file system --delete delete from the archive (not on mag tapes!) -r, --append append files to the end of an archive -t, --list list the contents of an archive --test-label test the archive volume label and exit -u, --update only append files newer than copy in archive -x, --extract, --get extract files from an archive -a, --auto-compress use archive suffix to determine the compression program --add-file=FILE add given FILE to the archive (useful if its name starts with a dash) --anchored patterns match file name start --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 do not use archive suffix to determine the compression program -b, --blocking-factor BLOCKS BLOCKS x 512 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 change to directory DIR --check-device check device numbers when creating incremental archives (default) --no-check-device do not check device numbers when creating incremental archives --checkpoint display progress messages every NUMBERth record (default 10) --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 --delay-directory-restore option --exclude=PATTERN exclude files, given as a PATTERN --exclude-backups exclude backup and 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 directories 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 it has a colon --full-time print file time to its full resolution -g, --listed-incremental FILE handle new GNU-format 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 following: --format=gnu GNU tar 1.13.x format --format=oldgnu GNU format as per tar


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3