Vim 中截取部分内容保存到其他文件。
按 Escape进入命令模式,然后输入 :start,endw file,其中的 start 是当前文件中要保存的第一行,end 是要保存的最后一行,w 表示希望写到另一个文件中(或者覆盖现有的文件),file 是指定的部分要保存到的文件。对于最后一行,可以使用 $ 表示文件的末尾。可以在 w 后面使用两个大于号(>>)表示希望把内容附加到文件中而不是覆盖文件。
一条很酷的 vim 技巧
二月 16th, 2011 xiao H Posted in shell 1 Comment »
最受欢迎的10个 Linux 单行命令
二月 16th, 2011 xiao H Posted in shell No Comments »
下面是来自 Commandlinefu 网站由用户投票决出的 10 个最酷的 Linux 单行命令。
sudo !!
以 root 帐户执行上一条命令。
python -m SimpleHTTPServer
利用 Python 搭建一个简单的 Web 服务器,可通过 http://$HOSTNAME:8000 访问。
标签:Bash
History 命令经典用法15例
二月 16th, 2011 xiao H Posted in shell, 精品文档, 系统管理 No Comments »
如果你经常使用 Linux 命令行,那么使用 history(历史)命令可以有效地提升你的效率。本文将通过实例的方式向你介绍 history 命令的 15 个用法。
使用 HISTTIMEFORMAT 显示时间戳
当你从命令行执行 history 命令后,通常只会显示已执行命令的序号和命令本身。如果你想要查看命令历史的时间戳,那么可以执行:
# export HISTTIMEFORMAT='%F %T ' # history | more 1 2008-08-05 19:02:39 service network restart 2 2008-08-05 19:02:39 exit 3 2008-08-05 19:02:39 id 4 2008-08-05 19:02:39 cat /etc/redhat-release
正则表达式的操作符说明
一月 28th, 2011 xiao H Posted in shell No Comments »
. 匹配任何单个字符。 ? 之前的项目是可选的,匹配最多一次。 * 匹配出现零次或者多次的先前项目。 + 匹配一次或者多次先前项目。 {N} 精确匹配N次先前的项目。 {N,} 先前的项目匹配N或者更多次。 {N,M} 先前的项目匹配至少N次,但是不多于M次。 - 表示范围如果不是列表中最先或者最后或者一个范围的结束点。 ^ 匹配行开始的空字符串;也表示不在列表范围内的字符。 $ 匹配行末的空字符串。 \b 匹配词两边的空字符串。 \B 匹配提供的空字符串 \< 匹配任何词开头的空字符串。 \> 匹配任何词结尾的空字符串
标签:正则表达式
Bash Shell 快捷键
六月 6th, 2010 xiao H 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 - Delete from under the cursor Ctrl + e - Jump to the end of the line Ctrl + f - Move forward a char Ctrl + k - Delete to EOL Ctrl + l - Clear the screen //清屏,类似 clear 命令 Ctrl + r - Search the history backwards //查找历史命令 Ctrl + R - Search the history backwards with multi occurrence Ctrl + u - Delete backward from cursor // 密码输入错误的时候比较有用 Ctrl + xx - Move between EOL and current cursor position Ctrl + x @ - Show possible hostname completions Ctrl + z - Suspend/ Stop the command
ffmpeg 批量转换脚本
四月 2nd, 2010 xiao H Posted in shell 1 Comment »
我的 Conky 配置文件
五月 12th, 2009 xiao H Posted in shell, 日常桌面 15 Comments »
Iptables+tc 网吧每IP 限速脚本
五月 9th, 2009 xiao H Posted in shell 5 Comments »
dell 的 Remove Operating System 代码
一月 1st, 2009 xiao H Posted in shell 1 Comment »


