{"id":113,"date":"2024-12-17T06:43:24","date_gmt":"2024-12-17T06:43:24","guid":{"rendered":"https:\/\/techkubo.com\/linux\/?p=113"},"modified":"2025-05-28T18:00:38","modified_gmt":"2025-05-28T18:00:38","slug":"linux-sort-command","status":"publish","type":"post","link":"https:\/\/techkubo.com\/linux\/linux-sort-command\/","title":{"rendered":"Linux &#8211; sort Command"},"content":{"rendered":"\n<p>The <code>sort<\/code> command in Linux is used to sort lines of text files. It can arrange the text in various orders, such as alphabetical, numerical, or based on specific fields. This is useful for organizing and managing data within text files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Example<\/h2>\n\n\n\n<p>Using <code>sort<\/code> to sort the lines of a file called <code>example.txt<\/code> in alphabetical order:<\/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;}\">sort example.txt<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SORT 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>-b, --ignore-leading-blanks<\/code><\/td><td>Ignore leading blank spaces in sorting.<\/td><\/tr><tr><td><code>-d, --dictionary-order<\/code><\/td><td>Only consider blanks and alphanumeric characters for sorting.<\/td><\/tr><tr><td><code>-f, --ignore-case<\/code><\/td><td>Treat lowercase and uppercase characters as equivalent.<\/td><\/tr><tr><td><code>-g, --general-numeric-sort<\/code><\/td><td>Sort lines based on general numerical value.<\/td><\/tr><tr><td><code>-i, --ignore-nonprinting<\/code><\/td><td>Ignore non-printable characters in sorting.<\/td><\/tr><tr><td><code>-M, --month-sort<\/code><\/td><td>Sort by month, with unknowns &lt; &#8216;JAN&#8217; &lt; \u2026 &lt; &#8216;DEC&#8217;.<\/td><\/tr><tr><td><code>-h, --human-numeric-sort<\/code><\/td><td>Sort human-readable numbers (e.g., 2K, 1G).<\/td><\/tr><tr><td><code>-n, --numeric-sort<\/code><\/td><td>Sort lines based on numerical value.<\/td><\/tr><tr><td><code>-R, --random-sort<\/code><\/td><td>Shuffle lines randomly, keeping identical keys grouped.<\/td><\/tr><tr><td><code>--random-source=FILE<\/code><\/td><td>Use FILE for random byte generation.<\/td><\/tr><tr><td><code>-r, --reverse<\/code><\/td><td>Reverse the sort order.<\/td><\/tr><tr><td><code>--sort=WORD<\/code><\/td><td>Sort based on WORD: <code>general-numeric<\/code>, <code>human-numeric<\/code>, <code>month<\/code>, <code>numeric<\/code>, <code>random<\/code>, <code>version<\/code>.<\/td><\/tr><tr><td><code>-V, --version-sort<\/code><\/td><td>Sort version numbers within text naturally.<\/td><\/tr><tr><td><code>--batch-size=NMERGE<\/code><\/td><td>Merge up to NMERGE inputs simultaneously; use temporary files for more.<\/td><\/tr><tr><td><code>-c, --check, --check=diagnose-first<\/code><\/td><td>Check if input is sorted, without sorting.<\/td><\/tr><tr><td><code>-C, --check=quiet, --check=silent<\/code><\/td><td>Like <code>-c<\/code>, but suppress the output of the first unsorted line.<\/td><\/tr><tr><td><code>--compress-program=PROG<\/code><\/td><td>Compress and decompress temporary files using PROG.<\/td><\/tr><tr><td><code>--debug<\/code><\/td><td>Annotate sorted line parts and warn about potential issues.<\/td><\/tr><tr><td><code>--files0-from=F<\/code><\/td><td>Read input from files specified by NUL-terminated names in F; use <code>-<\/code> for standard input.<\/td><\/tr><tr><td><code>-k, --key=KEYDEF<\/code><\/td><td>Sort based on a specific key; <code>KEYDEF<\/code> defines the key&#8217;s location and type.<\/td><\/tr><tr><td><code>-m, --merge<\/code><\/td><td>Merge already sorted input files without sorting them.<\/td><\/tr><tr><td><code>-o, --output=FILE<\/code><\/td><td>Write output to FILE instead of standard output.<\/td><\/tr><tr><td><code>-s, --stable<\/code><\/td><td>Ensure stable sorting by disabling the last-resort comparison.<\/td><\/tr><tr><td><code>-S, --buffer-size=SIZE<\/code><\/td><td>Use SIZE for the main memory buffer.<\/td><\/tr><tr><td><code>-t, --field-separator=SEP<\/code><\/td><td>Use SEP as the field separator instead of whitespace.<\/td><\/tr><tr><td><code>-T, --temporary-directory=DIR<\/code><\/td><td>Use DIR for temporary files; specify multiple directories with multiple options.<\/td><\/tr><tr><td><code>--parallel=N<\/code><\/td><td>Run N sorts concurrently.<\/td><\/tr><tr><td><code>-u, --unique<\/code><\/td><td>With <code>-c<\/code>, check for strict order; without <code>-c<\/code>, output only the first of equal lines.<\/td><\/tr><tr><td><code>-z, --zero-terminated<\/code><\/td><td>Use NUL as the line delimiter instead of newline.<\/td><\/tr><tr><td><code>--help<\/code><\/td><td>Display help information and exit.<\/td><\/tr><tr><td><code>--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. Sort Lines Alphabetically<\/h4>\n\n\n\n<p>To sort the lines of a file in alphabetical order:<\/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;}\">sort filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">2. Sort Lines Numerically<\/h4>\n\n\n\n<p>To sort the lines of a file based on numerical values:<\/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;}\">sort -n filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">3. Sort Lines in Reverse Order<\/h4>\n\n\n\n<p>To sort the lines of a file in reverse order:<\/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;}\">sort -r filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">4. Sort Based on a Specific Field<\/h4>\n\n\n\n<p>To sort the lines of a file based on the values in a specific field (e.g., the second field):<\/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;}\">sort -k 2 filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">5. Sort with a Custom Field Separator<\/h4>\n\n\n\n<p>To specify a custom field separator (e.g., a comma):<\/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;}\">sort -t, -k 2 filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">6. Remove Duplicate Lines<\/h4>\n\n\n\n<p>To sort and remove duplicate lines from a file:<\/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;}\">sort -u filename.txt<\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">7. Sort Multiple Files<\/h4>\n\n\n\n<p>To sort the contents of multiple files and combine the output:<\/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;}\">sort file1.txt file2.txt -o sorted_output.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 sort command in Linux is used to sort lines of text files. It can arrange the text in various [&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-113","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 - sort 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-sort-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux - sort Command - Linux Command Tutorial\" \/>\n<meta property=\"og:description\" content=\"The sort command in Linux is used to sort lines of text files. It can arrange the text in various [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Command Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-17T06:43:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T18:00:38+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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"Linux &#8211; sort Command\",\"datePublished\":\"2024-12-17T06:43:24+00:00\",\"dateModified\":\"2025-05-28T18:00:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\"},\"wordCount\":416,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-sort-command\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\",\"url\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\",\"name\":\"Linux - sort Command - Linux Command Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/linux\/#website\"},\"datePublished\":\"2024-12-17T06:43:24+00:00\",\"dateModified\":\"2025-05-28T18:00:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/linux\/linux-sort-command\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/linux\/linux-sort-command\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/linux\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux &#8211; sort 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 - sort 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-sort-command\/","og_locale":"en_US","og_type":"article","og_title":"Linux - sort Command - Linux Command Tutorial","og_description":"The sort command in Linux is used to sort lines of text files. It can arrange the text in various [&hellip;]","og_url":"https:\/\/techkubo.com\/linux\/linux-sort-command\/","og_site_name":"Linux Command Tutorial","article_published_time":"2024-12-17T06:43:24+00:00","article_modified_time":"2025-05-28T18:00:38+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/linux\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"Linux &#8211; sort Command","datePublished":"2024-12-17T06:43:24+00:00","dateModified":"2025-05-28T18:00:38+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/"},"wordCount":416,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/linux\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/linux\/linux-sort-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/","url":"https:\/\/techkubo.com\/linux\/linux-sort-command\/","name":"Linux - sort Command - Linux Command Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/linux\/#website"},"datePublished":"2024-12-17T06:43:24+00:00","dateModified":"2025-05-28T18:00:38+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/linux\/linux-sort-command\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/linux\/linux-sort-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/linux\/"},{"@type":"ListItem","position":2,"name":"Linux &#8211; sort 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\/113"}],"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=113"}],"version-history":[{"count":3,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/posts\/113\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/linux\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}