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 21 Oct 2014, 17:38
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 Posts_count  
Author Message
woflux

Joined: 11 Sep 2012
Posts: 22

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: 214

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: 1078

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: 11118
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: 501
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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