Case insensitive sorting

Vim’s default sort is case sensitive, and produces results like this: A B a How can it be made case-insensitive, to produce the following result given the same input? A a B Answer Vim’s own :sort command :%sort i does what you want. See :help :sort. Alternatively, you can also use your system’s sort command … Read more

How to sort first directories then files etc… when using “ls” in Unix

I would like to use the ls command to first show directories and then files. I tried: ls -la | sort -k 1 But I got a wrong order. Answer The following command will list directories first, ordinary files second, and links third. ls -la | grep “^d” && ls -la | grep “^-” && … Read more

Unix/Linux find and sort by date modified

How can I do a simple find which would order the results by most recently modified? Here is the current find I am using (I am doing a shell escape in PHP, so that is the reasoning for the variables): find ‘$dir’ -name ‘$str’\* -print | head -10 How could I have this order the … Read more

Sorting lines in Notepad++ without the TextFX plugin

The current version of Notepad++ (at the time of this writing) is 6.6.3. Version 6.5.2 is the first that introduced a native (without a plugin) sorting function. At least, that’s what they claim; even though we’re nine releases after version 6.5.2, I have found nothing about this feature: There is no sign of it in … Read more