Bash
jyoxun
这个作者很懒,什么都没留下…
展开
-
sed使用手册
删除:d命令 $ sed '2d' example-----删除example文件的第二行。 $ sed '2,$d' example-----删除example文件的第二行到末尾所有行。 $ sed '$d' example-----删除example文件的最后一行。 $ sed '/test/'d ...原创 2009-11-17 14:27:05 · 85 阅读 · 0 评论 -
shell获取当前用户名或者ID
[user@localhost fix_bug_srpm]$ echo "$USER"user[user@localhost fix_bug_srpm]$ echo `id -u`503[user@localhost fix_bug_srpm]$ echo `whoami`user[user@localhost fix_b...2009-11-17 14:32:53 · 590 阅读 · 0 评论 -
awk根据父进程的PID获得所有子进程PID
知道某具体进程的PID,和程序名(比如 bash,PID 2971),需要将他的子进程都打印出来。 假如所有的bash相关进程如下:[user@localhost ~]$ ps -ef|grep bashuser 2986 2971 0 21:42 pts/0 00:00:00 bashuser 3368 2971 0 21:59 pts/1 ...2009-12-24 23:36:32 · 1018 阅读 · 0 评论 -
shell 颜色打印输出
先前文章中提到在QT中如何使用QDEBUG进行颜色打印输出:http://socol.iteye.com/admin/blogs/985092 对于直接使用shell脚本输出,可使用下面的脚本,打印出参考数值表: #!/bin/bashT='gYw' # The test textechoecho " default 40m 41m ...原创 2011-05-17 15:14:10 · 172 阅读 · 0 评论 -
计算cp命令的时间和速度
引用自:http://www.linuxsir.org/bbs/thread49972-2.html #!/bin/sh# Last modified: 2003年07月05日 星期六 00时09分44秒 [test]SOURCE=$1TARGET=$2#CP=./fack_cpCP=cp$CP "$SOURCE" "$TARGET" &...原创 2011-05-17 15:22:42 · 3684 阅读 · 0 评论 -
怎样让脚本脱离终端运行
nohup ./aa.sh &原创 2011-05-22 18:24:38 · 338 阅读 · 0 评论 -
shell 比较判断
引用自:http://www.tsnc.edu.cn/default/tsnc_wgrj/doc/abs-3.9.1_cn/html/comparison-ops.html #! /bin/shvar1=20var2=21if [ $var1 -ne $var2 ];then echo "1. -ne means NOT equal true"fix...原创 2011-05-26 09:49:57 · 102 阅读 · 0 评论 -
用find和rm命令来批量删除文件
引用自:http://hi.baidu.com/earthmzhboy/blog/item/b34da18d6110cff9f01f3695.html sudo find / -name '*fcitx*' | xargs sudo rm -rf###############################################好吧,原来是尝试自己编译安装fcitx4...原创 2011-10-10 23:40:43 · 1297 阅读 · 0 评论