0
点赞
收藏
分享

微信扫一扫

diff 解读

金刚豆 2022-02-11 阅读 70
linux


# cat question1A
Apple                                                                                                                                                                                        
Boy                                                                                                                                                                                          
Cat                                                                                                                                                                                          
Dog                                                                                                                                                                                          
Egg                                                                                                                                                                                          
# cat question1B                                                                                                                                                     
Boy                                                                                                                                                                                          
Cat                                                                                                                                                                                          
Egg


Delete the lines in range 1 from the file question1A; line 0 is where they would have appeared in the question1B had they not been deleted
Delete the lines in range 4 from the file question1A; if changing question1B into question1A, append line 4 of question1A after line 2 of question1B.

# diff question1A question1B                                                                                                                                         
1d0                                                                                                                                                                                          
< Apple                                                                                                                                                                                      
4d2                                                                                                                                                                                          
< Dog 

Add the lines in range 1 of the question1A after line 0 of question1B.
Add the lines in range 4 of the question1A after line 2 of question1B.
# diff question1B question1A                                                                                                                                         
0a1                                                                                                                                                                                          
> Apple                                                                                                                                                                                      
2a4
> Dog
举报

相关推荐

0 条评论