New answers tagged ls
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 ...
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,...
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.
$ ...
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 ...
Top 50 recent answers are included
Related Tags
ls × 1383bash × 220
linux × 161
shell × 152
files × 152
find × 135
directory × 108
command-line × 100
colors × 91
wildcards × 88
shell-script × 81
sort × 69
grep × 67
permissions × 55
macos × 51
filesystems × 50
filenames × 40
terminal × 39
symlink × 39
zsh × 37
disk-usage × 34
timestamps × 31
pipe × 26
awk × 25
coreutils × 25