sed

* 文件: file1 内容

china-2006
america-2005
将文件内容更改为

2006-china
2005-america
sed :

sed 's/\(.*\)_\([0-9]\{4\}\)/\2-\1/g' file1



你可能感兴趣的:(sed)