I have a file like this:
aaa.bbb.1.ccc
xxx.bbb.21
mmm.ppp
xxx.eee
mmm.qqqq
xxx.hhh.12.ddd
I want to move all the lines starting with xxx.
at the top of the file with a simple command (using sed
, awk
, grep
...).
So my new file will look like this:
xxx.bbb.21
xxx.eee
xxx.hhh.12.ddd
aaa.bbb.1.ccc
mmm.ppp
mmm.qqqq
How to do this?