tar: Cowardly refusing to create an empty archive 问题
时间: 2023-09-02 21:09:36 浏览: 125
这个错误通常是因为你的 tar 命令语法有问题。具体来说,可能是你没有正确指定要打包的文件或目录名,或者你的选项设置不正确。
为了解决这个问题,你可以检查一下你的 tar 命令是否正确。例如,如果你想将当前目录下的所有文件打包成一个名为 myarchive.tar 的压缩文件,你可以使用以下命令:
```
tar cvf myarchive.tar .
```
在这个命令中,选项 c 表示创建新的压缩文件,选项 v 表示显示 tar 命令的进度,选项 f 表示将输出写入到文件中。最后的 . 表示当前目录下的所有文件。
如果你仍然遇到了问题,你可以查看一下 tar 命令的手册页或者尝试使用不同的选项组合来解决问题。
相关问题
为什么会这样[user_mongo@nosql01 replicaset]$ cd /opt [user_mongo@nosql01 opt]$ ll total 0 drwxr-xr-x. 3 root root 25 Mar 16 17:08 servers drwxr-xr-x. 2 root root 51 Mar 16 17:10 software [user_mongo@nosql01 opt]$ tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/MPL-2 tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/MPL-2: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/README tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/README: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos: Cannot open: No such file or directory tar: Exiting with failure status due to previous errors [user_mongo@nosql01 opt]$ tar -zcvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information.
根据你提供的信息,出现这种情况可能是因为你没有足够的权限在目标文件夹中创建文件。可以尝试以下解决方法:
1.使用sudo命令运行tar命令,以管理员权限运行。例如:sudo tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/
2.检查目标文件夹/opt/servers/mongodb_demo/replicaset/的权限是否正确,可以使用ls -l命令查看。如果权限不足,可以使用chmod命令更改目标文件夹的权限。例如:sudo chmod 755 /opt/servers/mongodb_demo/replicaset/
希望以上解决方法能够帮助到你。
关于古罗马凯撒被刺的事件,写一篇英语报道,并且要求站在凯撒这一边,注意为新闻报道取一个吸引人的标题,字数250左右
Caesar Assassinated: A Tragic Loss for Rome
On March 15th, 44 BC, the Roman Republic was shaken to its core as its leader, Julius Caesar, was brutally assassinated by a group of senators. It was a tragic loss for Rome and its people.
Caesar, a great military strategist and politician, had been a controversial figure in the Roman Senate. Many senators saw him as a threat to the Republic and its traditions, and some even feared that he would declare himself king. However, Caesar had always been a defender of the people and had done much to improve their lives. He had reformed the calendar, expanded the Roman Empire, and introduced many social and economic reforms.
The assassination of Caesar was a cowardly act, carried out by a group of senators who were blinded by their own ambitions and prejudices. They had conspired against him for months, and when the opportunity presented itself, they struck. Caesar was stabbed 23 times, and he died on the steps of the Senate.
The people of Rome were shocked and outraged by the assassination of their beloved leader. Many took to the streets in protest, and there were fears of a civil war. However, Caesar's loyal supporters, including Mark Antony and Octavian, managed to restore order and prevent further bloodshed.
Caesar's death was a great loss for Rome. He had been a visionary leader who had brought peace and prosperity to the city. His legacy would live on, however, and his memory would inspire future generations of Romans to strive for greatness.
In conclusion, the assassination of Julius Caesar was a tragic event that shook Rome to its core. It was a cowardly act carried out by ambitious men who were blinded by their own prejudices. However, Caesar's legacy would live on, and his memory would inspire future generations of Romans to strive for greatness.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![crx](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![ipynb](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)