在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