当前位置: 首页 > news >正文

专业做网站方案六年级下册数学优化设计答案

专业做网站方案,六年级下册数学优化设计答案,网站制作维护发票,杭州做营销型网站文章目录 7.1 通配符7.1.1 通配符介绍7.1.2 通配符示例 7.2 正则表达式7.2.1 grep命令7.2.2 基本正则表达式7.2.3 扩展正则表达式 7.1 通配符 在 Shell 中通配符用于查找文件名和目录名。它是由 Shell 处理的,只会出现在命令的参数中。 7.1.1 通配符介绍 * 匹…

文章目录

    • 7.1 通配符
      • 7.1.1 通配符介绍
      • 7.1.2 通配符示例
    • 7.2 正则表达式
      • 7.2.1 grep命令
      • 7.2.2 基本正则表达式
      • 7.2.3 扩展正则表达式

7.1 通配符

在 Shell 中通配符用于查找文件名和目录名。它是由 Shell 处理的,只会出现在命令的参数中。

7.1.1 通配符介绍

*				匹配任意长度的字符,可以是 0 个
?				匹配任意单个字符,必须是1个
[]				匹配指定的字符范围内的任意单个字符
[a-z,A-Z,0-9]	匹配所有字母和数字,可以不加逗号
[a-z]			匹配所有小写字母
[A-Z]			匹配所有大写字母
[A-z]			匹配所有大小写字母,等价于 [a-z,A-Z]
[:upper:]		匹配所有大写字母,等价于 [A-Z]
[:lower:]		匹配所有小写字母,等价于 [a-z]
[:alpha:]		匹配所有字母,等价于 [A-z]
[:digit:]		匹配所有数字,等价于 [0-9]
[:alnum:]		数字和大小写字母
[:space:]		匹配水平和垂直空白字符
[^]				匹配指定字符范围外的任意单个字符
[^0-9]			匹配除数字以外,它等价于[^[:digit:]]

7.1.2 通配符示例

  1. 显示当前工作目录下所有以arr开头的文件
[root@openEuler ~]# ls a*
ahead  arr1.sh  arr2.sh  arr3.sh
  1. 显示当前工作目录下所以在 arr后有一个字符的文件
[root@openEuler ~]# ls
ahead  arr1.sh  arr2.sh  arr3.sh  arrbb.sh  arrb.sh  ips  myfile arr.sh[root@openEuler ~]# ls arr?.sh
arr1.sh  arr2.sh  arr3.sh  arrb.sh
  1. 显示当前工作目录下所有以im开头的文件
[root@openEuler ~]# ls
ahead  arr1.sh  arr2.sh  arr3.sh  arrbb.sh  arrb.sh  arr.sh  ips  myfile[root@openEuler ~]# ls [im]*
ips  myfile
  1. 显示当前工作目录下所有以字母开头的文件
[root@openEuler ~]# touch {1..5}
[root@openEuler ~]# ls
1  3  5      arr1.sh  arr3.sh   arrb.sh  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   ips  myfile[root@openEuler ~]# touch File{1,2}[root@openEuler ~]# ls 
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile[root@openEuler ~]# ls [a-zA-Z]*
ahead    arr2.sh  arrbb.sh  arr.sh  File2  ips  myfile
arr1.sh  arr3.sh  arrb.sh   File1   i      m[root@openEuler ~]# ls [[:alpha:]]*
ahead  arr1.sh  arr2.sh  arr3.sh  arrbb.sh  arrb.sh  arr.sh[root@openEuler ~]# ls [A-z]*
ahead    arr2.sh  arrbb.sh  arr.sh  File2  ips  myfile
arr1.sh  arr3.sh  arrb.sh   File1   i      m
  1. 显示所有以数字开头的文件
[root@openEuler ~]# ls
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile
[root@openEuler ~]# ls [0-9]*
1  2  3  4  5
[root@openEuler ~]# ls [[:digit:]]*
1  2  3  4  5
  1. 显示所有数字和字母开头的文件
