Category: Linux

  • Remove Text from Multiple Files

    Remove Text from Multiple Files

      Shell script to remove some text from multiple files Here is a small script that reads all *.txt  or all *.html, all *.php  files and delete all lines between word1 and word2: #!/bin/bash FILES=”*.php” for f in $FILES do INF=”$f” OUTF=”$f.out.tmp” # replace sed ‘/word1/,/word2>/d’ $INF > $OUTF /bin/cp $OUTF $INF /bin/rm -f $OUTF…

  • My root crontab not running

    My root crontab not running

    Very often the reason that crontab for root user is not working is a problem in the editor, which is being used on Linux.. This problem is that after the editor changes the root file in the directory var/spool/cron/ it will add a control character ” ^M ”  which cron will try to execute as a component…