Summary of linux efficient shell commands

Source: Internet
Author: User
Summary of linux efficient shell commands cat9.c | awk & amp; #39; NR21 {gsub (/t09/, & quot; ruiy & quot;); printf $0} & amp; #39; 1, comm [2 file row comparison] 1 [root @ localhostruiy] #2 usage: comm [option]... file 1 file 23 summarizes cat 9.c | awk 'NR = 21 {gsub (/t09/, "ruiy"); printf $0} '1, comm [2 file row comparison] 1 [root @ localhost ruiy] #2 usage: comm [option]... file 1 file 2 3 compare sorted files 1 and file 2 row by row. 4 5 if no option is included, the program will generate three columns of output. The first column contains the rows specific to file 1, the second column contains the rows specific to file 2, and the third column contains the rows common to the two files. 6 7-1 no output file 1 Exclusive row 8-2 no output file 2 Exclusive row 9-3 No output two files total row 10 11 -- check-order check input whether sorted correctly, even if all input rows are 12 -- nocheck-order, the system does not check whether the input is correctly sorted. 13 -- output-delimiter = STR is ranked by STR. 14 -- help displays the help information and exits. 15 -- version show version information and exit 16 17. note, the comparison operation follows the rules defined by "LC_CPLLATE. 18 19 example: 20 comm-12 file 1 file 2 only print lines in both file 1 and file 2 21 comm-3 file 1 file 2 print in File 1, the rows not in file 2. And vice versa. 2. sort [string sorting] 29 [root @ localhost ruiy] #30 usage: sort [option]... [file]... 31 or: sort [option]... -- files0-from = F32 concatenates all specified files and writes the results to the standard output. 33 34 parameters required for long options are also required for short options. 35 sorting options: 36 37-B, -- ignore-leading-blanks ignore leading blank areas 38-d, -- dictionary-order only consider blank areas and letter characters 39-f, -- ignore-case ignores the case sensitivity of 40-g letters, -- general-numeric-sort sorts 41-I by regular values, -- ignore-nonprinting only sorts printable characters 42-M, -- month-sort comparison (unknown) <"January" <... <"December" 43 when LC_ALL = C (unknown) <'Jan '<... <'Dec '44-h, -- human-numeric-sort use a variable number (for example, 2 K 1G) 45-n, -- numeric-sort compares 46-R based on string values, -- random-sort sorts 47 according to random hash -- ra Ndom-source = the file obtains the random byte 48-r from the specified file, -- reverse returns the sorting result in reverse order 49 -- sort = WORD sorts by the format specified by WORD: 50 general numbers-g, high readability-h, month-M, number-n, 51 random-R, version-V52-V, -- version-sort natural versions in text 53 other options: 55 56 -- batch-size = NMERGE can merge up to NMERGE inputs at a time. if you enter more 57, use the temporary file 58-c, -- check, -- check = diagnose-first: check whether the input is sorted. if the input is ordered, 59-C, -- check = quiet, -- check = silent is similar to-c, but do not report the first unordered row 60 -- compress-program = the program uses the specified program to compress the temporary file; use the-d parameter of the program 61 to decompress the File 62 -- fi Les0-from = file reads the name terminated with NUL from the specified file, if the file is 63 specified as "-" then read the file name 64-k from standard input, -- key = location 1 [, location 2] start a key at location 1 and terminate at location 2 (end of the row by default) 65-m, -- merge merges sorted files without sorting 66-o, -- output = the file writes the result to the file, but the non-standard output is 67-s. -- stable disables the last-resort comparison to stabilize the comparison algorithm 68-S, -- buffer-size = size specifies the master memory cache size 69-t, -- field-separator = Use the specified separator to replace non-space to space conversion 70-T, -- temporary-directory = The directory uses the specified directory instead of $ TMPDIR or/tmp as the 71 temporary directory. multiple options can be used to specify multiple directories 72-u, -- unique works with-c, strictly verify the sorting. if-c is not used Only output the sorting result 73-z once. -- zero-terminated uses 0 bytes instead of the new row as the end Mark 3, cut [character truncation in string] 1 [root @ localhost ruiy] #2 usage: cut [option]... [file]... 3. output the specified part from each file to the standard output. 4 5 parameters required for long options are also required for short options. 6-B, -- bytes = list only select the specified byte 7-c, -- characters = list only select the specified byte 8-d, -- delimiter = the delimiter uses the specified delimiter instead of the tab character as the region demarcation 9-f, -- fields = LIST select only these fields; also print any line10 that contains no delimiter character, unless11 the-s option is specified12-n with-B: don't split multibyte characters13 -- complement: the byte, character, or field 14-s, -- only-delimited does not print rows that do not contain delimiter. 15 -- output-delimiter = the string uses the specified string as the output delimiter. the default value is Enter the dividing line 17 of 16 -- help to display the help information and exit 18 -- version to display the version information and exit 19 20. only use one of f-B,-c, or-f. Each list is made for a specific category, or you can use commas (,) to separate different categories to be displayed at the same time. Your input order is used as the read order, and each can only be entered once. 22 The format of each parameter is as follows: 23 N starting from 1st N bytes, character or domain 24 N-all characters from N beginning to end of row, byte or domain 25 N-M from N (including the M number) all characters, bytes, or fields 26-M from 1st to M (including M), bytes, or fields with vnc configuration. the vnc in centos is tigervnc. because it is a server, we only need to install tigervnc-server: yum install tigervnc-server and then modify the vnc configuration file: cd/vi/etc/sysconfig/vncservers only requires two types of content. one is to define the user, and the other is to define the user logon condition: VNCSERVERS = "1: root 2: river "VNCSERVERARGS [1] ="-geometry 800x600-nolisten tcp "VNCSER VERARGS [2] = "-geometry 800x600-nolisten tcp" next, log on to the root and river users in command line mode, and set the vncserver password after logon. the operation after logon is as follows: vncpasswdPassword enter password Verify enter password again start vnc service:/sbin/service vncserver start set firewall: iptables-I INPUT-p tcp -- dport 5901: 5902-j ACCEPT iptables-I INPUT-p udp -- dport 5901: 5902-j ACCEPT configuration graphical interface: cd ~ /. Vncvi xstartup: modify the twm at the end of the document to gnome-session or startkde. do not add any characters after this. Otherwise, you will be responsible for the consequences. Haha. Log on to the vnc viewer: xxx. xxx. xxx. xx: 1. check windows after the colon. download the vnc view software. if you cannot log on, restart vncserver [/sbin/service vncserver restart]

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.