Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

sort

‘sort’ produces output in a weird order

August 11, 2022 by Magenaut

Consider the following input to sort:

Categories Q&A, Unix & Linux Tags coreutils, sort Leave a comment

Sort based on the third column

August 11, 2022 by Magenaut

I’m facing a huge 4-columns file. I’d like to display the sorted file in stdout based on its 3rd column:

Categories Q&A, Unix & Linux Tags files, sort Leave a comment

sum pair of columns based on matching fields

August 11, 2022 by Magenaut

I have a large file in the following format:

Categories Q&A, Unix & Linux Tags awk, sort, text-processing, uniq Leave a comment

sort behavior when using numerical option: “sort -k2,2 -nk6,6 foo” vs “sort -k2,2 -k6,6n foo”

August 10, 2022 by Magenaut

The two examples in the title produce very different results. The first (sort -k2,2 -nk6,6 foo) brings back the following results:

Categories Q&A, Unix & Linux Tags sort Leave a comment

Sort not sorting lines with a pipe ‘|’ in it correctly

August 10, 2022 by Magenaut

I am trying to sort some simple pipe-delimited data. However, sort isn’t actually sorting. It moves my header row to the bottom, but my two rows starting with 241 are being split by a row starting with 24.

Categories Q&A, Unix & Linux Tags sort Leave a comment

How can I remove duplicates in my .bash_history, preserving order?

August 9, 2022 by Magenaut

I really enjoying using control+r to recursively search my command history. I’ve found a few good options I like to use with it:

Categories Q&A, Unix & Linux Tags bash, command-history, command-line, sort, uniq Leave a comment

How to sort big files?

August 9, 2022 by Magenaut

I have a PC with Intel(R) Pentium(R) CPU G640 @ 2.80 GHz and 8 GB of RAM. I am running Scientific Linux 6.5 on it with EXT3 filesystem.

Categories Q&A, Unix & Linux Tags sort Leave a comment

How can I numerically sort a single line of delimited items?

August 9, 2022 by Magenaut

I have a line (or many lines) of numbers that are delimited by an arbitrary character. What UNIX tools can I use to sort each line’s items numerically, retaining the delimiter?

Categories Q&A, Unix & Linux Tags numeric-data, sort Leave a comment

How do I make ls sort underscore characters first?

August 9, 2022 by Magenaut

I like being able to name files and directories with an underscore prefix if it’s something I want to keep separate from other files and directories at the same level. On Windows and Mac, for example, prefixing a file with an underscore sorts it to the top, in front of files starting with an alphanumeric character.

Categories Q&A, Unix & Linux Tags locale, ls, sort Leave a comment

How to numerical sort by last column?

August 9, 2022 by Magenaut

I have this input:

Categories Q&A, Unix & Linux Tags sort, text-processing Leave a comment
Older posts
Page1 Page2 … Page6 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress