In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Preface
Linux, whose full name is GNU/Linux, is a set of Unix-like operating system that is free to use and spread freely. It is a multi-user, multi-task, multi-thread and multi-CPU operating system based on POSIX and Unix. With the development of the Internet, Linux has received support from software enthusiasts, organizations and companies all over the world. In addition to maintaining a strong momentum of development in servers, it has made great progress in personal computers and embedded systems. Users can not only intuitively obtain the implementation mechanism of the operating system, but also modify and improve Linux according to their own needs to maximize meet the needs of users.
Advantages of Linux:
Stability and efficiency: because Linux is developed from Unix, Linux and Unix have many similarities, not only in the user interface and mode of operation, Linux also inherits the excellent stability and efficiency of Unix. For servers using Linux as the operating system, it is quite common to run without downtime for a year.
Low configuration requirements: Linux has very low hardware requirements, and it can run smoothly on computers a few years ago. With Windows, you need to constantly upgrade the machine's hardware.
Free or small fee: Linux is based on GPL, so anyone can use or modify the original code for free. It costs a little bit of money only if you choose a distribution of Linux made by some vendors.
Strong support: a large number of Linux enthusiasts will communicate and discuss, and develop and share some good software, with a very open atmosphere for use.
Security: Linux has considerable user and community support, so it can quickly discover system vulnerabilities and quickly release security patches.
The regular expression ifconfig | sed-n '2p' | sed 's.roominetUniGOG' | sed's regular netmask. Regular extension after / # can theoretically be replaced by any special character # sed-r can be followed by extension regular extension + (. *) ifconfig | sed-n 2p | sed-r's # ^. * inet (. *) Broast.*$#\ 1normalg'\ 1 represents the regular middle The first GROUP in (. *) is the content ifconfig in (. *) ifconfig | sed-nr '2s# ^. * inet (. *) net.*$#\ 1 synthesize a line ifconfig | awk' NR==2 {print $2}'# take IP address awk default separator is the most convenient ifconfig ens33 for IP with spaces | grep-o "inet [0-9.] *" | grep-o "[0-9.] *" # take IPifconfig ens33 | sed-nr'2s # ^. * inet ([0-9]. *) netmask.*$#\ 1#gp'cat oldboy.txt | sed-r's # ^. * inet (. *) netmask (. *) broadcast (. *) $^ C1\ 2\ 3 # g 'sed-r's # (. *): (. *): (. *) $#\ 7\ 6\ 5\ 3\ 2\ 1 # the maximum number of sed references is 9 after changing positions to references. It is more convenient to use awk to delete sed-n'/ ^ $/ d'# blank lines / / write the string sed'1 here & here & on behalf of C C it can also be the regular expression ls | sed's # (^. *) #mv\ 1.jpgpromog' | bash sed '1~2p's # an i d odd line sed' 2~2p's # an i d even line sed's # ^ # head#g' # add sed's multiple lines operation sed'2a with sed's # ^ # test#g' # at the beginning and testsed's multiple lines operation at the end of testsed Str' '1century 2a recorder str' 1rec 10i recorder str' /' 1recorder 2d '5pm 10d' / '1quote 3p' '1recorder 3p' 1p'1 must have corresponding line in an i d, empty file will make an error In other words, empty files cannot be directly added to sed'/ new/d' # with sed to delete lines containing new. In the sed command-n p in n p sed-n p basically appears in pairs awk-F ":"'{print $1 ":" $2 ":" $3 ":" $4 ":" $5 ":" $6 ":" $7 "-" $1} 'passwd # here is the full-text operation awk-F "5. : 5 | 28 "'NR==5 {print $2}' # 5:5 or 28 as a delimiter two strings are best used | even if a single character is used | otherwise the string causes ambiguity ll | awk'{if ($2 > 5) print $0}'$0 indicates the entire line sed-I's changing the pp in the 1.txt file to dd effective immediately-I means writing directly to the file
# in LINUX, all text processing is done by reading one line (into memory), processing one line output and ending one line in a loop
Use "" for regular expression strings in case of problems
^. * begins with any character. * $ends with any character. ^ word begins with word. Word$ ends with word. [^ word] inverted in parentheses. Represents only one character "Yes character matches all except blank lines" spaces and blank lines are different\ escape * repeat the previous 0 or more characters. * all [abc] matches any character [^ abc] in the set [^ character] matches any character in the set except abc [0-9] [AMuz] [AMuz] a\ {n M\} repeat an at least n times to at most m times # # a\ {NMagol m\} this form must be quoted with "" and there are no spaces on both sides, otherwise an error a\ n,\} a\ {will be reported. M\} a\ {n\} repeat egrep sed-r n times without using\ escape # # to understand the extended regular expression grep-E egrep+ one or more (* is 0 or more)? 0 or a preceding character | indicates that multiple strings egrep "sshd | systemd" () are filtered at the same time and then reference reference (. *)\ 1grep-n-I is case-insensitive-o is only displayed The matching content does not output the whole line of find / test-type f-name "* .sh" | xargs sed-I's uploading newuplog`! The exclamation mark can be reversed-an and-o or can also be written at the same time sed-I's roomoldwords newchangg'. Sh#awkNR $0 full row $1 $2$ NF the last column NF is the full row column $(NF-1) the penultimate line # awk principle one line is a record # RS indicates that the end of a record FS indicates that the separation of an area $NF is the last area ifconfig | awk 'BEGIN {RS= ":"}' {print " $1}'to: instead of carriage return as the newline character # regular condition (NR==2) range (NR==2 NR==5) 2 to "$1" / regular start /, $3 "/ regular end / awk-F" [:] + |\ t + "'{print $2} 'grade with one or more: (spaces or colons) or 1 or more tab tabs as delimiters # BEGIN module END module seq 1 100 | awk' {print a}'1} 'END {print a}' added to 100cat passtemp | awk'{sub (/ x / /) "ppp")}'{print $0} 'awk replace awk' $1~/lisi/ {print $0} 'grade grade file matches $1 line including lisi and prints out line awk' $419 / (5 | 3) $/ {print $0} 'grade match 5 or 3 ends awk' $1cm / ^ [l | W] / {print $0} 'grade match l or W begins with [] and () is strongly recommended for regular matching. Awk-F "\ t"'$3percent / ^ 9 / {print $0} 'grade# does not contain:! Is not included in the awk to use! In awk, there are three functions that can be replaced: sub gsub gensubsub (r, s [, t]) r / find who / s "replace with what" [] replace that part of awk'$1~/zhan/ {gsub (/ zhang3/, "ccccc", $1); print $0} 'grade## attention / zhang3/ "ccccc" and between multiple commands; semicolon
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.