10 2012 档案

摘要:1. bash命令行中的变量赋值语句只适用于该命令This example comes from A practical guide to Fedora and Red Hat Enterprise Linux (6th ed.).$ cat my_scriptecho $TEMPDIR$ TEMPDIR=/home/sam/temp ./my_script/home/sam/temp$ echo $TEMPDIR$2. bash在将变量作为参数传给其他程序时会自动压缩相邻的空格如果想保留多个相邻的空格,则应该使用双引号将变量引起。This example comes from Sobell 阅读全文
posted @ 2012-10-27 10:49 UniMouS 阅读(280) 评论(0) 推荐(0) 编辑
摘要:$ dhclient -r$ dhclient 阅读全文
posted @ 2012-10-24 10:25 UniMouS 阅读(275) 评论(0) 推荐(0) 编辑
摘要:How to update locate database?There is the solution:$ sudo updatedb 阅读全文
posted @ 2012-10-20 10:22 UniMouS 阅读(337) 评论(0) 推荐(0) 编辑
摘要:How to grep a string that do no cantain another substring?There is the solution:$ ls | grep -ivE 'unimous'Here is a practical example of using it. If you want to find all the files with names containing 'wireshark' and without 'unimous', and then delete all of them:$ sudo upd 阅读全文
posted @ 2012-10-20 10:20 UniMouS 阅读(318) 评论(0) 推荐(0) 编辑
摘要:How to pipe some file names to rm, here is the solution:$ ls | xargs rm 阅读全文
posted @ 2012-10-20 10:18 UniMouS 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Vim有四个与编码相关的选项:encoding,termencoding,fileencoding,fileencodings,具体参见Reference 1。为防止乱码,可在~/.vimrc脚本中添加如下几行set encoding=utf-8set termencoding=utf-8set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1Referencehttp://edyfox.codecarver.org/html/vim_fileencodings_detection.html。 阅读全文
posted @ 2012-10-19 13:26 UniMouS 阅读(269) 评论(0) 推荐(0) 编辑
摘要:Single QuoteUse single quote when you want to literally print everything inside the single quote. Even the special variables such as $HOSTNAME will be print as $HOSTNAME instead of printing the name of the Linux host.$ echo 'Hostname=$HOSTNAME ; Current User=`whoami` ; Message=\$ is USD'Host 阅读全文
posted @ 2012-10-16 11:36 UniMouS 阅读(929) 评论(0) 推荐(0) 编辑
摘要:Print Screen: Take a screenshot.Ctrl+Print Screen: Take a screenshot (Without saving dialog).Alt+Print Screen: Take a screenshot of a window.Shift+Print Screen: Take a screenshot of an area of the screen. The pointer changes to a crosshair. Click and drag to select an area. 阅读全文
posted @ 2012-10-04 20:24 UniMouS 阅读(330) 评论(0) 推荐(0) 编辑

版权所有 © 2011-2012 方一曙

Copyright © 2011-2012 Fang Yishu (UniMouS)