码迷,mamicode.com
首页 >  
搜索关键字:awk 文本处理工具    ( 4925个结果
ubuntu上完全卸载package
inux上完整的卸载apt方式安装软件的办法。假设你的包叫做: your_pkgapt-get --purge remove your_pkgapt-get autoremoveapt-get cleandpkg -l |grep your_pkg|awk '{print $2}' |xargs d...
分类:系统相关   时间:2014-10-15 17:43:41    阅读次数:214
修改ubuntu各个版本源
请使用root执行改脚本 #!/bin/bash APT_DIR="/etc/apt" VERSION=`awk‘{print$2}‘/etc/issue` case$VERSIONin 14.04|14.04.1)RELEASE="trusty";; 13.04|13.04.1)RELEASE="raring";; 13.10)RELEASE="saucy";; 12.04|12.04.1|12.04.2|12.04.3|12.04.4|12.04.5)RELEASE="precise";..
分类:系统相关   时间:2014-10-15 05:31:10    阅读次数:222
Shell运算符:Shell算数运算符、关系运算符、布尔运算符、字符串运算符等
Bash 支持很多运算符,包括算数运算符、关系运算符、布尔运算符、字符串运算符和文件测试运算符。原生bash不支持简单的数学运算,但是可以通过其他命令来实现,例如 awk 和 expr,expr 最常用。原生的bash到底支持不支持数学计算我不清楚了,不过也这样做到一样的效果:#!/bin/bash...
分类:系统相关   时间:2014-10-15 03:08:29    阅读次数:341
linux操作
awk1、打印文件的第一列(域) : awk '{print $1}' filename2、打印文件的前两列(域) : awk '{print $1,$2}' filename3、打印完第一列,然后打印第二列 : awk '{print $1 $2}' filename4、打印文本文件的总行数...
分类:系统相关   时间:2014-10-14 20:19:59    阅读次数:201
系统初始化脚本
####closeserviceTimeServerMaster="192.168.6.13"SSHPort="58522"echored(){echo-ne"\033[31m"$1"\033[0m\n"}echogreen(){echo-ne"\033[32m"$1"\033[0m\n"}IPN=`ifconfig|grep192.168|awk‘{print$2}‘|cut-d:-f2|awk-F.‘{print$3"-"$4}‘`HOSTNAME="HK$IPN"hostname$HOSTNAMEsed..
分类:其他好文   时间:2014-10-13 02:47:49    阅读次数:404
PHP脚本监控程序
#!/bin/sh # Find ip IP=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{ print substr($2, index($2, ":")+1)}'` #monitor procname scriptname monitor() { procname=$1 scriptname=$2 # Find proc by p...
分类:Web程序   时间:2014-10-12 10:46:07    阅读次数:267
进程监控脚本
#!/bin/sh my_ip=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{print substr($2, index($2, ":")+1)}'` recv="" msg="not_existing, restart ..." MONITOR_LOG="monitor.log" #monitor procname scriptname...
分类:系统相关   时间:2014-10-11 23:25:07    阅读次数:329
(linux) 常用命令 干货
内容提要1. 第一难度, 重要 梯队 (grep, awk, sed, find, )2. 第二常用, 重要 梯队 (ps, ls, date, fuser, netstat, kill)3. 第三 特殊用途 梯队 (压缩打包, 背景运行, 工作例程, 性能监控, 安装包)4. 正则表达式一. 难度...
分类:系统相关   时间:2014-10-11 17:22:45    阅读次数:226
Linux Unix shell 编程指南学习笔记(第二部分)
第七章  正则表达式介绍...
分类:系统相关   时间:2014-10-10 23:58:26    阅读次数:386
找出系统中所有以user0开头并且是可以登录和没有密码的用户,并生成文本文件保存。
为了实验,创建5个用户user01user02user03user04user05,其中user02的shell是/sbin/nologin,并且没有密码,user03没有密码,user05的shell是/sbin/nologingrepuser0/etc/passwd|awk-F\:‘{print$1,$7}‘>>boss1.txtgrepuser0/etc/shadow|awk-F\:‘{print$2}‘>>boss2...
分类:其他好文   时间:2014-10-10 15:37:14    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!