I have a a couple of Apache log files that have been appended together and I need to sort them by date. They\'re in the following format:
\"www.company.com\" 19
I figured this out with online examples, skimming through 'The Linux Command Line' book, man pages, and trial-and-error:
sort -k 3.9nb -k 3.5Mb -k 3.2nb [location and name of file]
The b along with the n or M will stop sort from reading characters that do not make sense such as / and : which makes life easier when the space is already used as a delimiter and you still have to separate by :, /, and/or any other character you wish smite when sorting.
The above script will sort by year first, then by month and then by date. Place an r next to the all the b's to descend.