{"id":144,"date":"2024-12-18T05:53:07","date_gmt":"2024-12-18T05:53:07","guid":{"rendered":"https:\/\/techkubo.com\/linux\/?p=144"},"modified":"2025-05-28T18:02:33","modified_gmt":"2025-05-28T18:02:33","slug":"linux-diff-command","status":"publish","type":"post","link":"https:\/\/techkubo.com\/linux\/linux-diff-command\/","title":{"rendered":"Linux &#8211; diff Command"},"content":{"rendered":"\n<p>The <code>diff<\/code> command is used to compare files line by line. It outputs the differences between two files, making it easy to identify changes. This command is often used for version control, code review, and file comparison tasks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Example<\/h2>\n\n\n\n<p>Using <code>diff<\/code> to compare two files, <code>file1.txt<\/code> and <code>file2.txt<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff file1.txt file2.txt<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">DIFF Parameters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>--normal<\/code><\/td><td>Display the output in the default format.<\/td><\/tr><tr><td><code>-q, --brief<\/code><\/td><td>Report only if the files differ, without detailed information.<\/td><\/tr><tr><td><code>-s, --report-identical-files<\/code><\/td><td>Indicate when two files are identical.<\/td><\/tr><tr><td><code>-c, -C NUM, --context[=NUM]<\/code><\/td><td>Show NUM lines of context around each change (default is 3).<\/td><\/tr><tr><td><code>-u, -U NUM, --unified[=NUM]<\/code><\/td><td>Display NUM lines of unified context (default is 3).<\/td><\/tr><tr><td><code>-e, --ed<\/code><\/td><td>Produce an <code>ed<\/code> script to recreate changes.<\/td><\/tr><tr><td><code>-n, --rcs<\/code><\/td><td>Output the differences in RCS format.<\/td><\/tr><tr><td><code>-y, --side-by-side<\/code><\/td><td>Display differences in a two-column format.<\/td><\/tr><tr><td><code>-W, --width=NUM<\/code><\/td><td>Set the maximum output width to NUM columns (default is 130).<\/td><\/tr><tr><td><code>--left-column<\/code><\/td><td>Show only the left column for lines common to both files.<\/td><\/tr><tr><td><code>--suppress-common-lines<\/code><\/td><td>Do not show lines that are common between the files.<\/td><\/tr><tr><td><code>-p, --show-c-function<\/code><\/td><td>Display which C function each change occurs in.<\/td><\/tr><tr><td><code>-F, --show-function-line=RE<\/code><\/td><td>Display the most recent line matching the regular expression RE.<\/td><\/tr><tr><td><code>--label LABEL<\/code><\/td><td>Use LABEL instead of the file name and timestamp (can be repeated).<\/td><\/tr><tr><td><code>-t, --expand-tabs<\/code><\/td><td>Expand tabs to spaces in the output.<\/td><\/tr><tr><td><code>-T, --initial-tab<\/code><\/td><td>Align output using a tab before the text.<\/td><\/tr><tr><td><code>--tabsize=NUM<\/code><\/td><td>Set tab stops every NUM columns (default is 8).<\/td><\/tr><tr><td><code>--suppress-blank-empty<\/code><\/td><td>Omit spaces or tabs before empty output lines.<\/td><\/tr><tr><td><code>-l, --paginate<\/code><\/td><td>Paginate output through the <code>pr<\/code> command.<\/td><\/tr><tr><td><code>-r, --recursive<\/code><\/td><td>Recursively compare subdirectories found in the comparison.<\/td><\/tr><tr><td><code>--no-dereference<\/code><\/td><td>Do not follow symbolic links.<\/td><\/tr><tr><td><code>-N, --new-file<\/code><\/td><td>Treat missing files as empty files.<\/td><\/tr><tr><td><code>--unidirectional-new-file<\/code><\/td><td>Treat missing files in the first set as empty.<\/td><\/tr><tr><td><code>--ignore-file-name-case<\/code><\/td><td>Ignore case differences when comparing file names.<\/td><\/tr><tr><td><code>--no-ignore-file-name-case<\/code><\/td><td>Consider case differences when comparing file names.<\/td><\/tr><tr><td><code>-x, --exclude=PAT<\/code><\/td><td>Exclude files that match the pattern PAT.<\/td><\/tr><tr><td><code>-X, --exclude-from=FILE<\/code><\/td><td>Exclude files that match any pattern in FILE.<\/td><\/tr><tr><td><code>-S, --starting-file=FILE<\/code><\/td><td>Start the directory comparison with the file FILE.<\/td><\/tr><tr><td><code>--from-file=FILE1<\/code><\/td><td>Compare FILE1 to all operands; FILE1 can be a directory.<\/td><\/tr><tr><td><code>--to-file=FILE2<\/code><\/td><td>Compare all operands to FILE2; FILE2 can be a directory.<\/td><\/tr><tr><td><code>-i, --ignore-case<\/code><\/td><td>Ignore case differences in file contents.<\/td><\/tr><tr><td><code>-E, --ignore-tab-expansion<\/code><\/td><td>Ignore changes due to tab expansion.<\/td><\/tr><tr><td><code>-Z, --ignore-trailing-space<\/code><\/td><td>Ignore white space at the end of lines.<\/td><\/tr><tr><td><code>-b, --ignore-space-change<\/code><\/td><td>Ignore changes in the amount of white space.<\/td><\/tr><tr><td><code>-w, --ignore-all-space<\/code><\/td><td>Ignore all white space differences.<\/td><\/tr><tr><td><code>-B, --ignore-blank-lines<\/code><\/td><td>Ignore changes where lines are all blank.<\/td><\/tr><tr><td><code>-I, --ignore-matching-lines=RE<\/code><\/td><td>Ignore changes where all lines match the regular expression RE.<\/td><\/tr><tr><td><code>-a, --text<\/code><\/td><td>Treat all files as text.<\/td><\/tr><tr><td><code>--strip-trailing-cr<\/code><\/td><td>Remove trailing carriage return characters from input.<\/td><\/tr><tr><td><code>-D, --ifdef=NAME<\/code><\/td><td>Output merged file with <code>#ifdef NAME<\/code> diff markers.<\/td><\/tr><tr><td><code>--GTYPE-group-format=GFMT<\/code><\/td><td>Format GTYPE input groups with the format string GFMT.<\/td><\/tr><tr><td><code>--line-format=LFMT<\/code><\/td><td>Format all input lines with the format string LFMT.<\/td><\/tr><tr><td><code>--LTYPE-line-format=LFMT<\/code><\/td><td>Format LTYPE input lines with the format string LFMT.<\/td><\/tr><tr><td><code>-d, --minimal<\/code><\/td><td>Try to find the smallest set of changes.<\/td><\/tr><tr><td><code>--horizon-lines=NUM<\/code><\/td><td>Keep NUM lines of the common prefix and suffix.<\/td><\/tr><tr><td><code>--speed-large-files<\/code><\/td><td>Optimize for handling large files with many scattered changes.<\/td><\/tr><tr><td><code>--color[=WHEN]<\/code><\/td><td>Use colored output; WHEN can be <code>never<\/code>, <code>always<\/code>, or <code>auto<\/code>.<\/td><\/tr><tr><td><code>--palette=PALETTE<\/code><\/td><td>Define colors for use when <code>--color<\/code> is active; PALETTE is a colon-separated list of terminfo capabilities.<\/td><\/tr><tr><td><code>--help<\/code><\/td><td>Display help information and exit.<\/td><\/tr><tr><td><code>-v, --version<\/code><\/td><td>Show version information and exit.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. Basic File Comparison<\/h4>\n\n\n\n<p>To compare the contents of two files:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">2. Side-by-Side Comparison<\/h4>\n\n\n\n<p>To display the differences side by side, use the <code>-y<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -y file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">3. Ignore Case Differences<\/h4>\n\n\n\n<p>To ignore case differences in the comparison, use the <code>-i<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -i file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">4. Ignore White Space Changes<\/h4>\n\n\n\n<p>To ignore changes in white space, use the <code>-w<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -w file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">5. Compare Directories<\/h4>\n\n\n\n<p>To compare the contents of two directories:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -r dir1 dir2<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">6. Unified Format<\/h4>\n\n\n\n<p>To display differences in a unified format, which is often used in patch files, use the <code>-u<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -u file1.txt file2.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">7. Context Format<\/h4>\n\n\n\n<p>To display differences in a context format, use the <code>-c<\/code> option:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;UNIX&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">diff -c file1.txt file2.txt<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Linux Playground<\/h2>\n\n\n\n<iframe src=\"https:\/\/techkubo.com\/playcloud-linux-static.html\" title=\"Try Linux on TechKubo\" width=\"100%\" height=\"500\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>The diff command is used to compare files line by line. It outputs the differences between two files, making it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux - diff Command - Linux Command Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux - diff Command - Linux Command Tutorial\" \/>\n<meta property=\"og:description\" content=\"The diff command is used to compare files line by line. It outputs the differences between two files, making it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Command Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-18T05:53:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T18:02:33+00:00\" \/>\n<meta name=\"author\" content=\"Manong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"Linux &#8211; diff Command\",\"datePublished\":\"2024-12-18T05:53:07+00:00\",\"dateModified\":\"2025-05-28T18:02:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\"},\"wordCount\":536,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-diff-command\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\",\"url\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\",\"name\":\"Linux - diff Command - Linux Command Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#website\"},\"datePublished\":\"2024-12-18T05:53:07+00:00\",\"dateModified\":\"2025-05-28T18:02:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-diff-command\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-diff-command\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/linux\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux &#8211; diff Command\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techkubo.com\/linux\/#website\",\"url\":\"https:\/\/techkubo.com\/linux\/\",\"name\":\"Linux Command Tutorial\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techkubo.com\/linux\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\",\"name\":\"Linux Command Tutorial\",\"url\":\"https:\/\/techkubo.com\/linux\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png\",\"contentUrl\":\"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png\",\"width\":1617,\"height\":1184,\"caption\":\"Linux Command Tutorial\"},\"image\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\",\"name\":\"Manong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"caption\":\"Manong\"},\"sameAs\":[\"https:\/\/techkubo.com\"],\"url\":\"https:\/\/techkubo.com\/linux\/author\/manong\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux - diff Command - Linux Command Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techkubo.com\/linux\/linux-diff-command\/","og_locale":"en_US","og_type":"article","og_title":"Linux - diff Command - Linux Command Tutorial","og_description":"The diff command is used to compare files line by line. It outputs the differences between two files, making it [&hellip;]","og_url":"https:\/\/techkubo.com\/linux\/linux-diff-command\/","og_site_name":"Linux Command Tutorial","article_published_time":"2024-12-18T05:53:07+00:00","article_modified_time":"2025-05-28T18:02:33+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"Linux &#8211; diff Command","datePublished":"2024-12-18T05:53:07+00:00","dateModified":"2025-05-28T18:02:33+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/"},"wordCount":536,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/linux\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/linux\/linux-diff-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/","url":"https:\/\/techkubo.com\/linux\/linux-diff-command\/","name":"Linux - diff Command - Linux Command Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/#website"},"datePublished":"2024-12-18T05:53:07+00:00","dateModified":"2025-05-28T18:02:33+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/linux\/linux-diff-command\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/linux\/linux-diff-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/linux\/"},{"@type":"ListItem","position":2,"name":"Linux &#8211; diff Command"}]},{"@type":"WebSite","@id":"https:\/\/techkubo.com\/linux\/#website","url":"https:\/\/techkubo.com\/linux\/","name":"Linux Command Tutorial","description":"","publisher":{"@id":"https:\/\/techkubo.com\/linux\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techkubo.com\/linux\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techkubo.com\/linux\/#organization","name":"Linux Command Tutorial","url":"https:\/\/techkubo.com\/linux\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/","url":"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png","contentUrl":"https:\/\/techkubo.com\/linux\/wp-content\/uploads\/sites\/8\/2025\/01\/cropped-Techkubo-logo-1.png","width":1617,"height":1184,"caption":"Linux Command Tutorial"},"image":{"@id":"https:\/\/techkubo.com\/linux\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965","name":"Manong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","caption":"Manong"},"sameAs":["https:\/\/techkubo.com"],"url":"https:\/\/techkubo.com\/linux\/author\/manong\/"}]}},"_links":{"self":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/144"}],"collection":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":2,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/144\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}