In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the compression, packaging and backup methods of files and file systems under Linux. In daily operation, it is believed that many people have doubts about the compression, packaging and backup methods of files and file systems under Linux. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the doubts about the compression, packaging and backup methods of files and file systems under Linux! Next, please follow the editor to study!
Compression, packaging and backup of files and file systems common compression instructions for Linux systems
The common compression instructions on Linux are gzip, bzip2 and the latest xz
Most compressed files have the following extensions: ".gz, .bz2, .xz, .tar, .tar.gz, .tar.bz2, * .tar.xz"
Packaging instruction: tar
Tar can be used for file packaging, and can support gzip, bzip2, xz compression.
-c: create a compressed file-x: extract-t: view content-r: append files to the end of the compressed archive-u: update files in the original package
These five are independent commands, one of which should be used for compression and decompression, which can be used with other commands, but only one of them can be used. The following parameters are optional when compressing or decompressing files as needed.
-z: with gzip attribute-j: with bz2 attribute-Z: with compress attribute-v: show all procedures-O: unpack the file to standard output
The following parameter-f is required
-f: use the file name and remember that this parameter is the last parameter and can only be followed by the file name.
Tar-czf jpg.tar.gz * .jpg / / package all the jpg files in the directory into jpg.tar and compress them with gzip to generate a gzip compressed package named jpg.tar.gz
Tar-xzvf file.tar.gz / / decompress tar.gz
Backup and restore of XFS file system
XFS file system backup xfsdump
XFS file system restore xfsrestore
To create disc burn data, you can use the mkisofs instruction to create; can be written through wodim CD or DVD recorder dd can back up the full partition or disk, because the dd can read the disk sector surface data cpio is a very good backup instruction, but must be matched with similar find instruction to read the number of file names to backup before the backup operation.
The use of vi
Button description
Part I: description of buttons available in general instruction mode, cursor movement, copy and paste, search and replace, etc.
Method of moving cursor [Ctrl] + [f] screen "move down" one page, equivalent to [Page Down] button (commonly used) [Ctrl] + [b] screen "move up one page Equivalent to [Page Up] button (commonly used) 0 or function key [Home] this is the number "0": move to the front character of this column (commonly used) $or function key [End] move to the last character of this column (commonly used) G move to the last column of this file (commonly used) gg move to the first column of this file, equivalent to 1G! (commonly used) nn is a number. Move the cursor down n columns (commonly used) to search for and replace / word to find a string named word under the cursor. For example, to search for the string vbird in a file, type / vbird! Using / word with n and N is very helpful! It allows you to repeatedly find some keywords you are searching for! The numbers N1 and N2 are the numbers, n1jjn2sqqpxxxxxxxxxx. Look for the string word1 between columns N1 and N2 and replace it with word2! For example, search for vbird between 100 and 200 columns and replace it with VBIRD: ": 100200s/vbird/VBIRD/g". Delete, copy and paste x, X in a column of words, x deletes one character backward (equivalent to [del] key), X deletes one character forward (equivalent to [backspace], that is, backward key) (commonly used) dd delete cursor where the entire column (commonly used) nddn is a number. Delete the downward n-column where the cursor is located. For example, 20dd deletes 20 columns (commonly used) yy the column where the copy cursor is located (commonly used) nyyn is a number. Copy the downward n-column where the cursor is located. For example, 20yy copies 20 columns (commonly used) p, Pp pastes the copied data on the column under the cursor, and P pastes the column on the cursor! For example, I currently have the cursor in column 20 and have copied 10 columns of data. After pressing p, the 10 columns of data will be pasted after the original 20 columns, that is, starting with 21 columns. But what if you press P? Then the original 20th column will be pushed to 30 columns. (commonly used) u restores the previous action. (commonly used) [Ctrl] + r redo the last action. (commonly used) Don't doubt it! This is the decimal point! It means to repeat the previous action. If you want to repeat deletions, pastes, etc., press the decimal point. Just fine! (commonly used)
Part II: a description of the buttons available for switching from general instruction mode to edit mode
Enter the insert or replace edit mode I, I enter the insert mode (Insert mode): I is "insert from the current cursor", I is "insert at the first non-blank character of the current column". (commonly used) a, An enters insert mode (Insert mode): an is "insert from the next character of the current cursor", and An is "insert from the last character of the column where the cursor is located". (commonly used) o, O enters insert mode (Insert mode): this is the case of the letter o. O insert a new column at the next column where the current cursor is located; O insert a new column at the previous column where the current cursor is located! R, R enters substitution mode (Replacemode): r replaces the character of the cursor only once; R replaces the text of the cursor until ESC is pressed; [Esc] exits edit mode and returns to general instruction mode (commonly used)
Part III: description of the available buttons for switching from general instruction mode to the command line interface
Command line interface storage, leave and other instructions: W to write the edited data to the hard disk file (commonly used): W! If the file property is read-only, force the file to be written. However, whether you can write or not has something to do with your file permissions on the file. : Q leave vi (commonly used): Q! If you have modified the file and do not want to save it, use it! The stock case is not saved in order to force departure. : wq is saved and left, if: wq! For changes that leave the (commonly used) vim environment after forced storage: after set nu displays the line number setting, the column's line number is displayed at the prefix of each column: set nonu is the opposite of set nu, which cancels the line number! Vim extra function block selection of keystroke meaning v character selection, will the cursor over the place to highlight the selection! V column selection, will highlight the cursor over the column selection! [Ctrl] + v block selection, you can use a rectangular way to select data y to copy the inverted areas, d to delete the inverted areas, p to paste the newly copied blocks at the cursor!
Multi-file editing
Key for multi-file editing: n edit next file: n edit previous file: files lists all files currently opened by this vim
Multi-window function
Key function in the case of multiple windows: sp [filename] opens a new window. If you add filename, it means to open a new file in the new window, otherwise it means that the two windows are the same file content (displayed synchronously). [ctrl] + w + j
The way to press the [ctrl] + w + ↓ button is to press [ctrl] first, then press w and then release all the keys, and then press j (or down key), then the cursor can move to the lower window. [ctrl] + w + k
[ctrl] + w + ↑ is the same as above, but the cursor moves to the window above. [ctrl] + wenchq actually means: Q ends and leaves! For example, if I want to end the lower window, then use [ctrl] + w + ↓ to move to the lower window and press: Q to leave, or press [ctrl] + Wendq! The problem of Chinese coding
Because there are two kinds of Chinese coding, big5 and utf8, if your document is made using big5 coding, but in the terminal interface of vim you use utf8, because the coding is different, your Chinese document content is of course a pile of garbled code! What shall I do? You have a lot to think about at this time! There are these:
The language data supported by your Linux system by default: this is related to / etc/locale.conf
The language family of your terminal interface (bash): this is related to the variables LANG and LC_ALL
The original code of your file
Open the terminal's software, such as the window interface under GNOME.
In fact, the most important thing is the third and fourth points above, as long as the codes of these two points are the same, you will be able to correctly see and edit your Chinese documents. Otherwise, you will see a lot of garbled codes!
You can use iconv to convert file language codes.
Use dos2unix and unix2dos to change the line break characters at the end of each column of the file.
The environment settings of vim can be written in the ~ / .vimrc file
At this point, the study on the compression, packaging and backup methods of files and file systems under Linux is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.