Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Need help with the find command

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
liinuxn00b
Posts: 7
Joined: 2010-03-18 16:40

Need help with the find command

#1 Post by liinuxn00b »

I've got 2 problems:

1. How can I use the find command to search for devices files?
2. I need to find all files that are 6 months (or more) old and that have a size of 2 Mo or more. What would the code look like?

Oh and also, how can I use the cat command to insert text in a file?

Thanks for the help.

liinuxn00b
Posts: 7
Joined: 2010-03-18 16:40

Re: Need help with the find command

#2 Post by liinuxn00b »

Oh! Nevermind the cat command question. I've found how to do it.

User avatar
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: Need help with the find command

#3 Post by Telemachus »

What do you mean by device files?

Finding an item by creation time is tricky (strictly speaking, impossible, I think - see this link: http://www.faqs.org/faqs/unix-faq/faq/p ... ion-1.html).

However, something like this should get you into the ballpark:

Code: Select all

find $HOME -size +2M -ctime +180
Substitute $HOME with whatever directory name you want to search in (e.g., /usr/share/foobar).
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

Post Reply