It can be useful on a Linux server to sort all of the files in a directory by date. Sometimes you may want to backup files older than a certain date or you may just want to see what is in a directory and what date those files were created. Use the information below to list all of the files in a directory sorted by date.
I travel a lot and I have noticed that the timezone on my mac book wasn’t updating properly. I was getting lots of wrong meeting times in Outlook and various other apps that depend on time. I was getting pretty annoyed at this and decided to figure out what was up. I was pretty sure this was supposed to happen automatically so I decided to have a look and figure out what was going on.
I recently upgraded a CentOS Linux servers PHP from 5.2.X to 5.3.X and ran into a couple minor issues along the way. One of the issues was the fact that one of my applications was complaining about PHP’s date function by letting me know that it could not rely on the system’s timezone setting. Fixing this problem is extremely easy and can most likely be resolved by a quick edit to the servers php.ini file as described in detail below.
Recently there was a 0-day vulnerability posted for WordPress which allows users with edit post capabilities to issue SQL injection attacks against the WordPress site. Depending on the type of site that you run this isn’t a huge deal unless you allow any users that sign up to edit and publish articles on the WordPress site. One of the things that could help assist in this type of scenario is knowing who logins in and when as well as knowing if there are failed logins which could help indicate malicious activity. Below is information on a plugin that can accomplish both of these goals.
There are certain circumstances where you may want to modify the date and time of a file on Linux. In my case I was testing a cronjob that moved and deleted files older than a certain date and testing it was much easier after modifying the date of the files.
The command to use for modifying the date and time of a file is called touch. To modify the timestamp of a file issue one of the below commands. The file used in each of the examples below is named testfile.