Unix.Shell编程(第三版)

星期五, 七月 17th, 2009 Posted in 系统管理 | 3 Comments »

Read more..

用shc 加密shell

星期四, 四月 9th, 2009 Posted in 日常桌面 | No Comments »

Shell 在Linux 系统中的强大有目共睹,每个管理员都是自己写的一组shell 来简化自己的工作,有时我们会把自己写的shell 让别人用,但这时有一个麻烦的地方,就是shell 里包含一些敏感信息如帐号密码等,这时我们需要一个工具--shc 把我们的shell 加密。 shc是一个脚本编译工具, 使用RC4加密算法, 它能够把shell程序转换成二进制可执行文件(支持静态链接和动态链接)。 shc主页: http://www.datsi.fi.upm.es/%7Efrosal/ Read more..

用 !$ 防止误操作

星期六, 十一月 1st, 2008 Posted in shell | 1 Comment »

作者:galeki 原文地址:http://www.linuxgem.org/posts/5769.html shell 的通配符匹配非常强大,不过也非常危险,不少同学都碰到这样的问题,比如 rm a*,结果一个手抖,a 和星号之间多了个空格,结果目录下的文件都灰飞烟灭了…… bash 支持一个特殊的变量 !$,永远保存着前一条命令的最后一个参数,例如: $ echo hello world hello world $ echo !$ world Read more..

一些奇怪的unix指令名字的由来

星期二, 八月 26th, 2008 Posted in 日常桌面 | 2 Comments »

awk = "Aho Weinberger and Kernighan" 这个语言以作者 Al Aho, Peter Weinberger 和 Brian Kernighan 的 姓来命名。 grep = "Global Regular Expression Print" grep 源自 ed。用来打印所有符合某 pattern 的指令 g/re/p Read more..

几个有用的bash shell组合

星期五, 三月 7th, 2008 Posted in shell | No Comments »

ps aux | awk '{ if ($3 > 8 ) print $2}' 这个是列出cpu 占有率高于 8% 的进程的PID cat /proc/net/arp | awk '{print $4 $1}' >>/etc/ethers 读取当前机器arp 表并把得到的mac 地址和相应的ip 地址添加到/etc/ethers 文件中去 Read more..