shell命令使用技巧
2012-07-13 00:00
337 查看
获取本机ip的一个正则表达式
ipconfig |grep 'inet addr' | grep 'Bcast' |sed s/.*addr://g |sed s/Bcast.*$//g
分析:
1、ipconfig | grep ‘inet addr’| grep 'Bcast'
将ip地址所在行过滤出来
2、ipconfig |grep 'inet addr' | grep 'Bcast' |sed s/.*addr://g
将 ip地址前的信息用空代替 (sed s/word1/word2/g 用word2替换word1,".*"表示任意字符串)
3、自己分析最后一步
获取进程的pid
ps aux | grep 'process' | grep -v 'grep' |awk '{print $2}'
ipconfig |grep 'inet addr' | grep 'Bcast' |sed s/.*addr://g |sed s/Bcast.*$//g
分析:
1、ipconfig | grep ‘inet addr’| grep 'Bcast'
将ip地址所在行过滤出来
2、ipconfig |grep 'inet addr' | grep 'Bcast' |sed s/.*addr://g
将 ip地址前的信息用空代替 (sed s/word1/word2/g 用word2替换word1,".*"表示任意字符串)
3、自己分析最后一步
获取进程的pid
ps aux | grep 'process' | grep -v 'grep' |awk '{print $2}'
相关文章推荐
- 最牛B 的 Linux Shell 命令, SHell使用技巧
- Linux 学习笔记_3_Linux常用命令_8_Shell使用技巧
- 常用的shell命令和使用技巧
- shell脚本中read命令的使用技巧
- [Linux学习笔记] Linux常用命令 - 番外篇(Shell使用技巧)
- Shell基础学习:关于Wget命令的使用技巧[zt]
- Linux使用技巧:linux下将命令值赋给shell变量
- shell命令使用技巧
- Shell关于Wget命令的使用技巧
- Linux使用技巧:linux下将命令值赋给shell变量
- Linux中rsh远程shell命令的使用技巧解析
- 【ipython技巧】使用shell命令
- Shell关于Wget命令的使用技巧
- Magento使用php shell 命令更新索引(index)
- \t\t常用网络命令使用技巧
- erlang shell 命令中文使用说明
- 使用python subprocess模块实现调用shell执行命令
- 终端中经常使用的shell 命令
- Shell下不能使用Tab补全命令的原因
- Magento使用php shell 命令更新索引(index)