Bash Shell 快捷键

星期天, 六月 6th, 2010 Posted in shell | 4 Comments »

CTRL 键 Ctrl + a - Jump to the start of the line Ctrl + b - Move back a char Ctrl + c - Terminate the command //用的最多了吧? Ctrl + d - ... Read more..

dell 的 Remove Operating System 代码

星期四, 一月 1st, 2009 Posted in shell | 1 Comment »

在公社看到 WeiMingzhi 贴的Dell 预装SLED10机子上提供的删除OS 脚本,觉得蛮好特留一个备份。 title Remove Operating System root (hd0,2) kernel /vmlinuz root=/dev/disk/by-label/root ro init=/sbin/remove-os.sh resume=/dev/sda5 splash=silent showopts initrd /initrd Read more..

我常用的小shell

星期五, 七月 4th, 2008 Posted in shell, 系统管理 | No Comments »

下面是我平常用的一些bash shell 组合,方便我的日常管理。 清除所有arp 缓存 arp -n|awk '/^[1-9]/ {print "arp -d "$1}'|sh 显示打开连接数前10个机子的IP 和连接数 cat /proc/net/ip_conntrack | cut -d ' ' -f 10 | cut -d '=' -f 2 | sort | uniq -c ... 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..

Bash的输入输出重定向

星期一, 三月 3rd, 2008 Posted in shell | No Comments »

使用Bash可以方便的用<和>实现输出输入的重定向,本文讨论重定向的一些细节和技巧。本文介绍部分是对Bash Quick Reference相关内容的翻译。 基础知识 文件描述符(File Descriptor),用一个数字(通常为0-9 Read more..