Shell Batch Decompression method

Source: Internet
Author: User

First:

For tar in *.tar.gz; Do tar xvf $tar; Done

For tar in *.tar.bz2; Do tar xvf $tar; Done

Second: Bulk unzip all tar.gz files in a folder with the tar command

LS *.tar.gz | Xargs-n1 Tar XZVF

Third: find-maxdepth 1-name "*.gz" |xargs-i tar xvzf {}

This command can decompress all GZ files in the current directory

Batch decompression is a relatively depressed thing, before trying various methods, even with a script to extract the loop statement is not

Now I find this command can be done, maxdepth means search depth, 1 means search only the current directory

IV: For I in $ (ls *.gz);d o tar xvf $i;d One


This article is from "happy spicy small." "blog, declined reprint!"

Shell Batch Decompression method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.