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
请使用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
Bash 支持很多运算符,包括算数运算符、关系运算符、布尔运算符、字符串运算符和文件测试运算符。原生bash不支持简单的数学运算,但是可以通过其他命令来实现,例如 awk 和 expr,expr 最常用。原生的bash到底支持不支持数学计算我不清楚了,不过也这样做到一样的效果:#!/bin/bash...
分类:
系统相关 时间:
2014-10-15 03:08:29
阅读次数:
341
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
#!/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
内容提要1. 第一难度, 重要 梯队 (grep, awk, sed, find, )2. 第二常用, 重要 梯队 (ps, ls, date, fuser, netstat, kill)3. 第三 特殊用途 梯队 (压缩打包, 背景运行, 工作例程, 性能监控, 安装包)4. 正则表达式一. 难度...
分类:
系统相关 时间:
2014-10-11 17:22:45
阅读次数:
226
为了实验,创建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