1、显示当前系统上root、fedora或user1用户的默认shell;注释:egrep‘^(root|fedora|usr1)\>‘/etc/passwd从/etc/passwd中查找root,fedora,user1用户,存在就匹配,不存在就跳过;cut-d:-f1,7截取第一和第七字段2、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小..
分类:
系统相关 时间:
2016-09-05 17:37:56
阅读次数:
236
1、显示当前系统上root、fedora或user1用户的默认shell;答:Linux的哲学思想之一:组合单一目的的小程序,完成复杂任务;
第一步:使用扩展正则表达式egrep或grep–E显示出匹配到的用户信息;
^:行首锚定,用于模式的最左侧;\>或\b:词尾锚定,用于单词模式的右侧;
[ro..
分类:
其他好文 时间:
2016-09-05 17:36:58
阅读次数:
237
linux文件删除详解1.1linux文件的存储linux在建立文件系统时会将磁盘逻辑上规划成各个块,inode块与block块每一个块都对应一个号码(inode号block号),在本文件系统中唯一,每个inode块缺省为256byteblock块缺省为4K。[root@Centos-1~]#dumpe2fs/dev/sda1|egrep-i"blockcount|..
分类:
系统相关 时间:
2016-09-05 17:30:25
阅读次数:
243
本周作业内容:1、显示当前系统上root、fedora或user1用户的默认shell;[root@liuhome]#grep-E"^(root|fedora|user1)\>"/etc/passwd|cut-d:-f1,7
root:/bin/bash
user1:/bin/bash
fedora:/bin/bash
#本题使用扩展的正则表达式
#^:首行|:或者():将一个或者多个字符捆绑在一起..
分类:
编程语言 时间:
2016-09-05 17:29:22
阅读次数:
291
1、显示当前系统上root、fedora或user1用户的默认shell;egrep"^root|^fedora|^user1"/etc/passwd|cut-d:-f1,72、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小括号的行,形如:hello();grep"\<[[:alpha:]]\+\>()"/etc/rc.d/init.d/functions3、使用echo命令..
分类:
其他好文 时间:
2016-09-05 17:27:26
阅读次数:
127
1、显示当前系统上root、fedora或user1用户的默认shell;[root@bogon~]#useraddfedora#添加用户fedora
[root@bogon~]#useradduser1#添加用户user1
[root@bogon~]#egrep‘^(root|fedora|user1)‘/etc/passwd|cut-d:-f1,7
#使用表达式(root|fedora|user1)查找root、fedora或user1
r..
分类:
编程语言 时间:
2016-09-05 17:25:03
阅读次数:
259
[root@ansible~]#mysqldump-uroot-p123456xxx>/opt/xxx.sql#备份数据库xxx
[root@ansible~]#egrep-v"#|\*|--|^$"/opt/xxx.sql
DROPTABLEIFEXISTS`test`;
CREATETABLE`test`(
`id`int(4)NOTNULLAUTO_INCREMENT,
`name`char(20)NOTNULL,
PRIMARYKEY(`id`)
)ENGINE=InnoDBAUTO_..
分类:
数据库 时间:
2016-09-05 09:17:47
阅读次数:
288
1、显示当前系统上root、fedora或user1用户的默认shell;答:[root@mageeduCT7~]#egrep‘^(root|user1)\>‘/etc/passwd|cut-d:-f7
/bin/bash
/bin/bash2、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小括号的行,形如:hello();答:[root@mageeduCT7~]#grep‘\<[[..
分类:
系统相关 时间:
2016-09-04 17:51:27
阅读次数:
286
1、显示当前系统上root、fedora或user1用户的默认shell;#grep--color-E"^(root|fedora|user1).*‘/etc/passwd|cut-d:-f1,72、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小括号的行,形如:hello();grep--color-E"[[:alnum:]]+\(\)"/etc/rc.d/init.d/functionsgrep..
分类:
其他好文 时间:
2016-09-04 17:47:10
阅读次数:
197
本周作业内容:1、显示当前系统上root、fedora或user1用户的默认shell;答:[root@localhost~]#cat/etc/passwd|egrep‘^(root|fedora|user1)‘
root:x:0:0:root:/root:/bin/bash
[root@localhost~]#2、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小括号的行,形如:he..
分类:
其他好文 时间:
2016-09-04 17:46:47
阅读次数:
210