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.
Recently I was moving files from one directory to another on a CentOS 5.4 server and ran into an issue. When attempting to move every single file in the directory I received an error which is noted below. It took me a couple minutes but I figured out by trial and error that the issue was related to files starting with a “-“(dash) because the mv command thought that I was attempting to use a switch. The resolution is easy using “./”. Look at the below examples for more information about the error and how it was resolved.