Hot answers tagged

53 votes

Why does the `ls` command sort files like this?

It depends on the collation order of your locale: >LANG=en_IE.UTF-8 ls -1 foo* foopa.png foo.png fooqa.png >LANG=C ls -1 foo* foo.png foopa.png fooqa.png You can also use the LC_COLLATE ...
xenoid's user avatar
  • 9,862
42 votes

How do I get cells in Excel that contain IP addresses to sort properly?

As you may have realised, your IP addresses are treated as text and not numbers. They are being sorted as text, which means that addresses beginning with "162" will come before addresses beginning ...
Blackwood's user avatar
  • 3,133
41 votes

Is there a Windows equivalent to the Unix uniq?

The Sort-Object cmdlet in PowerShell supports a -Unique switch that does the same thing as uniq: Get-Content file.txt | Sort-Object -unique Of course, owing to presence of aliases in PowerShell, you ...
Yu Jiaao's user avatar
  • 723
23 votes

Sort the contents of an extremely large (800GB) text file on Windows

One other option is to load the file into a Database. E.g. MySQL and MySQL Workbench. Databases are perfect candidates for working with large files. If your input file contains just words separated by ...
Peter H's user avatar
  • 331
18 votes

Unix/Linux find and sort by date modified

I have a simple solution that works for both FreeBSD (OS X) and Linux: find . -type f -exec ls -t {} +
Alex Shchur's user avatar
17 votes

Windows 10: Sort/rearrange icons in taskbar

I'm on Windows 10 Pro 1903. 7+ Taskbar Tweaker can be downloaded from its website. I've download version Beta and it runs fine. The option was disabled by default for me. I did not find any ...
Khalid Hussain's user avatar
16 votes

Sort the contents of an extremely large (800GB) text file on Windows

What are my options? Try Freeware Command Line Sort Utility CMSort. It uses multiple temporary files and then merges them at the end. CMsort is reading records of an input file until the adjusted ...
DavidPostill's user avatar
  • 155k
14 votes

How do I change the default sort order on Windows Explorer and the File Dialogs

