{"id":133,"date":"2023-08-16T20:00:04","date_gmt":"2023-08-16T12:00:04","guid":{"rendered":"http:\/\/8.130.131.184\/wordpress\/?p=133"},"modified":"2023-08-17T22:14:42","modified_gmt":"2023-08-17T14:14:42","slug":"shell%e6%96%87%e6%9c%ac%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/xianyijitan.top\/?p=133","title":{"rendered":"Shell\u6587\u672c\u5904\u7406"},"content":{"rendered":"<h2>\u6b63\u5219\u8868\u8fbe\u5f0f<\/h2>\n<ul>\n<li>\n<h3>\u6b63\u5219\u8868\u8fbe\u5f0f\u6982\u8ff0<\/h3>\n<ul>\n<li>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u7531\u4e00\u4e32\u5b57\u7b26\u548c\u5143\u5b57\u7b26\u6784\u6210\u7684\u5b57\u7b26\u4e32<\/li>\n<\/ul>\n<\/li>\n<li>\n<h3>egrep\u5de5\u5177<\/h3>\n<ul>\n<li>\u4ee5\u884c\u4e3a\u5355\u4f4d<\/li>\n<li>\u9ed8\u8ba4\u53ea\u8f93\u51fa\u4e0e\u8868\u8fbe\u5f0f\u76f8\u5339\u914d\u7684\u6587\u672c\u884c<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">\u683c\u5f0f1\uff1aegrep [\u9009\u9879] '\u6b63\u5219\u8868\u8fbe\u5f0f' \u6587\u4ef6... ...\n\u683c\u5f0f2: \u524d\u7f6e\u547d\u4ee4 | egrep [\u9009\u9879] '\u6b63\u5219\u8868\u8fbe\u5f0f'\n-i  \u5ffd\u7565\u5b57\u6bcd\u5927\u5c0f\u5199\n-v  \u6761\u4ef6\u53d6\u53cd\n-c  \u7edf\u8ba1\u5339\u914d\u7684\u884c\u6570\n-q  \u9759\u9ed8\u3001\u65e0\u4efb\u4f55\u8f93\u51fa\uff0c\u4e00\u822c\u7528\u4e8e\u68c0\u6d4b  \n    --\u770b $? \u8fd4\u56de\u503c\uff0c\u8fd4\u56de\u503c\u4e3a0\uff0c\u5219\u8bf4\u660e\u6709\u5339\u914d\uff0c\u8fd4\u56de\u503c\u4e3a\uff0c\u5219\u8bf4\u660e\u65e0\u5339\u914d\n-n  \u663e\u793a\u51fa\u5339\u914d\u7ed3\u679c\u6240\u5728\u7684\u884c\u53f7\n--color \u6807\u7ea2\u663e\u793a\u5339\u914d\u5b57\u4e32<\/code><\/pre>\n<\/li>\n<li>\n<h3>\u57fa\u672c\u5143\u5b57\u7b26<\/h3>\n<ul>\n<li>\u884c\u9996\u5c3e\u53ca\u5355\u5b57\u5339\u914d<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: center;\">\u542b\u4e49<\/th>\n<th style=\"text-align: center;\">\u793a\u4f8b<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">^<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u884c\u9996<\/td>\n<td style=\"text-align: center;\">^abc<\/td>\n<td style=\"text-align: center;\">\u4ee5abc\u5f00\u5934\u7684\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">^<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u884c\u9996<\/td>\n<td style=\"text-align: center;\">^#<\/td>\n<td style=\"text-align: center;\">\u4ee5#\u53f7\u5f00\u5934\u7684\u884c(\u6bd4\u5982\u6ce8\u91ca\u884c)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">$<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u884c\u9996<\/td>\n<td style=\"text-align: center;\">abc$<\/td>\n<td style=\"text-align: center;\">\u4ee5abc\u7ed3\u5c3e\u7684\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">$<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u884c\u9996<\/td>\n<td style=\"text-align: center;\">^$<\/td>\n<td style=\"text-align: center;\">\u7a7a\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">.<\/td>\n<td style=\"text-align: center;\">\u5355\u4e2a\u5b57\u7b26<\/td>\n<td style=\"text-align: center;\">.<\/td>\n<td style=\"text-align: center;\">\u9664\u6362\u884c(\\n)\u4ee5\u5916\u7684\u4efb\u610f\u5355\u4e2a\u5b57\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\"># \u8f93\u51fa\u4ee5root\u5f00\u5934\u7684\u884c\n[root@www ~]# egrep \"^root\" \/etc\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash\n\n# \u7edf\u8ba1\u4ee5bash\u7ed3\u5c3e\u7684\u884c\n[root@www ~]# egrep -c \"bash$\" \/etc\/passwd\n38\n<\/code><\/pre>\n<ul>\n<li>\u672a\u5b9a\u5339\u914d\u6b21\u6570<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: center;\">\u542b\u4e49<\/th>\n<th style=\"text-align: center;\">\u793a\u4f8b<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">+<\/td>\n<td style=\"text-align: center;\">\u6700\u5c11\u5339\u914d\u4e00\u6b21<\/td>\n<td style=\"text-align: center;\">a+<\/td>\n<td style=\"text-align: center;\">\u4e00\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">+<\/td>\n<td style=\"text-align: center;\">\u6700\u5c11\u5339\u914d\u4e00\u6b21<\/td>\n<td style=\"text-align: center;\">(abc)+<\/td>\n<td style=\"text-align: center;\">\u4e00\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684abc<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">?<\/td>\n<td style=\"text-align: center;\">\u6700\u591a\u5339\u914d\u4e00\u6b21<\/td>\n<td style=\"text-align: center;\">a?<\/td>\n<td style=\"text-align: center;\">0\u4e2a\u62161\u4e2aa<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">?<\/td>\n<td style=\"text-align: center;\">\u6700\u591a\u5339\u914d\u4e00\u6b21<\/td>\n<td style=\"text-align: center;\">(abc)?<\/td>\n<td style=\"text-align: center;\">0\u4e2a\u62161\u4e2aabc<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">*<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5b57\u6570<\/td>\n<td style=\"text-align: center;\">a*<\/td>\n<td style=\"text-align: center;\">0\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">*<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5b57\u6570<\/td>\n<td style=\"text-align: center;\">(abc)*<\/td>\n<td style=\"text-align: center;\">0\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684abc<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">*<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5b57\u6570<\/td>\n<td style=\"text-align: center;\">.*<\/td>\n<td style=\"text-align: center;\">\u4efb\u610f\u957f\u5ea6\u7684\u4efb\u610f\u5b57\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\"># \u5339\u914ddeam\uff0c\u6700\u591a\u5339\u914d\u4e00\u6b21\n[root@www ~]# egrep \"(daem)+\" \/etc\/passwd\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\n\n# \u521b\u5efa\u6587\u4ef6\n[root@www ~]# vim reg.txt\n[root@www ~]# cat reg.txt \nacd XX\nXX\nabcabcd XX\n\n# \u5339\u914dabc\uff0c\u6700\u5c11\u5339\u914d\u4e24\u6b21\n[root@www ~]# egrep '(abc)+' reg.txt\nabcd XX\nabcabcd XX\n\n# \u5339\u914d\u4efb\u610f\u5b57\u6570\n[root@www ~]# egrep '(abc)*' reg.txt\nabcd XX\nXX\nabcabcd XX<\/code><\/pre>\n<ul>\n<li>{}\u9650\u5b9a\u6b21\u6570<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: center;\">\u542b\u4e49<\/th>\n<th style=\"text-align: center;\">\u793a\u4f8b<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">{n}<\/td>\n<td style=\"text-align: center;\">\u5339\u914dn\u6b21<\/td>\n<td style=\"text-align: center;\">(ab){3}<\/td>\n<td style=\"text-align: center;\">\u5339\u914dababab<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">{n,m}<\/td>\n<td style=\"text-align: center;\">\u5339\u914dn~m\u6b21<\/td>\n<td style=\"text-align: center;\">(ab)(1,3)<\/td>\n<td style=\"text-align: center;\">\u5339\u914dab\u3001abab\u3001ababab<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">{n,}<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u81f3\u5c11n\u6b21<\/td>\n<td style=\"text-align: center;\">(ab){2,}<\/td>\n<td style=\"text-align: center;\">\u5339\u914d2\u53ca\u4ee5\u4e0a\u4e2a\u8fde\u7eed\u7684ab<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\">[root@www ~]# egrep '(abc){2}' reg.txt\nabcabcd XX\n[root@www ~]# egrep '(abc){1}' reg.txt\nabcd XX\nabcabcd XX\n[root@www ~]# egrep '(abc){2}' reg.txt\nabcabcd XX\n[root@www ~]# egrep '(abc){1}' reg.txt\nabcd XX\nabcabcd XX\n[root@www ~]# egrep '(abc){1,3}' reg.txt\nabcd XX\nabcabcd XX\n[root@www ~]# egrep '(abc){2}' reg.txt\nabcabcd XX\n[root@www ~]# egrep '(abc){1,}' reg.txt\nabcd XX\nabcabcd XX<\/code><\/pre>\n<\/li>\n<li>\n<h3>\u5176\u4ed6\u5143\u5b57\u7b26<\/h3>\n<ul>\n<li>[]\u8303\u56f4\u5185\u5355\u5b57\u5339\u914d<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u793a\u4f8b<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">[a|c45_?]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d a\u3001|\u30014\u30015\u3001_\u3001?<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">[a-z]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5c0f\u5199\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">[A-Z]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5927\u5199\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">[0-9]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">[a-Z0-9]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4efb\u610f\u5b57\u6bcd\u6216\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">[^A-Z]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u975e\u5927\u5199\u5b57\u6bcd\u7684\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">^ [^a-z]<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4e0d\u4ee5\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\">[root@www ~]# cat reg.txt \nabcd XX\nXX\nabcabcd XX\n# \u4e0d\u4ee5\u5927\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c\n[root@www ~]# egrep '[^A-Z]' reg.txt \nabcd XX\nabcabcd XX\n# \u4e0d\u4ee5\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c\n[root@www ~]# egrep '^[^a-z]' reg.txt \nXX<\/code><\/pre>\n<ul>\n<li>\u6574\u4f53\u53ca\u8fb9\u754c\u5339\u914d<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u7c7b\u578b<\/th>\n<th style=\"text-align: center;\">\u542b\u4e49<\/th>\n<th style=\"text-align: center;\">\u793a\u4f8b<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">()<\/td>\n<td style=\"text-align: center;\">\u7ec4\u5408\u4e3a\u6574\u4f53<\/td>\n<td style=\"text-align: center;\">(ad){1,3}<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\uff1aad\uff0cadad\uff0cadadad<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">|<\/td>\n<td style=\"text-align: center;\">\u6216\u8005<\/td>\n<td style=\"text-align: center;\">root|bin<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\uff1aroot, bin<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\b<\/td>\n<td style=\"text-align: center;\">\u5355\u8bcd\u8fb9\u754c<\/td>\n<td style=\"text-align: center;\">\\broot\\b<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u5355\u8bcd\uff1aroot<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\&lt;<\/td>\n<td style=\"text-align: center;\">\u5355\u8bcd\u5f00\u5934<\/td>\n<td style=\"text-align: center;\">\\&lt;th<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u4ee5th\u5f00\u5934\u7684\u5355\u8bcd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">><\/td>\n<td style=\"text-align: center;\">\u5355\u8bcd\u7ed3\u675f<\/td>\n<td style=\"text-align: center;\">\\&lt;root><\/td>\n<td style=\"text-align: center;\">\u4f5c\u7528\u4e0e\\broot\\b\u4e00\u6837<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\w<\/td>\n<td style=\"text-align: center;\">\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf<\/td>\n<td style=\"text-align: center;\">\\wa<\/td>\n<td style=\"text-align: center;\">\u5339\u914dxa\uff0c\u4e0d\u5339\u914d#a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\s<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u7a7a\u767d<\/td>\n<td style=\"text-align: center;\">\/sa<\/td>\n<td style=\"text-align: center;\">\u5339\u914da\uff0c\u4e0d\u5339\u914dxa<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\d<\/td>\n<td style=\"text-align: center;\">\u5339\u914d\u6570\u5b57<\/td>\n<td style=\"text-align: center;\">-P \\da<\/td>\n<td style=\"text-align: center;\">\u5339\u914d5a\uff0c\u4e0d\u5339\u914dxa<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f\uff1a\u5176\u4e2d\\\u4e3a\u8f6c\u4e49\u5b57\u7b26\uff0c\u53ef\u4ee5\u4e3a\u4e00\u4e9b\u666e\u901a\u5b57\u7b26\u8d4b\u4e88\u7279\u6b8a\u542b\u4e49\uff0c\u6216\u8005\u5c06\u4e00\u4e9b\u7279\u6b8a\u5b57\u7b26\u53d8\u4e3a\u666e\u901a\u5b57\u7b26<\/p>\n<pre><code class=\"language-shell\"># \u5728\/etc\/passwd\u4e2d\u5339\u914d\u4ee5root\u6216bin\u5f00\u5934\u7684\u884c\n[root@www ~]# egrep '^root|^bin' \/etc\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\n\n# \u5339\u914d\u4ee5abc\u4e09\u4e2a\u5b57\u6bcd\u4e3a\u884c\n[root@www ~]# cat reg.txt \nabc\nd XX\nXX\nabcabcd XX\n[root@www ~]# egrep '\\<abc\\>' reg.txt \nabc<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>sed\u57fa\u672c\u7528\u6cd5<\/h2>\n<ul>\n<li>\n<h3>sed\u547d\u4ee4\u89e3\u6790<\/h3>\n<pre><code class=\"language-shell\">\u683c\u5f0f1\uff1ased [\u9009\u9879] '\u6761\u4ef6\u6307\u4ee4' \u6587\u4ef6... ...\n\u683c\u5f0f2: \u524d\u7f6e\u547d\u4ee4 | sed [\u9009\u9879] '\u6761\u4ef6\u6307\u4ee4'\n-n  \u5c4f\u853d\u9ed8\u8ba4\u8f93\u51fa\uff0c\u9ed8\u8ba4sed\u4f1a\u8f93\u51fa\u8bfb\u53d6\u6587\u6863\u7684\u5168\u90e8\u5185\u5bb9\n-i  \u4fee\u6539\u6587\u4ef6\u5185\u5bb9\n-r  \u542f\u7528\u6269\u5c55\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\n--\u884c\u53f7\u53ef\u4ee5\u4f7f\u7528\u5355\u4e2a\u6570\u5b57\u6216\u80053,5\u8868\u793a\u8fde\u7eed\u591a\u884c\n--\u7701\u7565\u6761\u4ef6\uff0c\u5219\u9ed8\u8ba4\u9010\u884c\u5904\u7406\u5168\u90e8\u6587\u672c\n--\u5339\u914d\u6b63\u5219\u65f6\u9700\u8981\u4f7f\u7528\/\/<\/code><\/pre>\n<\/li>\n<li>\n<h3>\u5e38\u89c1\u5904\u7406\u64cd\u4f5c\u52a8\u4f5c<\/h3>\n<ul>\n<li>\u5e38\u7528\u64cd\u4f5c<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u64cd\u4f5c\u7b26<\/th>\n<th style=\"text-align: center;\">\u7528\u9014<\/th>\n<th style=\"text-align: center;\">\u6307\u4ee4\u793a\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">p<\/td>\n<td style=\"text-align: center;\">\u6253\u5370\u884c<\/td>\n<td style=\"text-align: center;\">2,4p    \u8f93\u51fa2\u30013\u30014\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">p<\/td>\n<td style=\"text-align: center;\">\u6253\u5370\u884c<\/td>\n<td style=\"text-align: center;\">2p\u30014p    \u8f93\u51fa\u7b2c2\u884c\u3001\u7b2c4\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">d<\/td>\n<td style=\"text-align: center;\">\u5220\u9664\u884c<\/td>\n<td style=\"text-align: center;\">2,4d    \u5220\u9664\u7b2c2\u30013\u30014\u884c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">s<\/td>\n<td style=\"text-align: center;\">\u5b57\u7b26\u4e32\u66ff\u6362<\/td>\n<td style=\"text-align: center;\">s\/old\/new\/    \u6bcf\u884c\u7b2c\u4e00\u4e2a\u66ff\u6362<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">s<\/td>\n<td style=\"text-align: center;\">\u5b57\u7b26\u4e32\u66ff\u6362<\/td>\n<td style=\"text-align: center;\">s\/old\/new\/3    \u6bcf\u884c\u7b2c\u4e09\u4e2a\u66ff\u6362<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">s<\/td>\n<td style=\"text-align: center;\">\u5b57\u7b26\u4e32\u66ff\u6362<\/td>\n<td style=\"text-align: center;\">s\/old\/new\/g    \u5c06\u6240\u6709\u7684\u90fd\u66ff\u6362<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\">[root@www ~]# cat abc.txt \naa\nthe\nthethe\naaathe\nTHE THE\nAAAOOO\n# \u8f93\u51fa\u6240\u6709\u884c\n[root@www ~]# sed -n 'p' abc.txt\naa\nthe\nthethe\naaathe\nTHE THE\nAAAOOO\n# \u8f93\u51fa\u6587\u4ef6\u7684\u884c\u6570\n[root@www ~]# sed -n '$=' abc.txt\n6\n# \u5220\u9664\u7b2c3~5\u884c\n[root@www ~]# sed '3,5d' abc.txt\naa\nthe\nAAAOOO\n# \u5220\u9664\u6700\u540e\u4e00\u884c\n[root@www ~]# sed '$d' abc.txt\naa\nthe\nthethe\naaathe\nTHE THE\n# \u5c06\u7b2c4~6\u884c\u6ce8\u91ca\n[root@www ~]# cat -n abc.txt \n   1  aa\n   2  the\n   3  thethe\n   4  aaathe\n   5  THE THE\n   6  AAAOOO\n[root@www ~]# sed '4,6s\/^\/#\/' abc.txt\naa\nthe\nthethe\n#aaathe\n#THE THE\n#AAAOOO<\/code><\/pre>\n<ul>\n<li>\u6587\u672c\u5757\u5904\u7406<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u64cd\u4f5c\u7b26<\/th>\n<th style=\"text-align: center;\">\u7528\u9014<\/th>\n<th style=\"text-align: center;\">\u6307\u4ee4\u793a\u4f8b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">i<\/td>\n<td style=\"text-align: center;\">\u884c\u524d\u63d2\u5165\u6587\u672c<\/td>\n<td style=\"text-align: center;\">2iYY    \u5728\u7b2c2\u884c\u6dfb\u52a0\u6587\u672cYY<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">i<\/td>\n<td style=\"text-align: center;\">\u884c\u524d\u63d2\u5165\u6587\u672c<\/td>\n<td style=\"text-align: center;\">4,7iYY    \u5728\u7b2c4~7\u884c\u6dfb\u52a0\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">a<\/td>\n<td style=\"text-align: center;\">\u884c\u540e\u63d2\u5165\u6587\u672c<\/td>\n<td style=\"text-align: center;\">2aYY    \u5728\u7b2c2\u884c\u540e\u9762\u6dfb\u52a0\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">a<\/td>\n<td style=\"text-align: center;\">\u884c\u540e\u63d2\u5165\u6587\u672c<\/td>\n<td style=\"text-align: center;\">\/^XX\/aYY    \u5728\u4ee5XX\u5f00\u5934\u7684\u884c\u4e4b\u540e\u6dfb\u52a0\u6587\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">c<\/td>\n<td style=\"text-align: center;\">\u66ff\u6362\u5f53\u524d\u884c<\/td>\n<td style=\"text-align: center;\">2cYY    \u5c06\u7b2c\u4e8c\u884c\u7684\u5185\u5bb9\u4fee\u6539\u4e3aYY<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\">[root@www ~]# cat m.txt\n11111111 Tarena\n222 IT Group\n# \u5728\u7b2c\u4e8c\u884c\u63d2\u5165XX\n[root@www ~]# sed '2iXX' m.txt\n11111111 Tarena\nXX\n222 IT Group\n# \u5728\u7b2c\u4e8c\u884c\u540e\u9762\u63d2\u5165XX\n[root@www ~]# sed '2aXX' m.txt\n11111111 Tarena\n222 IT Group\nXX\n# \u66ff\u6362\u7b2c\u4e8c\u884c\u7684\u5185\u5bb9\u4e3aXX\n[root@www ~]# sed '2cXX' m.txt\n11111111 Tarena\nXX<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>awk\u5e94\u7528<\/h2>\n<ul>\n<li>\n<h3>awk\u547d\u4ee4\u89e3\u6790<\/h3>\n<pre><code class=\"language-shell\">\u683c\u5f0f1\uff1aawk [\u9009\u9879] '[\u6761\u4ef6]{\u6307\u4ee4}' \u6587\u4ef6... ...\n\u683c\u5f0f2: \u524d\u7f6e\u547d\u4ee4 | awk [\u9009\u9879] '[\u6761\u4ef6]{\u6307\u4ee4}'\n-F \u6307\u5b9a\u5206\u9694\u7b26\uff0c\u53ef\u7701\u7565(\u9ed8\u8ba4\u7a7a\u683c\u6216Tab)\n--\u5176\u4e2d\u591a\u6761\u6307\u4ee4\u8bed\u53e5\u53ef\u4ee5\u5206\u53f7\u5206\u9694\uff0cprint\u662f\u6700\u5e38\u7528\u7684\u6307\u4ee4<\/code><\/pre>\n<pre><code class=\"language-shell\"># \u68c0\u67e5\u5185\u5b58\u5269\u4f59\u91cf\n[root@www ~]# free -m | awk '\/Mem\/{print $4\"M\"}'\n238M\n# \u8fc7\u6ee4\u7f51\u7edc\u6d41\u91cf\n[root@www ~]# ifconfig ens160\nens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500\n      inet 192.168.199.128  netmask 255.255.255.0  broadcast 192.168.199.255\n      inet6 fe80::20c:29ff:fe35:80d  prefixlen 64  scopeid 0x20<link>\n      ether 00:0c:29:35:08:0d  txqueuelen 1000  (Ethernet)\n      RX packets 52857  bytes 4466946 (4.2 MiB)\n      RX errors 0  dropped 0  overruns 0  frame 0\n      TX packets 34976  bytes 5125073 (4.8 MiB)\n      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\n[root@www ~]# ifconfig ens160 | awk '\/inet\\>\/{print \"ip\u5730\u5740\u4e3a\uff1a\",$2,\"\u63a9\u7801\u4fe1\u4e3a\uff1a\",$4}'\nip\u5730\u5740\u4e3a\uff1a 192.168.199.128 \u63a9\u7801\u4fe1\u606f\u4e3a\uff1a 255.255.255.0<\/code><\/pre>\n<\/li>\n<li>\n<h3>awk\u5185\u7f6e\u53d8\u91cf<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u53d8\u91cf<\/th>\n<th style=\"text-align: center;\">\u7528\u9014<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">FS<\/td>\n<td style=\"text-align: center;\">\u4fdd\u5b58\u6216\u8bbe\u7f6e\u5b57\u6bb5\u5206\u9694\u7b26\uff0c\u4f8b\u5982 FS= \u201c\uff1a\u201d \uff0c\u4e0e-F\u529f\u80fd\u4e00\u6837<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">$n<\/td>\n<td style=\"text-align: center;\">\u6307\u5b9a\u5206\u9694\u7684\u7b2cn\u4e2a\u5b57\u6bb5\uff0c\u5982$1\u3001$3\u5206\u522b\u8868\u793a\u7b2c\u4e00\u3001\u7b2c\u4e09\u5217<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">$0<\/td>\n<td style=\"text-align: center;\">\u5f53\u524d\u8bfb\u5165\u7684\u6574\u884c\u6587\u672c\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">NF<\/td>\n<td style=\"text-align: center;\">\u8bb0\u5f55\u5f53\u524d\u5904\u7406\u884c\u7684\u5b57\u6bb5\u4e2a\u6570<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">NR<\/td>\n<td style=\"text-align: center;\">\u8bb0\u5f55\u5f53\u524d\u5df2\u8bfb\u5165\u7684\u6570\u91cf(\u884c\u6570)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code class=\"language-shell\">[root@www ~]# cat m.txt\n11111111 Tarena\n222 IT Group\n# \u8f93\u51fa\u5df2\u5904\u7406\u7684\u884c\u548c\u5217\n[root@www ~]# awk '{print NR,NF}' m.txt\n1 2\n2 3<\/code><\/pre>\n<\/li>\n<li>\n<h3>awk\u8fc7\u6ee4\u7684\u65f6\u673a<\/h3>\n<ul>\n<li>awk\u6267\u884c\u547d\u4ee4\u7684\u65f6\u673a\u5305\u62ec\uff1a\u5728\u6240\u6709\u884c\u524d\u3001\u9010\u884c\u3001\u6240\u6709\u884c\u540e\u3002\u4e09\u4e2a\u65f6\u673a\u53ef\u5355\u72ec\u4f7f\u7528\uff0c\u6216\u8005\u540c\u65f6\u4e00\u8d77\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<pre><code class=\"language-shell\"># BEGIN{ } \u884c\u524d\u5904\u7406\uff0c\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u524d\u6267\u884c\uff0c\u6307\u4ee4\u6267\u884c1\u6b21\n# { } \u9010\u884c\u5904\u7406\uff0c\u8bfb\u53d6\u6587\u4ef6\u8fc7\u7a0b\u4e2d\u6267\u884c\uff0c\u6307\u4ee4\u6267\u884cn\u6b21\n# END{ } \u884c\u540e\u5904\u7406\uff0c\u8bfb\u53d6\u6587\u4ef6\u7ed3\u675f\u540e\u6267\u884c\uff0c\u6307\u4ee4\u6267\u884c1\u6b21\n\n[root@svr5 ~]# awk 'BEGIN {print NR} END{print NR}'  m.txt\n0                                        \/\/\u9884\u5904\u7406\u65f6\uff0c\u884c\u6570\u4e3a0\n2                                        \/\/\u5168\u90e8\u5904\u7406\u5b8c\u4ee5\u540e\uff0c\u884c\u6570\u4e3a\u5df2\u8bfb\u5165\u6587\u672c\u7684\u884c\u6570<\/code><\/pre>\n<\/li>\n<li>\n<h3>awk\u5904\u7406\u6761\u4ef6<\/h3>\n<ul>\n<li>\u6b63\u5219\u8868\u8fbe\u5f0f<\/li>\n<\/ul>\n<p>\u6761\u4ef6\u53ef\u4ee5\u7528\/\u6b63\u5219\u8868\u8fbe\u5f0f\/ \u7684\u65b9\u5f0f\uff0c\u4e0esed\u7c7b\u4f3c\uff0c\u5176\u4e2d~ \u8868\u793a\u5339\u914d\u3001!~\u8868\u793a \u4e0d\u5339\u914d\u3002<\/p>\n<pre><code class=\"language-shell\">[root@svr5 ~]# awk -F: '\/^ro\/{print}' \/etc\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash                    \/\/\u5217\u51fa\u4ee5ro\u5f00\u5934\u7684\u7528\u6237\u8bb0\u5f55<\/code><\/pre>\n<ul>\n<li>\u6570\u503c\u6bd4\u8f83<\/li>\n<\/ul>\n<pre><code class=\"language-shell\"># == \u7b49\u4e8e\u3001!= \u4e0d\u7b49\u4e8e\n# > \u5927\u4e8e\u3001>= \u5927\u4e8e\u6216\u7b49\u4e8e\n# < \u5c0f\u4e8e\u3001<= \u5c0f\u4e8e\u6216\u7b49\u4e8e\n\n[root@svr5 ~]# awk 'NF>=2{print}' reg.txt\nabcd XX                  \/\/\u8f93\u51fa\u5305\u542b2\u4e2a\u53ca\u4ee5\u4e0a\u5b57\u6bb5\u7684\u884c\nabcabcd XX<\/code><\/pre>\n<ul>\n<li>\u591a\u4e2a\u6761\u4ef6\u7684\u7ec4\u5408<\/li>\n<\/ul>\n<p>\u591a\u4e2a\u6761\u4ef6\u7684\u7ec4\u5408\u4f7f\u7528\u903b\u8f91\u6bd4\u8f83\u8fde\u63a5\uff0c\u5305\u62ec\u4ee5\u4e0b\u7c7b\u578b\uff1a<\/p>\n<p>&amp;&amp; \u903b\u8f91\u4e0e\uff1a\u671f\u671b\u591a\u4e2a\u6761\u4ef6\u90fd\u6210\u7acb<\/p>\n<p>|| \u903b\u8f91\u6216\uff1a\u53ea\u8981\u6709\u4e00\u4e2a\u6761\u4ef6\u6210\u7acb\u5373\u6ee1\u8db3\u8981\u6c42 <\/p>\n<pre><code class=\"language-shell\">[root@svr5 ~]# awk -F: '$3>=0&&$3<2{print $1,$3}' \/etc\/passwd  \/\/\u5217\u51faUID\u5c0f\u4e8e2\u7684\u7528\u6237\u4fe1\u606f\nroot 0\nbin 1<\/code><\/pre>\n<ul>\n<li>\u53d8\u91cf\u7684\u8fd0\u7b97<\/li>\n<\/ul>\n<p>\u8fd0\u7b97\u7b26\u5305\u62ec\u4ee5\u4e0b\u7c7b\u578b\uff1a<\/p>\n<p>+\u3001-\u3001*\u3001\/\u3001% <\/p>\n<p>++\u3001-- \u3001+=\u3001-=\u3001*=\u3001\/= <\/p>\n<pre><code class=\"language-shell\">[root@svr5 ~]# awk  'BEGIN{i=0} {i+=NF} END{print i}'  reg.txt\n5                  \/\/\u7edf\u8ba1\u6587\u672c\u7684\u603b\u5b57\u6bb5\u4e2a\u6570<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5219\u8868\u8fbe\u5f0f \u6b63\u5219\u8868\u8fbe\u5f0f\u6982\u8ff0 \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u7531\u4e00\u4e32\u5b57\u7b26\u548c\u5143\u5b57\u7b26\u6784\u6210\u7684\u5b57\u7b26\u4e32 egrep\u5de5\u5177 \u4ee5\u884c\u4e3a\u5355\u4f4d \u9ed8\u8ba4\u53ea\u8f93\u51fa\u4e0e\u8868\u8fbe\u5f0f\u76f8\u5339\u914d\u7684\u6587\u672c\u884c \u683c\u5f0f1\uff1aegrep [\u9009\u9879] &#8216;\u6b63\u5219\u8868\u8fbe\u5f0f&#8217; \u6587\u4ef6&#8230; &#8230; \u683c\u5f0f2: \u524d\u7f6e\u547d\u4ee4 | egrep [\u9009\u9879] &#8216;\u6b63\u5219\u8868\u8fbe\u5f0f&#8217; -i \u5ffd\u7565\u5b57\u6bcd\u5927\u5c0f\u5199 -v \u6761\u4ef6\u53d6\u53cd -c \u7edf\u8ba1\u5339\u914d\u7684\u884c\u6570 -q \u9759\u9ed8\u3001\u65e0\u4efb\u4f55\u8f93\u51fa\uff0c\u4e00\u822c\u7528\u4e8e\u68c0\u6d4b &#8211;\u770b $? \u8fd4\u56de\u503c\uff0c\u8fd4\u56de\u503c\u4e3a0\uff0c\u5219\u8bf4\u660e\u6709\u5339\u914d\uff0c\u8fd4\u56de\u503c\u4e3a\uff0c\u5219\u8bf4\u660e\u65e0\u5339\u914d -n \u663e\u793a\u51fa\u5339\u914d\u7ed3\u679c\u6240\u5728\u7684\u884c\u53f7 &#8211;color \u6807\u7ea2\u663e\u793a\u5339\u914d\u5b57\u4e32 \u57fa\u672c\u5143\u5b57\u7b26 \u884c\u9996\u5c3e\u53ca\u5355\u5b57\u5339\u914d \u7c7b\u578b \u542b\u4e49 \u793a\u4f8b \u8bf4\u660e ^ \u5339\u914d\u884c\u9996 ^abc \u4ee5abc\u5f00\u5934\u7684\u884c ^ \u5339\u914d\u884c\u9996 ^# \u4ee5#\u53f7\u5f00\u5934\u7684\u884c(\u6bd4\u5982\u6ce8\u91ca\u884c) $ \u5339\u914d\u884c\u9996 abc$ \u4ee5abc\u7ed3\u5c3e\u7684\u884c $ \u5339\u914d\u884c\u9996 ^$ \u7a7a\u884c . \u5355\u4e2a\u5b57\u7b26 . \u9664\u6362\u884c(\\n)\u4ee5\u5916\u7684\u4efb\u610f\u5355\u4e2a\u5b57\u7b26 # \u8f93\u51fa\u4ee5root\u5f00\u5934\u7684\u884c [root@www ~]# egrep &#8220;^root&#8221; \/etc\/passwd root:x:0:0:root:\/root:\/bin\/bash # \u7edf\u8ba1\u4ee5bash\u7ed3\u5c3e\u7684\u884c [root@www ~]# egrep -c &#8220;bash$&#8221; \/etc\/passwd 38 \u672a\u5b9a\u5339\u914d\u6b21\u6570 \u7c7b\u578b \u542b\u4e49 \u793a\u4f8b \u8bf4\u660e + \u6700\u5c11\u5339\u914d\u4e00\u6b21 a+ \u4e00\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684a + \u6700\u5c11\u5339\u914d\u4e00\u6b21 (abc)+ \u4e00\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684abc ? \u6700\u591a\u5339\u914d\u4e00\u6b21 a? 0\u4e2a\u62161\u4e2aa ? \u6700\u591a\u5339\u914d\u4e00\u6b21 (abc)? 0\u4e2a\u62161\u4e2aabc * \u5339\u914d\u4efb\u610f\u5b57\u6570 a* 0\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684a * \u5339\u914d\u4efb\u610f\u5b57\u6570 (abc)* 0\u4e2a\u6216\u591a\u4e2a\u8fde\u7eed\u7684abc * \u5339\u914d\u4efb\u610f\u5b57\u6570 .* \u4efb\u610f\u957f\u5ea6\u7684\u4efb\u610f\u5b57\u7b26 # \u5339\u914ddeam\uff0c\u6700\u591a\u5339\u914d\u4e00\u6b21 [root@www ~]# egrep &#8220;(daem)+&#8221; \/etc\/passwd daemon:x:2:2:daemon:\/sbin:\/sbin\/nologin # \u521b\u5efa\u6587\u4ef6 [root@www ~]# vim reg.txt [root@www ~]# cat reg.txt acd XX XX abcabcd XX # \u5339\u914dabc\uff0c\u6700\u5c11\u5339\u914d\u4e24\u6b21 [root@www ~]# egrep &#8216;(abc)+&#8217; reg.txt abcd XX abcabcd XX # \u5339\u914d\u4efb\u610f\u5b57\u6570 [root@www ~]# egrep &#8216;(abc)*&#8217; reg.txt abcd XX XX abcabcd XX {}\u9650\u5b9a\u6b21\u6570 \u7c7b\u578b \u542b\u4e49 \u793a\u4f8b \u8bf4\u660e {n} \u5339\u914dn\u6b21 (ab){3} \u5339\u914dababab {n,m} \u5339\u914dn~m\u6b21 (ab)(1,3) \u5339\u914dab\u3001abab\u3001ababab {n,} \u5339\u914d\u81f3\u5c11n\u6b21 (ab){2,} \u5339\u914d2\u53ca\u4ee5\u4e0a\u4e2a\u8fde\u7eed\u7684ab [root@www ~]# egrep &#8216;(abc){2}&#8217; reg.txt abcabcd XX [root@www ~]# egrep &#8216;(abc){1}&#8217; reg.txt abcd XX abcabcd XX [root@www ~]# egrep &#8216;(abc){2}&#8217; reg.txt abcabcd XX [root@www ~]# egrep &#8216;(abc){1}&#8217; reg.txt abcd XX abcabcd XX [root@www ~]# egrep &#8216;(abc){1,3}&#8217; reg.txt abcd XX abcabcd XX [root@www ~]# egrep &#8216;(abc){2}&#8217; reg.txt abcabcd XX [root@www ~]# egrep &#8216;(abc){1,}&#8217; reg.txt abcd XX abcabcd XX \u5176\u4ed6\u5143\u5b57\u7b26 []\u8303\u56f4\u5185\u5355\u5b57\u5339\u914d \u793a\u4f8b \u8bf4\u660e [a|c45_?] \u5339\u914d a\u3001|\u30014\u30015\u3001_\u3001? [a-z] \u5339\u914d\u4efb\u610f\u5c0f\u5199\u5b57\u7b26 [A-Z] \u5339\u914d\u4efb\u610f\u5927\u5199\u5b57\u7b26 [0-9] \u5339\u914d\u4efb\u610f\u6570\u5b57 [a-Z0-9] \u5339\u914d\u4efb\u610f\u5b57\u6bcd\u6216\u6570\u5b57 [^A-Z] \u5339\u914d\u975e\u5927\u5199\u5b57\u6bcd\u7684\u884c ^ [^a-z] \u5339\u914d\u4e0d\u4ee5\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c [root@www ~]# cat reg.txt abcd XX XX abcabcd XX # \u4e0d\u4ee5\u5927\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c [root@www ~]# egrep &#8216;[^A-Z]&#8217; reg.txt abcd XX abcabcd XX # \u4e0d\u4ee5\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u884c [root@www ~]# egrep &#8216;^[^a-z]&#8217; reg.txt XX \u6574\u4f53\u53ca\u8fb9\u754c\u5339\u914d \u7c7b\u578b \u542b\u4e49 \u793a\u4f8b \u8bf4\u660e () \u7ec4\u5408\u4e3a\u6574\u4f53 (ad){1,3} \u5339\u914d\uff1aad\uff0cadad\uff0cadadad | \u6216\u8005 root|bin \u5339\u914d\uff1aroot, bin \\b \u5355\u8bcd\u8fb9\u754c \\broot\\b \u5339\u914d\u5355\u8bcd\uff1aroot \\&lt; \u5355\u8bcd\u5f00\u5934 \\&lt;th \u5339\u914d\u4ee5th\u5f00\u5934\u7684\u5355\u8bcd > \u5355\u8bcd\u7ed3\u675f&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-lixx"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=133"}],"version-history":[{"count":2,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}