Assume that I have a file named "letters" in my dictionary contains multiple letters, each line per one letter such as:
Assume that I have a file named "letters" in my dictionary contains multiple letters, each line per one letter such as: a b c d e etc In the second files named "words", I have this line: we want to replace by these possible letter which in the letters file with sed instruction such as can be , OR OR ..... How can we do it? So basically I want to replace a content of 1 file by the contents of another file Solution: We can use this command [ sed -i ' s/old-text/new-text/g ' filename ] sed -i 's/Letters/WORDS/g ' filename even we can use cp file1 file2 and also cat file1 >> file2