Scripting

Replacing it with IT
=========================
s—substitute command

sed ‘s/it/IT/’ /root/test
Please chek if you can do IT

Replacing /usr/local/bin /common/bin
=========================
sed ‘s/\/usr\/local\/bin/\/common\/bin/’  /root/secondone
/common/bin
sed ‘s:/usr/local/bin:/common/bin:’ /root/secondone
/common/bin
# sed ‘s_/usr/local/bin_/common/bin_’ /root/secondone
/common/bin
# sed ‘s|/usr/local/bin|/common/bin|’ /root/secondone
/common/bin

Deleting line conatining Good from file

d–delet
sed ‘/Good /d ‘ /root/thirdone
Have a great day

-exec rm {} remove

#!/bin/bash
find /root/mydir/test/ -type f > /files.txt
for i in `cat /files.txt`; do
chmod 777 $i;
done

http://www.grymoire.com/Unix/Sed.html
http://drupal.org/getting-started/6/install/set-permissions

http://www.freeos.com/guides/lsst/ch02sec02.html

  1. Leave a comment

Leave a comment