Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 29 Jul 2014, 23:36
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
size counter
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
woflux

Joined: 11 Sep 2012
Posts: 20

PostPosted: Thu 03 Jan 2013, 12:45    Post subject:  size counter  

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 ?
Back to top
View user's profile Send private message 
slenkar

Joined: 10 Jul 2009
Posts: 204

PostPosted: Thu 03 Jan 2013, 14:07    Post subject:  

how about menu-filesystem-graphical disk usage
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1044

PostPosted: Thu 03 Jan 2013, 15:02    Post subject:  

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:
Code:
find . -type f -print0 | xargs -0 du -b | sort -h | tr " " "`echo -e '\x01'`" | rev | uniq -D -f1 | rev | tr "`echo -e '\x01'`" " "

(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. Wink

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10943
Location: Arizona USA

PostPosted: Thu 03 Jan 2013, 16:12    Post subject:  

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.
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 464
Location: State of Jefferson

PostPosted: Sat 05 Jan 2013, 17:17    Post subject:  

Code:
 ls -sS

Only gives size in kilobytes, unfortunately.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sat 05 Jan 2013, 17:34    Post subject:  

This gives "human-readable"size (i.e k, M, G):
Code:
ls -sSh

with kind regards,
vovchik
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0468s ][ Queries: 12 (0.0033s) ][ GZIP on ]