#linux tar (packing, compression, decompression) command c: Create a document t: lists the contents of the archive x: Extract the archive f: filename file name to be operated v: Details 1 compression packing src directory Compression: the packaged file compression, easy storage Note: Compression certain suffix, easy to unzip for easy viewing Linux There are three kinds of compression gzip: Compression fastest, oldest and most widely used; bzip2: small compressed into an archive file, not as good as the availability of gzip; xz: the latest way to provide the best compression ratio. Note: The actual in three cases are likely to encounter, so there must be some way of naming z for gzip compression: filename.tar.gz j for bzip compression: filename.tar.bz2 J xz for compression: filename.tar.xz [root@bt-master01 src]# tar zcf k8s-import.tar.gz /usr/local/src/ 2 . Unpack # Unzip the file add a parameter the X-: tar XF a.tar.gz
3. View archive
[root@bt-master01 src]# tar tf k8s-import.tar.gz |more
usr/local/src/
usr/local/src/k8s-es/
usr/local/src/k8s-es/elasticsearch-services.yaml
usr/local/src/k8s-es/secret.yaml
usr/local/src/k8s-es/elasticsearch-headless.yaml
usr/local/src/k8s-es/elasticsearch-statefulset.yaml.bak
usr/local/src/k8s-es/elasticsearch-statefulset.yaml
usr/local/src/k8s-hadoop/
usr/local/src/k8s-hadoop/kibana.yaml
usr/local/src/k8s-hadoop/hadoop-namenode-pv-pvc.yaml
usr/local/src/k8s-hadoop/hadoop-datanode-pv-pvc.yaml
usr/local/src/k8s-hadoop/hadoop-datanode-service50010.yaml
usr/local/src/k8s-hadoop/hadoop-hdfs-full.yaml
usr/local/src/k8s-hadoop/hadoop-yarn-full.yaml