#!/bin/bash

#########################################################################
# File Name: tarfiles.sh
# Author: wp
# 功能:批量解压*.tar.gz文件
#########################################################################


ls  ./test-tar/*.tar.gz  > test-tar_name.log
        for i in `cat test-tar_name.log`  
                do   
                        tar -zxf $i -C ./test-tar/depress/  >> /dev/null      #解压到./test-tar/depress文件
                done    

 

ubuntu---shell文件批量解压文件

 

 

tar -zxf $i -C ./test-tar/depress/  >> /dev/null           #报错原因是这个压缩包没有用gzip格式压缩,所以不用加z指令

ubuntu---shell文件批量解压文件

 

 

# 功能:批量解压*.tar文件
#########################################################################


ls  ./test-tar/*.tar  > test-tar_name.log
        for i in `cat test-tar_name.log`  
                do   
                        tar -xf $i -C ./test-tar/depress/  >> /dev/null      #解压到./test-tar/depress文件
                done    

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案