Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
As you said I did as "find /home/my_home_dir -mtime +1 -print", But it is giving around 1442 files information which is also included .Mozilla, .thunderbird, .thumbnail, .metacity files, I don't want these files info. So how can I exculde these hidden directories info, And what does +1 means in this command? Is it since last one day?
Note that the solution I mentioned only excludes the 1st-level entries, meaning the hidden directories and files in the main search directory won't be included.
So to exclude ".mozilla", ".metacity" and so forth, you use what I wrote before:
find ./* -mtime +1
This is effectively searching everything non-hidden in the main directory.
However, if you have hidden entries INSIDE the non-hidden, 1st-level entries, they will still be listed.
To exclude hidden matches (if you don't want hidden files to be shown in your search query), you can additionally use the -not -name modifier:
Yes you are correct, But now if I used "find ./* -mtime +1", But it is showing all old files older than a day, but excuding hidden directories.
But I need new files of last one or two days. So I ran "-1" instead of "+1" & found only new files which are belongs to since last 24 hours.
Anyway Thank you very much for your kind help.
Originally Posted by paulmarc
You can exclude these files by having ./* as your search path:
find ./* -mtime +1
You can omit -print as it's used by default.
The +n means the files are at least n*24 hours old: with n=1, it's at least (more than) 24 hours old, or at least 2 days old.