1. First of all, incase of a mistake, how can i list the files that will be changed with sed command. I mean firstly i want to see(list) the files which have the "ISO-8859-1" in their source codes. like find command.
You can simply use
grep to see which files have that text in them.
Alternately, you can replace the
-i switch in the suggested command with
-i.bak to create a backup file. Then use
diff to compare the original and backup file, if wanted, and delete the backup file when you're confident.
2. what if i want to change a long code which already includes "/" charcater in it. Will it be a problem?
The
sed 's' command can use almost any character instead of '/'. This incomplete example will do part of what you want:
sed -i.bak "s,computerhope.com/forum/,test.com/test/," *html
3. if i want to erase whole code can i add a space?
Such as
sed -i "s/ISO-8859-1/ /g" *html
Yes, that will work. You don't even need a space -- just put two slashes together.
Note that it's often helpful to experiment with sed on the command line:
echo "abcde" | sed 's,bcd,,'