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.
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
-
- Posts: 7
- Joined: 2010-03-18 16:40
Re: Need help with the find command
Oh! Nevermind the cat command question. I've found how to do it.
- Telemachus
- Posts: 4574
- Joined: 2006-12-25 15:53
- Been thanked: 2 times
Re: Need help with the find command
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:
Substitute $HOME with whatever directory name you want to search in (e.g., /usr/share/foobar).
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
"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
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System