RHCE7 Manage I-12 archive files and copy files between Linux systems

Source: Internet
Author: User
Tags bz2

The TAR command uses

The default tar has only the archive function, no compression function

tar [option ...] [File] ...

-c,--create Create

-x,--extract,--get Decompression

-t,--list viewing the contents of an archive file

-F,--file archive name

-v,--verbose Show details of the archive

-P,--preserve reserved permissions

The commonly used compression tools are:

Gzip xxx.tar.gz

Bzip2 xxx.tar.bz

[Email protected] ~]# mkdir/Pub [[email protected]~]# CD/Pub[[email protected] pub]# CP/etc/passwd. [email protected] pub]# CP/etc/Shadow. [[email protected] pub]# lspasswd shadow[[email protected] pub]# tar CF pa.tar passwd shadow [[email protected] pub]# ls passwd Pa.tar shadow[[email protected] pub]# tar tf pa.tar passwdshadow[[email protected] pub]# tar czvf pa.tar.gz PASSW D shadow passwdshadow[[email protected] pub]# tar cjvf pa.tar.bz2 passwd shadow Passwdshadow[[email protected] pub]# LSP ASSWD Pa.tar pa.tar.bz2 pa.tar.gz shadow[[email protected] pub]# RM passwd Shadow rm:remove regular file ' passwd ' ?yrm:remove regular file ' shadow '?Y[[email protected] pub]# Lspa.tar pa.tar.bz2 pa.tar.gz[[email protected] pub]# tar xvzf pa.tar.gz passwdshadow[[em AIL protected] pub]# tar xvzf pa.tar.gz passwd #只是提取passwd文件passwd

Archive based on date:

" 2011/02/09 " -CZVF home.tar.gz/home

than 2011/02/09 new files will be backed up

Back up the/etc/directory, but/ETC/PASSWD does not archive

[Email protected] pub]# tar--exclude/etc/passwd-zcvf etc.tar.gz/etc

The default is to extract to the current directory
Unzip to the/tmp/directory using-c:

[Email protected] pub]# tar xvf pa.tar-c/Tmppasswdshadow

Remote Copy command:
SCP
rsync: Incremental Copy

RHCE7 Manage I-12 archive files and copy files between Linux systems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.