sed在文件中某一行最后添加一个数字

sed 's/\(^a.*\)/\1 12/' test

#cat  test
askdj
aslkd aslkdjf3e
skdjfsdfj
sdkfjk
fsdkfjksdjfkjsdf
12sdfesdf
aslkdjfkasdjf asdlfkjaskdfj

#sed 's/\(^a.*\)/\1 12/' test

askdj 12
aslkd aslkdjf3e  12
skdjfsdfj
sdkfjk
fsdkfjksdjfkjsdf
12sdfesdf
aslkdjfkasdjf asdlfkjaskdfj  12

添加新评论 »