Bo's Oracle Station

查看: 1571|回复: 0

课程第25次

[复制链接]

75

主题

115

帖子

2724

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2724
发表于 2019-6-6 20:11:42 | 显示全部楼层 |阅读模式
替换文本:
  1. [root@station60 ~]# perl -i -pe 's,cat,dog,g'  1.txt
  2. [root@station60 ~]# cat 1.txt
  3. dog
  4. dog dog
  5. dog
  6. [root@station60 ~]# sed -i.bak 's/dog/fish/g' 1.txt
  7. [root@station60 ~]# ls
  8. 1.txt            Desktop    initial-setup-ks.cfg  Public     Videos
  9. 1.txt.bak        Documents  Music                 README
  10. anaconda-ks.cfg  Downloads  Pictures              Templates
  11. [root@station60 ~]# cat 1.txt.bak
  12. dog
  13. dog dog
  14. dog
  15. [root@station60 ~]# cat 1.txt
  16. fish
  17. fish fish
  18. fish
复制代码
  1. [root@station60 ~]# sed -i.bak '1,2s/fish/cow/g' 1.txt
  2. [root@station60 ~]# vim 1.txt
  3. [root@station60 ~]# cat 1.txt
  4. cow
  5. cow cow
  6. fish
复制代码
  1. cow
  2. lion lion
  3. fish
  4. ~
  5. ~
  6. ~
  7. ~
  8. ~
  9. ~
  10. ~
  11. ~
  12. ~
  13. ~
  14. ~
  15. ~
  16. ~
  17. ~
  18. ~
  19. ~
  20. ~
  21. ~
  22. ~
  23. ~
  24. :2,2s#sheep#lion#g     
复制代码
  1. # /etc/anacrontab: configuration file for anacron

  2. # See anacron(8) and anacrontab(5) for details.

  3. SHELL=/bin/sh
  4. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  5. MAILTO=root
  6. # the maximal random delay added to the base delay of the jobs
  7. RANDOM_DELAY=45
  8. # the jobs will be started during the following hours only
  9. START_HOURS_RANGE=3-22

  10. #period in days   delay in minutes   job-identifier   command
  11. 1       5       cron.daily              nice run-parts /etc/cron.daily
  12. 7       25      cron.weekly             nice run-parts /etc/cron.weekly
  13. @monthly 45     cron.monthly            nice run-parts /etc/cron.monthly
  14. 0       3       mycmd                   echo $(date) >>  /root/anacron.txt
  15. ~
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-8 03:56 , Processed in 0.045898 second(s), 24 queries .

快速回复 返回顶部 返回列表