Possible Duplicate:Combining 2 different cut outputs in a single command? I have One file - temp.txt - which containsABCDFPQRSTLMNOPI tried this cut command$ cut -c 2-5 temp.txtBCDFQRSTMNOPoutput is right.$ cut -c 1,2,3,4 temp.txtABCDPQRSLMNOoutput is right.But when I change sequence, meaning$ cut -c 2-4,1 temp.txtABCDPQRSLMNOabove output displayed.but logically output is  BCDAQRSPMNOLso my question is how this happen ,any reason behind that.
Reorder fields/characters with cut command
text processing;cut
The explanation is in man cut, though it is easy to read it as your preferred expectation. However it does say:  Selected input is written in the same order that it is read  It is perhaps ambiguous as to what is meant by input, but typically Options are just that, options, whereas the file being processes is definitely input.    The list, eg.-c 2,3,4,1 is very much like the regex list: [2341]; It means any of the numbers in the list, even if they are doubled up.. eg. -c 2,2,2,2,2,2 is the same as -c 2 .. and for the regex, [2222222] is the same as [2]... So the order of your options is not relevant.  