在Linux中,使用tar
命令解壓文件時,可以通過-C
選項來指定解壓路徑
tar -xvf file.tar -C destination_path
其中:
x
表示解壓v
表示詳細輸出(顯示正在處理的文件)f
表示指定文件名file.tar
是你要解壓的文件destination_path
是你想要將解壓后的文件放置的路徑例如,如果你想要將example.tar
文件解壓到/home/user/Desktop/extracted_files
目錄,你可以使用以下命令:
tar -xvf example.tar -C /home/user/Desktop/extracted_files