Skip to main content

New answers tagged

0 votes

Sort output using "--key" and "--field-separator"

This date format is such that, when isolated from the leading text, required a simple sort. With reversed lines you only need to replace the third hyphen by space. This is enough to create two sort ...
canupseq's user avatar
  • 1,914
2 votes

Sort output using "--key" and "--field-separator"

Welcome here! When people start doing processing on the output of ls, we typically point them to this question, which in short, says don't do it, there's a better way! ls was meant for humans to read,...
Marcus Müller's user avatar
3 votes

Sort output using "--key" and "--field-separator"

Yes, you can't do it with sort alone unless you pre- and post- process the list in a decorate-sort-undecorate fashion. Here you can use zsh whose globs you can sort using arbitrary transformations. $ ...
Stéphane Chazelas's user avatar
0 votes

How to find total filesize grouped by extension

find . -type f -printf "%p %k\n" | sed 's|.*\.||' | awk '{ arr[$1]+=$2 } END { for (key in arr) printf("%s\t%s\n", key, arr[key]) }' | sort -k1,1 Based on this ...
Anton Duzenko's user avatar

Top 50 recent answers are included