[root@openEuler ~]# ls
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile
[root@openEuler ~]# ls [a-zA-Z0-9]*
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile
[root@openEuler ~]# ls [A-z0-9]*
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile
[root@openEuler ~]# ls [[:alnum:]]*
1  3  5      arr1.sh  arr3.sh   arrb.sh  File1  i    m
2  4  ahead  arr2.sh  arrbb.sh  arr.sh   File2  ips  myfile

7.2 正则表达式

正则表达式是通过一些特殊字符的排列,用于查找、替换、删除一行或多行字符串。它的操作是针对于文件的内容,则前面讲的通配符是针对于文件和目录名的操作。

我们以前面讲的 * 号为例,来说明通配符和正则表达式的区别:如果* 是用于查找文件名或目录名时,表示可以匹配0到多个任意字符,如果*用于查找文件的内容,则表示重复匹配前一个字符0到多次。

在 Shell 中,正则表达式分类两种:

  • 基本正则表达式
  • 扩展正则表达式

7.2.1 grep命令

grep 命令是用于查询或过滤字符的命令,它的语法格式如下:

Usage: grep [OPTION]... PATTERNS [FILE]...
Search for PATTERNS in each FILE.

命令的常用选项介绍:

-n, --line-number		显示行号
-o, --only-matching		只显示匹配的行
-q, --quiet, --silent	静默模式,没有任何输出,要获取内容需要与 $? 来配合使用。
-l, --files-with-matches	如果匹配成功,则只将文件名称打印出来,如果匹配失败,则通过会与 -rl 一起使用
-A, --after-context=NUM		如果匹配成功,则将匹配当前行及其之后 NUM 行一起打印输出
-B, --before-context=NUM	如果匹配成功,则将匹配当前行及其之前 NUM 行一起打印输出
-C, --context=NUM			如果匹配成功,则将匹配行及其前后 NUM 行一起打印输出
-c, --count					如果匹配成功,则将匹配到的行数打印输出
-E, --extended-regexp		正则扩展匹配,需要使用 grep -E 或者 egrep 命令才可以
-i, --ignore-case			忽略大小写匹配
-v, --invert-match			取反,打印不匹配的内容
-V, --version 				显示版本信息
-w, --word-regexp			匹配单词
-x, --line-regexp			匹配行
-s, --no-messages			不显示关于不存在的或者无法读取文件错误信息
-r, --recursive				递归匹配

使用示例:

# 输出匹配的行号
[root@openEuler ~]# grep -n ro* /etc/passwd
1:root:x:0:0:root:/root:/bin/bash
4:adm:x:3:4:adm:/var/adm:/sbin/nologin
5:lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
9:mail:x:8:12:mail:/var/spool/mail:/sbin/nologin# 只输出匹配的内容
[root@openEuler ~]# grep -o redhat /etc/passwd
redhat
redhat
redhat
[root@openEuler ~]# grep -o root /etc/passwd
root
root
root
root# 打印匹配行及其后3行内容
[root@openEuler ~]# grep -A 3 adm /etc/passwd
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown# 打印匹配行及其前3行内容
[root@openEuler ~]# grep -B 3 adm /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin# 打印匹配行及其前后3行内容
[root@openEuler ~]# grep -C 3 adm /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown# 匹配指定的单词
[root@openEuler ~]# grep -w adm /etc/passwd
adm:x:3:4:adm:/var/adm:/sbin/nologin# 不区分大小写匹配
[root@openEuler ~]# grep -w DNS /etc/passwd
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin
[root@openEuler ~]# grep -w dns /etc/passwd
[root@openEuler ~]# grep -wi dns /etc/passwd
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin# 匹配除了nologin单词以外的所有内容
[root@openEuler ~]# grep -wv nologin /etc/passwd
root:x:0:0:root:/root:/bin/bash
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash

7.2.2 基本正则表达式

基本正则表达式(Basic Regular Expression,BRE),又称为标准正则表达式,是最早制订的正则表达式规范,仅支持最基本的元字符集。基本正则表达式是POSIX规范制订的两种正则表达式语法标准之一,另外一种语法标准称为扩展正则表达式。

