Skip to content
Advertisement

Replace string pattern with a string in linux file [closed]

I am a newbie to Linux. Need to replace

/en/family/bitstream/ambiance-bt
/en/family/zxcvbn/bernhard-fashion
/en/family/qwerty/century-751
/en/family/abcd/century-expanded
/en/family/xyz/charter-bt
/en/fonts/sdfsd/dsfsdfs

With

/en/family
/en/family
/en/family
/en/family
/en/family
/en/fonts/sdfsd/dsfsdfs

using sed or some alternative.

Advertisement

Answer

Command that given desired result to me is:

sed  's//en/family/.*.*/FamilyPage/' filename
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement