随笔分类 - sed-grep
摘要:linux中grep命令的用法 作为linux中最为常用的三大文本(awk,sed,grep)处理工具之一,掌握好其用法是很有必要的。 首先谈一下grep命令的常用格式为:grep [选项] ”模式“ [文件] grep家族总共有三个:grep,egrep,fgrep。 常用选项: 1.命令格式:
阅读全文
摘要:Introduction (介绍) 'grep'用于搜索给定文件中能匹配给定pattern列表的行。当某行能匹配上,(默认)将拷贝该行到标准输出,或者根据你所指定的选项生成其它序列的输出。 尽管'grep'所期望的是在文本行中做匹配,但即使某输入行的大小长度超出了可用内存空间也不会受到限制,它仍可以
阅读全文
摘要:sed -i '$a IPADDR=192.168.1.199' /etc/sysconfig/ifcfg-eth0work-scripts/ifcfg-eth0 #追加ip地址。 sed -i '$aNETMASK=255.255.255.0' /etc/sysconfig/ifcfg-eth0w
阅读全文
摘要:[root@node2 ~]# cp /etc/passwd /server/scprits/ [root@node2 ~]# cd /server/scprits/ [root@node2 scprits]# ls -l passwd -rw-r--r--. 1 root root 1065 12
阅读全文
摘要:[root@node2 scprits]# cat > data << eof > This is the header line > This is the first data line > This is the secong data line > This is the last line
阅读全文