字符含义
^在每行的开始进行匹配
$在每行的末尾进行匹配
.对任何单个字符进行匹配
*对前一项进行0次或多次重复匹配
[str]对str中的任何单个字符进行匹配
[^str]对任何不在str中的单个字符进行匹配
[a-b]对a到b之间的任何字符进行匹配
\忽略后面一个字符的特殊含义

使用示例:

  1. /etc/passwd 文件中搜索以 root 开头的内容
[root@openEuler ~]# grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash
  1. /etc/passwd 文件中搜索以 nologin 结尾的所有行
[root@openEuler ~]# grep nologin$ /etc/passwd
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
....output omitted....
  1. ~/passwd 文件中搜索b开头,n结尾,并且中间只有一个字符的所有行
[root@openEuler ~]# cat /etc/passwd > passwd
[root@openEuler ~]# echo ban:x::::: >> passwd
[root@openEuler ~]# grep b.n passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
.....output omitted.....
ban:x:::::
  1. ~/passwd 文件中搜索包含 ro* 字符串的所有行
[root@openEuler ~]# cat /etc/passwd > passwd
[root@openEuler ~]# echo ban:x::::: >> passwd
[root@openEuler ~]# echo ro >> passwd
[root@openEuler ~]# echo roo >> passwd
[root@openEuler ~]# echo rooooooo >> passwd[root@openEuler ~]# grep ro* passwd
root:x:0:0:root:/root:/bin/bash
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/dev/null:/sbin/nologin
saslauth:x:998:76:Saslauthd user:/run/saslauthd:/sbin/nologin
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin
libstoragemgmt:x:996:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
dhcpd:x:177:177:DHCP server:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
dbus:x:81:81:D-Bus:/var/run/dbus:/sbin/nologin
polkitd:x:995:993:User for polkitd:/:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
setroubleshoot:x:994:991::/var/lib/setroubleshoot:/sbin/nologin
cockpit-ws:x:993:990:User for cockpit-ws:/:/sbin/nologin
chrony:x:992:989::/var/lib/chrony:/sbin/nologin
systemd-network:x:987:987:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:986:986:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:985:985:systemd Time Synchronization:/:/usr/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
ro
roo
rooooooo
  1. ~/passwd 文件中搜索能够匹配 r[opu]* 的所有行
[root@openEuler ~]# grep r[opu]* ~/passwd
root:x:0:0:root:/root:/bin/bash
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/dev/null:/sbin/nologin
saslauth:x:998:76:Saslauthd user:/run/saslauthd:/sbin/nologin
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin
libstoragemgmt:x:996:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
dhcpd:x:177:177:DHCP server:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
dbus:x:81:81:D-Bus:/var/run/dbus:/sbin/nologin
polkitd:x:995:993:User for polkitd:/:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
setroubleshoot:x:994:991::/var/lib/setroubleshoot:/sbin/nologin
cockpit-ws:x:993:990:User for cockpit-ws:/:/sbin/nologin
chrony:x:992:989::/var/lib/chrony:/sbin/nologin
systemd-network:x:987:987:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:986:986:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:985:985:systemd Time Synchronization:/:/usr/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
ro
roo
rooooooo
[root@openEuler ~]# grep r[opu]. ~/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
saslauth:x:998:76:Saslauthd user:/run/saslauthd:/sbin/nologin
libstoragemgmt:x:996:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
dbus:x:81:81:D-Bus:/var/run/dbus:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
setroubleshoot:x:994:991::/var/lib/setroubleshoot:/sbin/nologin
chrony:x:992:989::/var/lib/chrony:/sbin/nologin
systemd-timesync:x:985:985:systemd Time Synchronization:/:/usr/sbin/nologin
roo
rooooooo
  1. ^$ 表示空行,不是空格。
[root@openEuler ~]# grep -n ^$ passwd
4:
7:
8:
9:
10:
17:
18:
  1. ~/passwd 文件中匹配至少2个o,最多4个o的行
[root@openEuler ~]# grep -E "ro{2,4}" ~/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
roo
rooooooo

注意:要实现这个功能,我们需要添加 -E 选项,因为这是扩展正则表达式,基本正则表达的写法不能处理扩展正则表达式。

7.2.3 扩展正则表达式

