LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-26-2012, 05:52 AM   #1
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Rep: Reputation: Disabled
how to find the files more than 30 days


how to find the files more than 30 days in bash excluding all the files in subfolders
 
Old 07-26-2012, 05:54 AM   #2
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Original Poster
Rep: Reputation: Disabled
example
find /home -mtime 30

however it displays also all the files >30 in subfolders
how can i exclude the files in the subfolders?
 
Old 07-26-2012, 07:16 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Add the option -maxdepth 1
For more information on find use
Code:
man find
 
  


Reply

Tags
bash



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
[SOLVED] command to find and remove all files from /tmp direct that are older than 5 days old vaibhavs17 Linux - Newbie 1 06-28-2012 11:50 AM
[SOLVED] Command to find all of the files which have been accessed within the last 30 days sunilup Linux - Newbie 1 05-16-2010 01:32 AM
Script: purge files more than N days old. Need Non Recursive Find explore.s AIX 3 12-04-2008 07:24 AM
Using find and rm command to delete files over x days old 200mg Linux - Newbie 16 09-03-2008 06:41 PM
How to Find and remove 7 days before modified/created files neel.gurjar Linux - Software 2 05-14-2008 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:02 PM.

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
Open Source Consulting | Domain Registration