{"id":25704,"date":"2024-07-18T04:30:32","date_gmt":"2024-07-17T21:30:32","guid":{"rendered":"https:\/\/dte.telkomuniversity.ac.id\/?p=25704"},"modified":"2024-07-18T04:31:58","modified_gmt":"2024-07-17T21:31:58","slug":"perintah-sort-di-linux","status":"publish","type":"post","link":"https:\/\/dte.telkomuniversity.ac.id\/en\/perintah-sort-di-linux\/","title":{"rendered":"Perintah sort di Linux"},"content":{"rendered":"\n<p>Perintah &#8216;sort&#8217; digunakan untuk mengurutkan konten file dalam urutan alfabetis.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sintaks:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">bashSalin kode<code>sort &lt;namaFile&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Contoh:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">bashSalin kode<code>sort weeks.txt\n<\/code><\/pre>\n\n\n\n<p>Perhatikan snapshot di atas, perintah &#8216;sort&#8217; telah mengurutkan file &#8216;weeks.txt&#8217; dalam urutan alfabetis.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mengurutkan Kolom<\/h3>\n\n\n\n<p>Jika sebuah file memiliki lebih dari satu kolom, nomor kolom digunakan untuk mengurutkan kolom tertentu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sintaks:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">phpSalin kode<code>sort -k&lt;nomorKolom&gt; &lt;namaFile&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Contoh:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">bashSalin kode<code>sort -k1 states.txt\nsort -k2 states.txt\n<\/code><\/pre>\n\n\n\n<p>Perhatikan snapshot di atas, kita telah mengurutkan kolom 1 dan 2.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pengurutan Numerik<\/h3>\n\n\n\n<p>Pengurutan numerik berbeda dari pengurutan alfabetis. Untuk pengurutan numerik, opsi &#8216;n&#8217; digunakan bersamaan dengan nomor kolom jika diperlukan.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sintaks:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">phpSalin kode<code>sort -n -k&lt;nomorKolom&gt; &lt;namaFile&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Contoh:<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">bashSalin kode<code>sort -n -k2 marks.txt<\/code><\/pre>\n\n\n\n<p>ref:<a href=\"https:\/\/www.javatpoint.com\/linux-sort\" data-type=\"link\" data-id=\"https:\/\/www.javatpoint.com\/linux-sort\">[1]<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Perintah &#8216;sort&#8217; digunakan untuk mengurutkan konten file dalam urutan alfabetis. Sintaks: bashSalin kodesort &lt;namaFile&gt; Contoh: bashSalin kodesort weeks.txt Perhatikan snapshot di atas, perintah &#8216;sort&#8217; telah mengurutkan file &#8216;weeks.txt&#8217; dalam urutan alfabetis. Mengurutkan Kolom Jika sebuah file memiliki lebih dari satu kolom, nomor kolom digunakan untuk mengurutkan kolom tertentu. Sintaks: phpSalin kodesort -k&lt;nomorKolom&gt; &lt;namaFile&gt; Contoh: bashSalin [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":753,"footnotes":""},"categories":[753],"tags":[179],"class_list":["post-25704","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts\/25704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/comments?post=25704"}],"version-history":[{"count":1,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts\/25704\/revisions"}],"predecessor-version":[{"id":25705,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts\/25704\/revisions\/25705"}],"wp:attachment":[{"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/media?parent=25704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/categories?post=25704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dte.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/tags?post=25704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}