扩展正则表达式(Extended Regular Expression,ERE)支持比基本正则表达式更多的元字符,但是扩展正则表达式对有些基本正则表达式所支持的元字符并不支持。前面介绍的元字符“^”、“$”、“.”、“*”、“[]”以及“[^]”这6个元字符在扩展正则表达式都得到了支持,并且其意义和用法都完全相同,不再重复介绍。接下来重点介绍一下在扩展正则表达式中新增加的一些元字符。

字符含义
+对前一项进行1次或多次重复匹配
对前一项进行0次或1次重复匹配
{n}对前一项进行 n 次重复匹配
{n,}对前一项进行 n 次或更多次重复匹配
{,m}对前一项最多进行 m 次重复匹配
{n,m}对前一项至少匹配 n 次,最多匹配 m 次
(s|t)匹配s项或t项中的一项

注意:使用扩展正则表达时,可以使用 grep -E 命令,也可以使用 egrp 命令,推荐使用 egrep 来处理扩展正则表达式

使用示例:

  1. 显示/etc/passwd文件中以bash结尾的行;
[root@openEuler ~]# grep bash$ /etc/passwd
root:x:0:0:root:/root:/bin/bash
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
[root@openEuler ~]# grep -E bash$ /etc/passwd
root:x:0:0:root:/root:/bin/bash
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
[root@openEuler ~]# egrep bash$ /etc/passwd
root:x:0:0:root:/root:/bin/bash
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
  1. 找出/etc/passwd文件中的三位或四位数;
[root@openEuler ~]# grep -E "[0-9]{3,4}" /etc/passwd
games:x:12:100:games:/usr/games:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
saslauth:x:998:76:Saslauthd user:/run/saslauthd:/sbin/nologin
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin
libstoragemgmt:x:996:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
dhcpd:x:177:177:DHCP server:/:/sbin/nologin
polkitd:x:995:993:User for polkitd:/:/sbin/nologin
setroubleshoot:x:994:991::/var/lib/setroubleshoot:/sbin/nologin
cockpit-ws:x:993:990:User for cockpit-ws:/:/sbin/nologin
chrony:x:992:989::/var/lib/chrony:/sbin/nologin
systemd-network:x:987:987:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:986:986:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:985:985:systemd Time Synchronization:/:/usr/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash[root@openEuler ~]# egrep "[[:digit:]]{3,4}" /etc/passwd
games:x:12:100:games:/usr/games:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
saslauth:x:998:76:Saslauthd user:/run/saslauthd:/sbin/nologin
unbound:x:997:996:Unbound DNS resolver:/etc/unbound:/sbin/nologin
libstoragemgmt:x:996:995:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
dhcpd:x:177:177:DHCP server:/:/sbin/nologin
polkitd:x:995:993:User for polkitd:/:/sbin/nologin
setroubleshoot:x:994:991::/var/lib/setroubleshoot:/sbin/nologin
cockpit-ws:x:993:990:User for cockpit-ws:/:/sbin/nologin
chrony:x:992:989::/var/lib/chrony:/sbin/nologin
systemd-network:x:987:987:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:986:986:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:985:985:systemd Time Synchronization:/:/usr/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
  1. 找出/etc/grub2.cfg文件中,以至少一个空白字符开头,后面又跟了非空白字符的行;
[root@openEuler ~]# egrep "^[[:space:]]+[^[:space:]]+" /etc/grub2.cfgload_env -f ${config_directory}/grubenvload_envset default="${next_entry}"set next_entry=save_env next_entryset boot_once=trueset default="${saved_entry}"menuentry_id_option="--id"menuentry_id_option=""set saved_entry="${prev_saved_entry}"...output omitted...
  1. 找出"netstat -tan"命令的结果中,以‘LISTEN’后跟0个或多个空白字符结尾的行;
[root@openEuler ~]# netstat -tan|grep -E "LISTEN[[:space:]]*$"
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
  1. 找出"fdisk -l"命令的结果中,取出硬盘路径;
