- 论坛徽章:
- 0
|
以/etc/crontab这个文件为例
# vi /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
现在要cut红色部分并paste到最后
命令模式下,光标停到第二个root后 按"v"进入visual模式,
通过上下左右键移动光标到第一个root位置 按"x"
最后移动光标到行尾,按"p"
结果为:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
root run-parts /etc/cron.hourly
02 4 * * * root
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/51931/showart_420236.html |
|