I was still getting inconsistent results with the various solutions. This seemed to work best for me: Open My Documents folder, Select View - Details Either (A) move Date column to the far left or (...
Jim's user avatar
  • 159
13 votes

Windows Explorer sorting order for special characters?

The answers provided in this discussion, while interesting, are somewhat esoteric. The simple answer is that none of the symbols are sorted after the letters (not taking into account the special way ' ...
JCB's user avatar
  • 133
13 votes

How to sort by date modified ascending ALWAYS in Windows?

Instructions Press + E to open File Explorer, and then click onto the root of the "C" drive Press Ctrl + Shift + 6 to change the root "C" drive folder view to Details view which will ...
Vomit IT - Chunky Mess Style's user avatar
11 votes

How do I get cells in Excel that contain IP addresses to sort properly?

The most easiest, 3 steps Solution I can suggest you are,,, Select the IP Address Column, apply Text to Column command. In adjacent Column write this Formula =CONCATENATE(B3,".",C3,".",D3,".",E3) ...
Rajesh Sinha's user avatar
  • 9,067
10 votes

How to sort alphabetically based on a particular column in notepad++?

Place the cursor before the first character of the desired column. Press and hold the ALT key. By using the mouse mark the block in the column you want to sort like shown in the screenshot below. From ...'s user avatar
  • 1,940
9 votes

How do I get cells in Excel that contain IP addresses to sort properly?

Here'a a VBA function I wrote some time ago to solve the same problem. It generates a padded version of an IPv4 address which sorts correctly. Function SortAddress(Address As String) ...
grahamj42's user avatar
  • 206
8 votes

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

There are certain things I want to see in a directory listing, and so far none of the answers here meets all of the requirements below. My requirements for a directory listing: Directories and files ...
thdoan's user avatar
  • 747
8 votes

How do I get cells in Excel that contain IP addresses to sort properly?

Here is an answer that will take only 1 column of your table and converts the IPv4 address to base 10 numbering. Since you are putting your data in column "M", this starts in cell M2 (M1 being the ...
RudyB's user avatar
  • 308
8 votes

Windows alphabetical file sorting: why do spaces have special treatment?

Operating systems can really only use one of two basic methods, ASCII sorting or Natural sorting ASCII gives this pic credit -
Tetsujin's user avatar
  • 48.7k
8 votes

In which order does Windows Explorer sort folders when sorting the results of the search by size?

Actually, the primary sort in the "Top Results" view ( the default ) of most SearchResults folders is a property hidden from dislpay: System.Search.Rank. This can be verified by examining ...
Keith Miller's user avatar
  • 9,065
7 votes

Unix/Linux find and sort by date modified

OS X variant of @user195696's answer: With timestamp: find . -type f -exec stat -f "%Sm %N" -t "%Y%y%m%d%H%M" {} \; | sort -r Without timestamp: find . -type f -exec stat -f &...
user9399's user avatar
  • 171
7 votes

Firefox sort history based on time

I want to sort only on time and date You can sort using "View" > "By Last Visited". The “last visited” option is similar to the default “by date” option except this too is just a long list with ...
DavidPostill's user avatar
  • 155k
7 votes

Sort the contents of an extremely large (800GB) text file on Windows

sort There are many algorithms used to sort ordered and not ordered files [1]. Since all those algorithms are already implemented, pick a program already tested. In coreutils (from Linux but ...
Hastur's user avatar
  • 18.8k
6 votes

Is there a Windows equivalent to the Unix uniq?

There's ports of uniq that work identically to the gnu/coreutils versions. I personally use the variation from GOW but git for windows has a significantly newer version. No cygwin required though for ...
Journeyman Geek's user avatar
  • 128k
6 votes

Sorting fomulas in an Excel table

It looks like your Col G (Height) has a formula that is dependent on either the row values above or below the current row (my guess). This would cause them G to recalc every time there is a sorting ...
mark fitzpatrick's user avatar
6 votes

Sort chemical elements such as H, He, Li, Be by atomic number in Excel

Sort the data by the atomic number. Here's a query to return some data from Wikipedia: let Source = Web.Page(Web.Contents("
FlexYourData's user avatar
  • 6,630
5 votes

Why does 'sort' ignore special characters, like the asterisk?

To provide a simple answer based on others' comments, that doesn't change your environment: input_program | LC_COLLATE=C sort | output_program or LC_COLLATE=C sort < input_file > output_file ...
Walf's user avatar
  • 430
5 votes

Excel Sort Numeric Column By Number

I know this is an old post, but since it's at the top of the search results for this kind of thing... There's a much easier way to do this. To convert numbers stored as text to numbers: Select the ...
wjglenn's user avatar
  • 51
5 votes

Sorting mail in Thunderbird by both unread status and by date

Click the settings button while looking at your inbox (the 3 hatch marks upper right on your inbox view) point to "view" then "sort by" choose "read". If necessary go in again and choose sort order "...
user2152094's user avatar
5 votes

Unix vs Excel sort

env LC_ALL=C sort From the man page of sort: *** WARNING *** The locale specified by the environment affects sort order. Set LC_ALL=C to get the traditional sort order that uses native ...
davidmneedham's user avatar
5 votes

Cannot sort Excel Pivot Table by two or more columns

Use a calculated field The best way I've found to achieve this is to add a calculated field to the table that produces the correct sort order, and then to hide that column. The sort order field ...
Andi Mohr's user avatar
  • 4,225
5 votes

bash sort from the end of string

I wanted to sort (group) a list of email addresses by their domain names e.g. all '' then all the '' (solution based on a comment by makgun) rev emailist | sort | rev > ...
zzapper's user avatar
  • 311
5 votes

Bash - sort by not first character

tl;dr sort -k1.5 file | uniq -s 6 -w 5 Explanation My sort is GNU coreutils 8.22. The manpage for my sort shows: KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a field ...
bgStack15's user avatar
  • 2,214

Only top scored, non community-wiki answers of a minimum length are eligible