You could do something like:
awk '{print NF,$0}' file | sort -nr | cut -d' ' -f 2-
We use `awk` to prefix the number of fields to each line. We then `sort` by that number and remove it with `cut`.
You could do something like:
awk '{print NF,$0}' file | sort -nr | cut -d' ' -f 2-
We use `awk` to prefix the number of fields to each line. We then `sort` by that number and remove it with `cut`.