linux tar cvf_Linux中的Tar命令:Tar CVF和Tar XVF通过示例命令进行了解释

linux tar cvf

The name tar is, by most accounts, short for tape archive. The "tapes" in question would be all those magnetic storage drives that were popular all the way back in the 1950s.

在大多数情况下, tar磁带归档的缩写。 有问题的“磁带”将是所有早在1950年代就很流行的磁存储驱动器。

That suggests that the tar tool might be a bit old and past its prime. But the truth is that, over all the years and through all the seismic changes to the IT world, tar has lost none of its power and value.

这表明tar工具可能有点陈旧,已经过时了。 但事实是,多年来,在IT世界发生的所有重大变化中, tar失去其力量和价值。

In this article, based on content from my Linux in Action book, I'm going to show you the basics of tar archive creation, compression, and restoration. Let's start at the beginning.

在本文中,基于Linux in Action书中的内容 ,我将向您展示tar归档文件创建,压缩和还原的基础知识。 让我们从头开始。

创建档案 (Creating archives)

This example will take all the files and directories within and below the current work directory and build an archive file that I’ve cleverly named archivename.tar.

此示例将获取当前工作目录内和下的所有文件和目录,并构建一个我巧妙地命名为archivename.tar的存档文件。

Here I use three arguments after the tar command:

在这里,我在tar命令之后使用三个参数:

  • the c tells tar to create a new archive,

    c告诉tar创建一个新的存档,

  • v sets the screen output to verbose so I’ll get updates, and

    v将屏幕输出设置为详细,以便我进行更新,并且

  • f points to the filename I’d like to give the archive.

    f指向我要提供存档的文件名。

The * is what tells tar to include all files and local directories recursively.

*是告诉tar递归包括所有文件和本地目录的原因。

$ tar cvf archivename.tar *
file1
file2
file3
directory1
directory1/morestuff
directory1/morestuff/file100
directory1/morestuff/file101

The tar command will never move or delete any of the orig

你可能感兴趣的:(linux,java,python,大数据,centos)