<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[【转】非常有用之 Unix/Linux 单行脚本]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 21 Apr 2009 06:03:10 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	删除 core 文件<br/># find ~ -name core -exec file &#123;&#125; &#92;; -exec rm -i &#123;&#125; &#92;;<br/>查看使用文件的进程<br/># fuser -u /usr/my_application/foo<br/>搜索字符串<br/>#grep "hello world" `find ./ -name "*" -print -exec file &#123;&#125; &#92;; &#124;grep text &#124; cut -d ':' -f 1`<br/>目录<br/>#alias dir='ls -Lla&#124;grep ^d'<br/><br/>输出 IP 地址<br/>#ifconfig &#124; grep "inet addr" &#124; grep -v "127.0.0.1" &#124; awk '&#123;print $2;&#125;' &#124; awk -F':' '&#123;print $2;&#125;'<br/>按文件长度排序<br/>#ls -l &#124; grep ^- &#124; sort -nr -k 5 &#124; more<br/>#ls -lR &#124; grep ^- &#124; sort -nr -k 5 &#124; more<br/><br/>二进制文件中的可打印字符<br/># strings name of binary file<br/>一个月的最后一个星期天执行任务：<br/>18 * * * 0 [`date "+%d"` -gt 24] && /path/to/script<br/><br/>修改扩展名：<br/># for f in *.abc; do mv $f `basename $f .abc`.def ; done<br/><br/>查看硬盘情况：(Solaris)<br/># iostat -En<br/><br/>整个目录树拷贝：<br/># cd<br/># find . -depth -print &#124; cpio -pudm<br/><br/>按长度排序目录下所有文件<br/># du -a &#124; sort -n -r &#124; more<br/><br/>检查文件内每行是否有相同列数<br/>#awk '&#123;print NF&#125;' test.txt &#124;sort -nu&#124;more<br/><br/>去除空行<br/>#sed -e '/^[ ]*$/d' InputFile >OutputFile<br/><br/>查看进程占用的对应文件 inode 号(Solaris)<br/>#/usr/proc/bin/pfiles<br/><br/>删除指定用户的所有进程<br/># kill -9 `ps -fu username &#124;awk '&#123; print $2 &#125;'&#124;grep -v PID`<br/><br/><br/><br/>Bash 操作快捷键：<br/>ctrl-l -- clear screen<br/>ctrl-r -- does a search in the previously given commands so that you don't<br/>have to repeat long command.<br/>ctrl-u -- clears the typing before the hotkey.<br/>ctrl-a -- takes you to the begining of the command you are currently typing.<br/>ctrl-e -- takes you to the end of the command you are currently typing in.<br/>esc-b -- takes you back by one word while typing a command.<br/>ctrl-c -- kills the current command or process.<br/>ctrl-d -- kills the shell.<br/>ctrl-h -- deletes one letter at a time from the command you are typing in.<br/>ctrl-z -- puts the currently running process in background, the process<br/>can be brought back to run state by using fg command.<br/>esc-p -- like ctrl-r lets you search through the previously given commands.<br/>esc-. -- gives the last command you typed.<br/><br/>文件名里的空格替换为下划线<br/># for i in $1 ; do mv "$i" `echo $i &#124; sed 's/ /_/g'` ; done<br/><br/>查看远程主机时间<br/># telnet remotehostname 13&#124;grep :<br/><br/>只显示 top 命令的states 行<br/>#while true; do top -d 2 &#124; col -b &#124; grep states; sleep 10; done<br/><br/>加速显示　tar 文件内容<br/># tar tvfn<br/><br/>让 目录名也能　Spell Check<br/>#shopt -s cdspell<br/>当输错命令时，系统会自动进入类似的目录<br/><br/>查看　Sun 服务器型号<br/># /usr/platform/`uname -m`/sbin/prtdiag -v &#124; grep `uname -m`<br/><br/>在vi 中一行文字前后添加字符<br/>:/^&#92;(.*&#92;)/s//我要 &#92;1 添加/<br/><br/>查找某包含字符串(Verita)软件包的详细信息 (Solaris)<br/>pkginfo -l `pkginfo &#124; grep -i VERITAS &#124; awk '&#123;print $2&#125;'`<br/><br/>Sun 的一大堆脚本<br/>http://www.sun.com/bigadmin/scripts/index.html
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 【转】非常有用之 Unix/Linux 单行脚本]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>