CentOS中的extract功能主要用于解壓縮文件,常見功能如下:
tar -xvf archive.tar
、unzip archive.zip
。-C
或-d
選項設置目標路徑,如tar -xzvf archive.tar.gz -C /path/to/dir
。tar -tzvf archive.tar.gz
、unzip -l archive.zip
。--exclude
排除文件或目錄,--include
僅提取指定內容。--strip-components
去除路徑層級,--transform
重命名路徑。for file in *.tar.gz; do tar -xzvf "$file"; done
。注:部分功能需安裝對應工具(如unzip
),且操作可能覆蓋文件,需謹慎使用。