Linux
With Product You Purchase
Subscribe to our mailing list to get the new updates!
Lorem ipsum dolor sit amet, consectetur.
Related Articles
20 Comments
Leave a Reply Cancel reply
Check Also
Close
- How to install Kali Linux EASY & FAST on VirtualBoxDecember 7, 2024
Lit
One step further, but I use this every single day: use selection mode in vim, select a group of names, then type :sort. You're actually sending a selection to the terminal for this tool to sort and getting it sent back into vim, all in one easy command. 🤓
Just curious, is there any difference between using the -o flag and using the > operator to write to file?
let's use sort to specify an excel CSV column 😅
To be honest I constantly forget about flag -o in Linux and just redirect stdout to file 🙂
this also works on Mac
sort -k2,2 you crazy person
I just realized that I am an old fuck on linux. I didn't even know that people don't know about sort, or uniq, or sed/awk and so on.
Cool that you found something new 🙂 I loved this feeling
What next
Option '-k 2' doesn't work on my list
The fact that's column 2 not column 1 hurts me
I use windows
Ok, I get it, but why not redirect the output? Why use nvim when you can use cat?
Why not redirect output with > instead of using -o ?
I do this while in nvim all the time to sort imports and field names because ocd :!sort over your highlighted selection
Awesome stuff!
I use powershell (pwsh) and can use Sort-Object to achieve this same goal. But since powershell is an object oriented shell it is far more powerful than this sorting tool because I can sort on any objects properties.
pwsh is cross platform and I run it on all my systems including arch.
sort is a good friend. Just one extra sample: If you want to know which directory is largest in size? Easy: "du -k | sort -nr | more" – "disk usage in kilobytes, sort numeric reverse, and page with more".
What if some names have also middle names?
| uniq
Gotta be honest, I would have cat the contents to see what I'm working with, then hit up and piped to sort, verified it was what I wanted, then up again and redirect to a file. 😆