[root@openEuler ~]# fdisk -l|grep -E "Disk[[:space:]]/[^[:space:]]+"
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk /dev/mapper/openeuler-root: 45.07 GiB, 48393879552 bytes, 94519296 sectors
Disk /dev/mapper/openeuler-swap: 3.93 GiB, 4215275520 bytes, 8232960 sectors
  1. 找出"ldd /usr/bin/cat"命令的结果中文件路径;
[root@openEuler ~]# ldd /usr/bin/cat | egrep "/([a-z,0-9,.]|-)+"libc.so.6 => /usr/lib64/libc.so.6 (0x00007f8aa4d2e000)/lib64/ld-linux-x86-64.so.2 (0x00007f8aa4f49000)[root@openEuler ~]# ldd /usr/bin/cat | egrep "/[^[:space:]]+"libc.so.6 => /usr/lib64/libc.so.6 (0x00007fe49806e000)/lib64/ld-linux-x86-64.so.2 (0x00007fe498289000)
  1. 找出/proc/meminfo文件中,所有以大写或小写s开头的行
[root@openEuler ~]# cat /proc/meminfo | egrep "^(S|s)"
SwapCached:            0 kB
SwapTotal:       4116476 kB
SwapFree:        4116476 kB
Shmem:              8844 kB
Slab:              86148 kB
SReclaimable:      39424 kB
SUnreclaim:        46724 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB[root@openEuler ~]# egrep "^(S|s)" /proc/meminfo 
SwapCached:            0 kB
SwapTotal:       4116476 kB
SwapFree:        4116476 kB
Shmem:              8844 kB
Slab:              86132 kB
SReclaimable:      39424 kB
SUnreclaim:        46708 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
  1. 显示当前系统上rootredhatspark用户的相关信息;
[root@openEuler ~]# egrep "(root|redhat|spark)" /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
  1. echo输出一个绝对路径,使用egrep取出其基名;
[root@openEuler ~]# echo /usr/local/cat | egrep "^/[a-z]+"
/usr/local/cat
  1. 找出ifconfig命令结果中的1-255之间的整数;
[root@openEuler ~]# ifconfig | egrep -w "[1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5]"inet 192.168.72.150  netmask 255.255.255.0  broadcast 192.168.72.255inet6 fe80::20c:29ff:fe4f:96ec  prefixlen 64  scopeid 0x20<link>ether 00:0c:29:4f:96:ec  txqueuelen 1000  (Ethernet)RX packets 18333  bytes 17737370 (16.9 MiB)TX packets 5505  bytes 581056 (567.4 KiB)
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>
  1. 找出ifconfig命令输出中的所有IP地址
[root@openEuler ~]# ifconfig | egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
192.168.72.150
255.255.255.0
192.168.72.255
127.0.0.1
255.0.0.0

文章转载自:
http://hamah.cwgn.cn
http://villanelle.cwgn.cn
http://counterpart.cwgn.cn
http://roomette.cwgn.cn
http://laceration.cwgn.cn
http://barrator.cwgn.cn
http://intermarriage.cwgn.cn
http://rochdale.cwgn.cn
http://celiotomy.cwgn.cn
http://ivanovo.cwgn.cn
http://cankery.cwgn.cn
http://remeasure.cwgn.cn
http://ventage.cwgn.cn
http://depict.cwgn.cn
http://chait.cwgn.cn
http://tenderloin.cwgn.cn
http://feoffee.cwgn.cn
http://cyclamate.cwgn.cn
http://topmast.cwgn.cn
http://decrial.cwgn.cn
http://blacken.cwgn.cn
http://devastate.cwgn.cn
http://enchanting.cwgn.cn
http://dialectal.cwgn.cn
http://germproof.cwgn.cn
http://stepsister.cwgn.cn
http://clinician.cwgn.cn
http://panful.cwgn.cn
http://metazoa.cwgn.cn
http://multilead.cwgn.cn
http://garagist.cwgn.cn
http://tubercled.cwgn.cn
http://archimedean.cwgn.cn
http://indigence.cwgn.cn
http://vestalia.cwgn.cn
http://antehall.cwgn.cn
http://smokestack.cwgn.cn
http://capric.cwgn.cn
http://wisteria.cwgn.cn
http://audiometrist.cwgn.cn
http://pizza.cwgn.cn
http://eximious.cwgn.cn
http://aardvark.cwgn.cn
http://stapedectomy.cwgn.cn
http://admire.cwgn.cn
http://cassaba.cwgn.cn
http://parvis.cwgn.cn
http://globefish.cwgn.cn
http://ogpu.cwgn.cn
http://inelastic.cwgn.cn
http://abdicable.cwgn.cn
http://palatalize.cwgn.cn
http://misword.cwgn.cn
http://iaupe.cwgn.cn
http://bedworthy.cwgn.cn
http://congregation.cwgn.cn
http://melomane.cwgn.cn
http://oenophile.cwgn.cn
http://schematism.cwgn.cn
http://pembrokeshire.cwgn.cn
http://department.cwgn.cn
http://sepulcher.cwgn.cn
http://underpowered.cwgn.cn
http://effable.cwgn.cn
http://gonfalonier.cwgn.cn
http://windblown.cwgn.cn
http://serbonian.cwgn.cn
http://lifespan.cwgn.cn
http://abd.cwgn.cn
http://wettable.cwgn.cn
http://cross.cwgn.cn
http://agueweed.cwgn.cn
http://supertransuranic.cwgn.cn
http://remembrance.cwgn.cn
http://feterita.cwgn.cn
http://demosthenic.cwgn.cn
http://unfriended.cwgn.cn
http://whiteware.cwgn.cn
http://panay.cwgn.cn
http://geopolitics.cwgn.cn
http://peacekeeper.cwgn.cn
http://aquanautics.cwgn.cn
http://assaultable.cwgn.cn
http://lipbrush.cwgn.cn
http://microalloy.cwgn.cn
http://quiveringly.cwgn.cn
http://helicoid.cwgn.cn
http://cushy.cwgn.cn
http://farthest.cwgn.cn
http://argute.cwgn.cn
http://administrator.cwgn.cn
http://microscopical.cwgn.cn
http://thingamy.cwgn.cn
http://introgression.cwgn.cn
http://tamely.cwgn.cn
http://noninstallment.cwgn.cn
http://pedicure.cwgn.cn
http://iatrochemistry.cwgn.cn
http://ginnel.cwgn.cn
http://triggerman.cwgn.cn
http://www.hrbkazy.com/news/78515.html

相关文章:

  • 雄安政府网站开发长沙百度网站优化
  • 河南省住房和城乡建设厅门户网站百度论坛首页
  • 模板网站怎么做sem是什么专业
  • 网站怎么弄seo整站优化哪家专业
  • python 做网站俄罗斯搜索引擎推广
  • 网站页面链接怎么做的南昌seo方案
  • 做类似淘宝的网站seo标题优化步骤
  • 163网易企业邮箱入口天津seo推广服务
  • 网页制作与网站建设技术大全 pdf在百度上怎么发布信息
  • 做带会员后台的网站用什么软件网站的推广方法有哪些
  • 城建培训中心官网关键词排名优化公司外包
  • 哪个网站 可以做快递单录入百度app下载并安装
  • 平潭建设局网站首页seo视频教程我要自学网
  • 怎样申请微信小程序开店汕头seo关键词排名
  • 天津市建设 中标公示网站关键词排名批量查询软件
  • 使用php做的网站有哪些5000元网站seo推广
  • 网站建设贵阳大数据分析营销平台
  • 毕业设计代做淘宝好还是网站好精准营销及推广
  • 北京州网站建设公司万网域名注册查询
  • 单机做游戏 迅雷下载网站网络优化推广公司哪家好
  • 吧网站做软件的软件北京seo优化排名
  • 一个网站开发的流程图百度极简网址
  • jsp网站服务建设开题报告企业培训课程ppt
  • 搜网站内容seo模拟点击算法
  • 厚街网站建设报价文案发布平台
  • 企业网站展示哈尔滨百度关键词优化
  • 邢台吧贴吧学好seo
  • 网站开发 视频存在哪河南最新消息
  • 佛山如何建立网站关键词搜索排名推广
  • 老司机带带我高清精彩免费seo技术有哪些