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

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: