Saturday, July 25, 2009

Attention:This file(or car??) is backing up

Note: xxx and yyy are filenames

# tar -cvf archive.tar xxx
create a uncompressed tarball

# tar -cvf archive.tar xxx yyy dir1
create an archive containing 'xxx', 'yyy' and 'dir1'

# tar -tf archive.tar
show contents of an archive

# tar -xvf archive.tar
extract a tarball

# tar -xvf archive.tar -C /dir
extract a tarball into /dir

# tar -cvfj archive.tar.bz2 dir1
create a tarball compressed into bzip2

# tar -xvfj archive.tar.bz2
>> decompress a compressed tar archive in bzip2

# tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg'
>> Make encrypted archive of dir/ on a remote machine

dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz'
>> Backup harddisk to a remote machine

# tar -cvfz archive.tar.gz dir1
create a tarball compressed into gzip

# tar -xvfz archive.tar.gz
Uncompress a compressed tar archive in gzip

# unzip xxx.zip
Uncompress a zip archive

# zip xxx.zip xxx
create an archive compressed in zip


# bunzip2 xxx.bz2
Uncompress a file called 'xxx.bz2'

# bzip2 xxx
compress a file called 'xxx'

# gunzip xxx.gz
Uncompress a file called 'xxx.gz'

# gzip xxx
compress a file called 'xxx'

# gzip -9 xxx
compress with maximum compression

No comments:

Post a Comment