Hello,
I have a folder full of files and Id like Linux to list the name of files with same size, how can I do this ?
size counter
Hmm, quite unusual problem, but let's try...
In a bit tricky way (to handle filenames with spaces properly), but this one-liner should do what you wish.
Open terminal window in desired folder and type/paste this:
(the output will be: size_in_bytes filename)
I'm sure there must be more elegant way (probably in awk), but we have to wait for an expert.
Greetings!
In a bit tricky way (to handle filenames with spaces properly), but this one-liner should do what you wish.
Open terminal window in desired folder and type/paste this:
Code: Select all
find . -type f -print0 | xargs -0 du -b | sort -h | tr " " "`echo -e '\x01'`" | rev | uniq -D -f1 | rev | tr "`echo -e '\x01'`" " "
I'm sure there must be more elegant way (probably in awk), but we have to wait for an expert.
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
[b][color=green]Omnia mea mecum porto.[/color][/b]
If you don't mind using ROX, first click the "Show extra details" view, then click the column heading called "Size." This will order the files in the folder in ascending (or descending, if you click the "Size" heading twice) order of size. If two files are the same size, they will be adjacent in the list.
Code: Select all
ls -sS
This gives "human-readable"size (i.e k, M, G):
with kind regards,
vovchik
Code: Select all
ls -sSh
vovchik