Backup and recovery documentation
using compression and decompression tool gzip and gunzip command (compression, decompression) using the command gzip compressed files is .gz suffix use the -9 option can increase the compression ratio of compression and decompression decompression -d is not to save the source file gzip file gunzip file .gz gzip -d file .gz gzip2 and bunzip2 command format: gzip2 file name gzip2 -d filename .gz bunzip .gz file
Use tar archive and release tool
-c create a tar package file format
-C released when extracting the specified target file
-f indication archive
-j call bzip2 compression or decompression program
rights reserved files and directories when -p package
-P retention of files and directories when packaged absolute path
-t to view a list of files in the package
-v Prints detailed information
-x unpack .tar file format
-z call gzip compression or decompression program
formats:
tar (option) archiving and compression source file or directory names need to be archived
example:
tar -cvf test.tar.gz the Test
tar xf test.tar.gz
using the vi text editor,
vi editor working mode
Command mode:
Open the file in the default mode is the command, move the cursor function, the search string, and delete copy and paste the contents of the file-related operations such as
input mode : line mode: save the file in the open With command mode input:
Mode switching
-a content inserted after the cursor position
-A an insert in the end of the line cursor position
-i content inserted before the cursor position
-I first row is inserted at the cursor location content
-o insert a new row after the cursor location row
in front of the cursor position -O creatures row into a new line
to move the cursor
up and down
flip mobile
Ctrl + F a flip down
Ctrl + B flip up to a
quick jump inline
pressing the Home key number 0 or the ^ the cursor to the beginning
press $ END key or to quickly jump to the end of the line
between the line quickly jump
1G gg jump to the first line of the file contents
G jumps to the last line of the file contents
#G jump to a file # # the first row number
set nu show line numbers
set nonu line number to cancel
copy, paste and delete
delete
x or delete key to delete a single character at the cursor
dd delete row #dd content can be deleted rows # # (number)
D ^ deleted cursor to the beginning of all the contents of
d $ delete all the cursor to the end of the line
copy
yy copy the line with
#yy can copy multiple lines (# digital)
Paste
p paste
lookup file contents
by "/" Enter the n're looking down looking up N lookup
revocation
u Undo the last
U is withdrawn to just open the file
Line mode basic operation
w Storage
w / root / aaa Save the file content to the / root / aaa the
q exit
q! Force Quit
Save and exit wq
wq! forced to save and exit
x save
open a new file or other document to read the contents of
e ~ / aaaa open / aaaa file for editing
r / etc / passs can read the file and copy the file to the cursor line
replace the contents of the file
format :
[replacement range] Sub / old content / new contents / G
Sub s abbreviated to
% represents all rows
n, m specific range
Examples:
:% S / # UseDNS Yes / NO UseDNS / G