linuxÔõô½ÏÁ¿Á½¸öÎı¾Îļþ
linux½ÏÁ¿Á½¸öÎı¾ÎļþµÄÒªÁ죺1¡¢diffÏÂÁ¡°diff file1.txt file2.txt¡±£¬¿ÉÒÔ°´ÐнÏÁ¿Á½¸öÎļþ£»2¡¢vimdiffÏÂÁ¡°vimdiff file1.txt file2.txt¡±£¬¿ÉÒÔÒÔ·ÖÆÁµÄ·½·¨ÏÔʾÁ½¸öÎļþ£»3¡¢cmpÏÂÁ¡°cmp file1.txt file2.txt¡±Öð×ֽڵؽÏÁ¿Á½¸öÎļþ£»4¡¢commÏÂÁµÈµÈ¡£
±¾ÎĵIJÙ×÷ÇéÐΣºlinux6.4.3ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚLinuxÖУ¬¿ÉÒÔʹÓÃÖÖÖÖÒªÁìºÍ¹¤¾ßÀ´½ÏÁ¿Á½¸öÎı¾Îļþ¡£ÏÂÃæÊÇһЩ³£ÓõÄÒªÁ죺
ʹÓÃdiffÏÂÁdiffÏÂÁîÊÇLinuxÖÐ×î³£ÓõĽÏÁ¿Îı¾ÎļþµÄÏÂÁîÖ®Ò»¡£Ëü»á°´ÐнÏÁ¿Á½¸öÎļþ£¬²¢ÏÔʾËüÃÇÖ®¼äµÄ²î±ð¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´½ÏÁ¿Á½¸öÎļþ£º
diff file1.txt file2.txt
µÇ¼ºó¸´ÖÆ
diffÏÂÁî»áÖðÐнÏÁ¿Îļþ£¬ÏÔʾ³ö²î±ðÖ®´¦£¬²¢ÒÔÌØÊâµÄ·ûºÅÌåÏÖ²î±ð¡£ÀýÈ磬Ìí¼ÓµÄÐлáÒÔ”>”·ûºÅ¿ªÍ·£¬É¾³ýµÄÐлáÒÔ”<“·ûºÅ¿ªÍ·¡£
ʹÓÃvimdiffÏÂÁvimdiffÊÇÒ»¸öÔÚVim±à¼Æ÷ÖнÏÁ¿Á½¸öÎļþµÄÏÂÁî¡£Ëü¿ÉÒÔÒÔ·ÖÆÁµÄ·½·¨ÏÔʾÁ½¸öÎļþ£¬²¢Í»³öÏÔʾ²î±ð¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´½ÏÁ¿Á½¸öÎļþ£º
vimdiff file1.txt file2.txt
µÇ¼ºó¸´ÖÆ
vimdiffÏÂÁî»á½«Á½¸öÎļþ»®·ÖÏÔʾÔÚÆÁÄ»µÄ×óÓÒÁ½²à£¬²¢Ê¹Óòî±ðµÄÑÕÉ«±ê¼Ç²î±ðÖ®´¦¡£¿ÉÒÔʹÓÃVimµÄ±à¼ÏÂÁîÀ´ä¯ÀÀºÍÐÞ¸ÄÎļþ¡£
ʹÓÃcmpÏÂÁcmpÏÂÁîÓÃÓÚ°´×Ö½Ú½ÏÁ¿Á½¸öÎļþ¡£Ëü»áÖð×ֽڵؽÏÁ¿Á½¸öÎļþ£¬²¢ÔÚ·¢Ã÷²î±ðÖ®´¦Ê±±¨¸æ²î±ðµÄλÖ᣿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´½ÏÁ¿Á½¸öÎļþ£º
cmp file1.txt file2.txt
µÇ¼ºó¸´ÖÆ
cmpÏÂÁî»áÊä³öÁ½¸öÎļþÖеÚÒ»¸ö²î±ð×Ö½ÚµÄλÖÃÒÔ¼°ÆäASCIIÂëÖµ¡£
ʹÓÃcommÏÂÁcommÏÂÁîÓÃÓÚ½ÏÁ¿Á½¸öÒÑÅÅÐòµÄÎļþ£¬²¢ÏÔʾËüÃÇÖ®¼äµÄ²î±ð¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´½ÏÁ¿Á½¸öÎļþ£º
comm file1.txt file2.txt
µÇ¼ºó¸´ÖÆ
commÏÂÁî»áƾ֤Áеķ½·¨ÏÔʾÁ½¸öÎļþµÄ²î±ð¡£Ã¿Ò»ÁÐÌåÏÖÒ»¸öÎļþÖеÄÒ»ÐУ¬µÚÒ»ÁÐÌåÏÖÖ»±£´æÓÚµÚÒ»¸öÎļþÖеÄÐУ¬µÚ¶þÁÐÌåÏÖÖ»±£´æÓÚµÚ¶þ¸öÎļþÖеÄÐУ¬µÚÈýÁÐÌåÏÖÁ½¸öÎļþÖУ¬¹²ÓеÄÐС£
³ýÁËÉÏÊöÏÂÁîÍ⣬ÉÐÓÐÆäËûһЩ¹¤¾ß¿ÉÒÔÓÃÓÚ½ÏÁ¿Îı¾Îļþ£¬Èçmeld¡¢wdiff¡¢tkdiffµÈ¡£ÕâЩ¹¤¾ßÌṩÁ˸ü¶àµÄ¹¦Ð§ºÍÑ¡Ï¿ÉÒÔƾ֤ÏêϸµÄÐèÇóÑ¡ÔñʹÓá£
ÒÔÉϾÍÊÇlinuxÔõô½ÏÁ¿Á½¸öÎı¾ÎļþµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