Technology Insights

CentOS Linux: sort: invalid option — R, Try sort –help for more information

I was working on an article a couple days ago with a friend and he had sent over some commands for me to reference in the article which included the “sort -R” command. The sort -R switch will randomly sort the contents of a file which is very useful in certain situations. The problem is that the sort command which is installed by the coreutils RPM package on CentOS does not include the -R switch because it is to old. Below I describe the issue in more detail and provide references on how you could upgrade sort on CentOS Linux.