小编lin*_*s31的帖子

从 tar 中提取单个文件到其他文件夹

我已经为这个问题搜索了多个论坛,并看到了不同的答案,但到目前为止,即使是我在这里看到的,也没有任何效果。

我想从 tar 中提取单个文件到不同的目录。

我试过这个:

tar xvf file.tar -C /home/dir/ filename
Run Code Online (Sandbox Code Playgroud)

或这个:

tar -x filename -f file.tar -C /home/dir
Run Code Online (Sandbox Code Playgroud)

但分别得到了这些错误:

x filename, 14826 bytes, 29 media blocks.
File -C not present in the archive.
File /home/dir not present in the archive.
Run Code Online (Sandbox Code Playgroud)

和:

tar: /dev/rmt0: A file or directory in the path name does not exist.
Run Code Online (Sandbox Code Playgroud)

第一个提取文件但在同一目录中,而不是我想要的文件夹。

scripting tar directory aix

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

aix ×1

directory ×1

scripting ×1

tar ×1