Tag: sed
Scripting
Read More
Erstatt alle forekomster av “ord1” med “ord2” i ei fil
# sed -i ‘s/ord1/ord2/g’ filnavn
Scripting
Read More
Using sed to replace text with slashes
This is the right way to replace slashes sed -e ‘s,/usr/bin,/home/bin,g’ Usually you replace text this way sed -e ‘s/text1/text2/g’ You can use any character in place of those slashes.
Scripting
Read More
Rename files with one extension to another
The following command will rename all the files in the folder with the .txt extension to .rtf ls *.txt | sed ‘s/\(.*\)\.txt/ & \1.rtf/’ | xargs -L1 mv