GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
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.
This is a very simple problem. but i was not able to find solution.
Lets say a folder has 5 Files. In this 2 files were created 3 days and other files are older than 5 days.
How do we find, using linux shell script the name of files which have been created in the past 3 days (with respect to the current date).
For example, in the above example, if I excute the shell script today, 2 files names should be displayed.
If I execute the same shell script after 10 days, none of the files names should be displayed.
The mtime option sorts by the last time a file was modified. Assuming the files are created and then left alone, it would work in this case. If the files are being edited after creation, we're up a creek without a paddle. There is no standard way to store creation date for a file. If it's absolutely important that you know the date (albeit not the time) a file was created, you may want to run a script from cron, on a daily basis, to manually discover new files and record their appearance. It still won't be perfect because a file could be removed and later replaced by one with the same name and it would appear older than it actually was by that method.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.