tar: Refusing to read archive contents from terminal (missing -f option?) tar: Error is not recoverable: exiting now
时间: 2023-11-03 12:00:37 浏览: 39
tar: Refusing to read archive contents from terminal (missing -f option?) tar: Error is not recoverable: exiting now 这个错误提示表明在使用tar命令时,没有指定-f选项来指定要操作的文件。在使用tar命令时,必须使用-f选项来指定要操作的文件,例如tar -xf file.tar。确保在执行tar命令时使用了正确的选项和文件名。
相关问题
tar: Refusing to read archive contents from terminal (missing -f option?)
这个错误提示说明 tar 命令没有指定归档文件的名称。在使用 tar 命令时,必须使用 -f 选项指定归档文件的名称,例如:
```
tar -cvf archive.tar file1 file2 file3
```
这个命令将会创建一个名为 archive.tar 的归档文件,其中包含了 file1、file2 和 file3 三个文件。
如果你只输入了 tar 命令,但没有指定归档文件的名称,那么 tar 命令就会认为你希望从标准输入中读取数据,因此会出现 "Refusing to read archive contents from terminal" 的错误提示。
因此,如果你想要解决这个问题,可以使用 -f 选项指定归档文件的名称,例如:
```
tar -xvf archive.tar
```
这个命令将会解压缩名为 archive.tar 的归档文件。
tar: Cowardly refusing to create an empty archive 问题
这个错误通常是因为你的 tar 命令语法有问题。具体来说,可能是你没有正确指定要打包的文件或目录名,或者你的选项设置不正确。
为了解决这个问题,你可以检查一下你的 tar 命令是否正确。例如,如果你想将当前目录下的所有文件打包成一个名为 myarchive.tar 的压缩文件,你可以使用以下命令:
```
tar cvf myarchive.tar .
```
在这个命令中,选项 c 表示创建新的压缩文件,选项 v 表示显示 tar 命令的进度,选项 f 表示将输出写入到文件中。最后的 . 表示当前目录下的所有文件。
如果你仍然遇到了问题,你可以查看一下 tar 命令的手册页或者尝试使用不同的选项组合来解决问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)