LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2005, 10:34 AM   #1
tobycatlin
Member
 
Registered: Apr 2005
Location: Norwich, UK
Posts: 30

Rep: Reputation: 15
how to: List all files more than 1mb?


Hi ya all

I need to list all of the files in my home directory that are bigger than 1mb.

my best guess is

ls -sh | grep.......

Any help would be great
ta
 
Old 05-17-2005, 11:32 AM   #2
tobycatlin
Member
 
Registered: Apr 2005
Location: Norwich, UK
Posts: 30

Original Poster
Rep: Reputation: 15
i need it to recursivly search through sub dirs
 
Old 05-17-2005, 11:59 AM   #3
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Code:
find $HOME -size +1M
Or, if you want the size listed:
Code:
find $HOME -size +1M -exec ls -sh \{\} \;
I hope that I don't scare any newbies away from Linux with this ugly syntax.
 
Old 05-17-2005, 12:23 PM   #4
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
you are better off using "find"
the man page will help

man find
 
Old 05-18-2005, 07:09 AM   #5
tobycatlin
Member
 
Registered: Apr 2005
Location: Norwich, UK
Posts: 30

Original Poster
Rep: Reputation: 15
thanks
but when i run either of those commands i get

find: invalid -size type `M'
 
Old 05-18-2005, 08:07 AM   #6
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
You have old version of the findutils package. Either upgrade it (newest is 4.2.20) or specify the size in kilobytes (+1024k).
 
Old 05-18-2005, 09:12 AM   #7
tobycatlin
Member
 
Registered: Apr 2005
Location: Norwich, UK
Posts: 30

Original Poster
Rep: Reputation: 15
Thank you that works a treat.

I run up2date would that not keep findutils up to date (no pun intended)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to list how many files in a directory? malaka56 Linux - Software 8 09-02-2005 06:37 AM
How to list files from a certain user?? Drunkalot Linux - General 1 06-20-2005 06:11 AM
copying a list of files someone Linux - Newbie 2 11-25-2004 10:23 AM
List of device files? n8408 Linux - Software 3 09-16-2004 08:52 AM
Command to list some files? AoiSora Programming 13 10-29-2003 05:37 PM


All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration