我想删除多行文本的前一点

我想删除多行文本的前一点

我想删除起点,如下所示。

文件名 aaa.txt。

./usr/share/vim/vim73/colors/blue.vim
./usr/share/vim/vim73/colors/default.vim
./usr/share/vim/vim73/colors/peachpuff.vim
./usr/share/vim/vim73/colors/shine.vim
./usr/share/vim/vim73/colors/slate.vim
./usr/share/vim/vim73/colors/desert.vim
./usr/share/vim/vim73/colors/README.txt
./usr/share/vim/vim73/colors/torte.vim

/usr/share/vim/vim73/colors/blue.vim
/usr/share/vim/vim73/colors/default.vim
/usr/share/vim/vim73/colors/peachpuff.vim
/usr/share/vim/vim73/colors/shine.vim
/usr/share/vim/vim73/colors/slate.vim
/usr/share/vim/vim73/colors/desert.vim
/usr/share/vim/vim73/colors/README.txt
/usr/share/vim/vim73/colors/torte.vim

我应该怎么办?

答案1

与 sed

sed -e 's,^\./,/,' <inputfile >outputfile

(如果后面有“/”,这只会删除“.”,以防提供不正确的数据)。

相关内容