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!
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
For the life of me I cannot remember the command to find files created in the year 2017. I know that there are numerous was but as I recall it was a 'find' command and possibly used '-mtime'.
The specifics for that would be in the manual page for find under -newerXY. In the above example, X is m to check the modification time and Y is t to reference a time string.
which suggests that your operating system may not support -newermt, in which case you can use -newer and compare the dates against two files for which you have set the modification dates.
Just a minor point, but *nix filesystems don't (usually) store create date
Quote:
Three fields in the inode structure contain the last access, change, and modification times: atime, ctime, and mtime. The atime field is updated each time the pointer to the file's data blocks is followed and the file's data is read. The mtime field is updated each time the file's data changes. The ctime field is updated each time the file's inode changes. The ctime is not creation time; there is no way under standard Unix to find a file's creation time.
Perl Cookbook
The 'find' cmd allows you to specify which one you want to use.
Right. But it is of some help, and the goal is to move forward even if in small steps. What did the manual page show in regards to -newerXY for your CentOS 6.x? Your choices are limited to what the documentation on your machine shows.
If -newer is the only such option, then you'll have to touch two files with custom dates and then use -newer and \! -newer instead.
The backslash \ is there to escape the exclation mark ! so that it is passed to find instead of being processed by the shell. In the shell it is a special symbol that would cause other actions to be taken.
But this server is a EXT3 system. I appreciate the help by man find is as helpful as telling a blind man that the 7-11 down on the corner on the left. Maybe he can smell the nachos. Bad example but hopefully you get my point.
I was once a prolific programmer. But with Linux and the plethora of command line switches make learning a struggle for me. Which ones work with others? Etc. I'm struggling. My newest server using Centos 6.9. I am trying to clean out all of the sites that have been hacked and used to build websites within web sites. Alibaba. They hide files everywhere.
That's what the manual pages are for. They are how you navigate the system. They are references to look up stuff in and are terse as references should be.
Quote:
Originally Posted by krazybob
Etc. I'm struggling. My newest server using Centos 6.9. I am trying to clean out all of the sites that have been hacked and used to build websites within web sites. Alibaba. They hide files everywhere.
Sorry to hear that. Yes, once they are in they can and do hide files everywhere. Figure out how they got in ...
But once they have gotten in you have one option and one option only: backup your data again, backup your logs, reformat and do a fresh but locked down install of CentOS. What kind of recovery plan do you have on file?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.