把打包文件/root/4-2/zip584.tar中的fileb584删除,其他文件保留不变
时间: 2023-08-16 07:09:38 浏览: 35
可以通过以下命令来实现:
```
tar --delete -f /root/4-2/zip584.tar fileb584
```
这个命令会删除打包文件`/root/4-2/zip584.tar`中名为`fileb584`的文件。其他文件将保留不变。
相关问题
把/root/4-1/目录里面的filea768、fileb768、filec768三个文件打包到/root/4-1/zip768.tar
可以使用以下命令将这三个文件打包为zip768.tar:
```
tar -cvf /root/4-1/zip768.tar /root/4-1/filea768 /root/4-1/fileb768 /root/4-1/filec768
```
解释:
- tar:打包命令
- c:表示创建一个归档文件
- v:表示打包过程中显示详细信息
- f:指定打包后的文件名和路径
- /root/4-1/zip768.tar:指定打包后的文件名和路径
- /root/4-1/filea768 /root/4-1/fileb768 /root/4-1/filec768:指定要打包的文件路径
把/root/4-1目录里面的filea140、fileb140、filec140三个文件打包到/root/4-1/zip140.tar
可以使用以下命令来完成该任务:
```
tar -cf /root/4-1/zip140.tar /root/4-1/filea140 /root/4-1/fileb140 /root/4-1/filec140
```
其中,`tar` 是 Linux 下常用的文件压缩和打包命令,`-cf` 表示创建一个新的 tar 包文件并将文件添加到其中,`/root/4-1/zip140.tar` 是要创建的 tar 包文件路径和名称,后面跟着要打包的文件路径。