sort: string comparison failed Invalid or incomplete multibyte or wide character sort: string comparison failed Invalid or incomplete multibyte or wide character unix unix

sort: string comparison failed Invalid or incomplete multibyte or wide character


I know it's an old question, but just running the command export LC_ALL='C' does the trick as described by sort: Set LC_ALL='C' to work around the problem..


Looks like a Windows line-ending related problem (\r\n versus \n). You can convert m.txt to Unix line-endings with

dos2unix m.txt

and then rerun your command.