Some common Linux commands-Note

Source: Internet
Author: User
Tar command:

Main Operation Mode:
-A, -- catenate, -- concatenate append tar files to an archive
-C, -- Create create a new archive
-D, -- diff, -- Compare find differences between archive and File System
-- Delete from the archive (not on Mag tapes !)
-R, -- append files to the end of an archive
-T, -- list the contents of an archive
-- Test-label test the archive volume label and exit
-U, -- Update only append files newer than copy in archive
-X, -- Extract, -- get Extract files from an archive

※Several points worth noting

The reference is a file named "1"-"f" followed by" xxx.tarw.xxx.tar.gz ".
2) When -- delete,-u,-R, and-a are used, the backup files that follow must be uncompressed. If the backup files have been compressed, you need to use gunzip to decompress it first, and then gzip after the operation;
Also, you cannot directly operate tar.gzw.tar.bz2 or other files;
3) when the backup is packaged, the default path is relative, and the exclusion matching method is full-Path Matching by default.
Therefore, when packaging, the system prompts "Tar: removing leading '/' from Member names"
Unless you use the-p parameter or a specific parameter to specify
4) when using the -- exclude parameter, pay attention to the following points:
A) the following two methods can be used: "= file" or "Space File;
B) The following mode must be consistent with the path to be packaged as specified earlier. For example:
Tar-czvf/tmp/test.tar.gz./-- exclude./MySQL
Tar-czvf/tmp/test.tar.gz * -- exclude MySQL
Tar-czvf/tmp/test.tar.gz/var/lib -- exclude/var/lib/MySQL
This is similar to the use of find.
C) if the directory is excluded, the directory name should not be followed by the "/" number. In addition, in tar of some versions (different platforms or earlier versions ), you need to add the * number behind the directory, for example, "-- exclude. /MySQL /*"
D) to exclude multiple files or directories at the same time, add multiple -- exclude parameters, for example:

Tar-czvf/tmp/test.tar.gz./-- exclude./MySQL -- exclude./backup -- exclude./Database

Netstat command

LS command

Mandatory arguments to long options are mandatory for short options too.
-A, -- all do not ignore entries starting.
-A, -- almost-all do not list implied. And ..
-- Author with-L, print the author of each file
-B, -- escape print octal escapes for nongraphic characters
-- Block-size = size use size-byte blocks. See size format below

-I, -- inode print the index number of each file
-I, -- ignore = pattern do not list implied entries matching shell pattern

-R, -- reverse order while sorting
-R, -- Recursive list subdirectories recursively
-S, -- size print the allocated size of each file, in blocks
-S sort by file size
-- Sort = word sort by word instead of name: None-u,
Extension-X, size-S, time-T, version-V
-- Time = word with-L, show time as word instead of Modification
Time: atime-u, access-u, use-u, ctime-C,
Or status-C; use specified time as sort key
If -- Sort = Time
-- Time-style = style with-L, show times using Style:
Full-ISO, long-ISO, ISO, locale, + format.
Format is interpreted like 'date'; If format is
Format1 <newline> format2, format1 applies
Non-recent files and format2 to recent files;
If style is prefixed with 'posix-', Style
Takes effect only outside the POSIX locale
-T sort by modification time
-T, -- tabsize = Cols assume tab stops at each Cols instead of 8
-U with-lt: sort by, and show, access time
With-L: show access time and sort by name
Otherwise: sort by access time
-U do not sort; List entries in directory order
-V natural sort of (Version) numbers within text
-W, -- width = Cols assume screen width instead of current value
-X list entries by lines instead of by columns
-X Sort Alphabetically by entry Extension
-1 list one file per line

Gzip command

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.