|
替换文本:
- [root@station60 ~]# perl -i -pe 's,cat,dog,g' 1.txt
- [root@station60 ~]# cat 1.txt
- dog
- dog dog
- dog
- [root@station60 ~]# sed -i.bak 's/dog/fish/g' 1.txt
- [root@station60 ~]# ls
- 1.txt Desktop initial-setup-ks.cfg Public Videos
- 1.txt.bak Documents Music README
- anaconda-ks.cfg Downloads Pictures Templates
- [root@station60 ~]# cat 1.txt.bak
- dog
- dog dog
- dog
- [root@station60 ~]# cat 1.txt
- fish
- fish fish
- fish
复制代码- [root@station60 ~]# sed -i.bak '1,2s/fish/cow/g' 1.txt
- [root@station60 ~]# vim 1.txt
- [root@station60 ~]# cat 1.txt
- cow
- cow cow
- fish
复制代码- cow
- lion lion
- fish
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- :2,2s#sheep#lion#g
复制代码- # /etc/anacrontab: configuration file for anacron
- # See anacron(8) and anacrontab(5) for details.
- SHELL=/bin/sh
- PATH=/sbin:/bin:/usr/sbin:/usr/bin
- MAILTO=root
- # the maximal random delay added to the base delay of the jobs
- RANDOM_DELAY=45
- # the jobs will be started during the following hours only
- START_HOURS_RANGE=3-22
- #period in days delay in minutes job-identifier command
- 1 5 cron.daily nice run-parts /etc/cron.daily
- 7 25 cron.weekly nice run-parts /etc/cron.weekly
- @monthly 45 cron.monthly nice run-parts /etc/cron.monthly
- 0 3 mycmd echo $(date) >> /root/anacron.txt
- ~
复制代码
|
|