System Misc Note - Vol5
System Misc Note - Vol5
sed
想要输出从 0x7fc0开始的若干行,使用sed -n '/7fc0/,$p
1
2
3
4
5
6
7
8
9
10
11
[woc@nixos]> xxd ./roms/Legend\ of\ Zelda,\ The\ -\ A\ Link\ to\ the\ Past\ \(Europe\).sfc | sed -n '/7fc0/,$p' | head -n 10
00007fc0: 5448 4520 4c45 4745 4e44 204f 4620 5a45 THE LEGEND OF ZE
00007fd0: 4c44 4120 2020 020a 0302 0100 468a b975 LDA ......F..u
00007fe0: ffff ffff 2c82 ffff 2c82 c980 0080 d882 ....,...,.......
00007ff0: ffff ffff 2c82 2c82 2c82 2c82 0080 d882 ....,.,.,.,.....
00008000: d803 e802 f802 2803 3803 0004 1004 8803 ......(.8.......
00008010: 9003 2004 2a04 3404 3e04 4804 5204 5c04 .. .*.4.>.H.R.\.
00008020: 6604 7004 7a04 8404 8e04 9804 a204 ac04 f.p.z...........
00008030: b604 c004 ca04 d404 de04 e804 f204 fc04 ................
00008040: 0605 9805 0006 3c06 3c06 3c06 3c06 3c06 ......<.<.<.<.<.
00008050: 4206 4c06 5206 5806 5e06 6406 6a06 8806 B.L.R.X.^.d.j...
其中,用于分割位置,代表从/7fc0/到$(结尾),p表示print. 也就是输出从0x7fc0出现,到结尾的所有行.
This post is licensed under CC BY 4.0 by the author.