I am using the Terminal. I would like to know how do I put the current date and time on my machine and the date from a certain URL that has .php extension into a file.
I am using Red hat Linux operating system.I want change the date exactly 5 years ago to current date with out providing month, date and time. I want only the year should be 5 years ago .please help in this regard . example . If current date is this = Wed mar 18 22:59:23 IST 2010. past date shuld be like this= Sat Mar 18 22:59:23 IST 2005
rpm -qa --last lists all rpm with date and time. But I want to sort the list by date, with earlier rpm displayed first. So it needs pipe, rpm -qa --last |
Centos 5.4 64bitWould like to know when a particular process was started.1.Quote:ll -d /proc/4014/dr-xr-xr-x 5 mysql mysql 0 Nov 28 07:34 /proc/4014/2.Quote:ps -o pid,lstart -p 4014 PIDSTARTED 4014 Tue Nov 17 23:10:13 20091) Which one should I consider?2) why do both have such a difference?
I would appreciate help with how to extract the date and time from at command jobs. From what I can tell, the date and time is embedded in the file name (/var/spool/atjobs).I'd be using this information in a (bash) shell script.
I know that uptime prints the time a machine has been up and running, but is there an easier (reliable) way to get the date of the start up than counting down from this output?I tried looking around /proc, but didn't find anything of relevance. There's also a line like this on my dmesg: [ 0.673492] rtc_cmos rtc_cmos: setting system clock to 2011-03-14 14:26:52 UTC (1300112812), but I'm wondering if this method is distribution and kernel version agnostic.
I have an old computer and BIOS counts the time slower than real. So, how can I set my OS to update the time automatically using the internet? If it updated the time only during booting, it would be enough.
I've got fedora 11 set up to use network time protocol to sync my laptop's date & time when I'm on-line. The question is simple really, I've added a local universality's time server (what is public) and it's live. but it's added to the end of the default time servers what come with fedora. How do I get fedora to just use the local time server, is it a case of removing the default time servers for fedora, but there is a box what says advanced options which are. sync system clock before starting service ???? & use Local time source (( is that the same as the local ntp server that I've got set up ))Hope some body can help me with the network time protocol part of Date/Time settings.
I tried googling but couldnt find the task manager equivalent? Just want to find out how much memory LINUX uses in general as I have been using it for few days and everything seems faster than on vista with no programs freezing! Also on my taskbar, when I click on the time to change it, it doesn't work? I think the timezone is set to US or something but how do i change the timezone?
How do i log the start/completion (time&date) of my cron job script? i want to be able to see what time it started and what time it finished? and if there where any errors while running my script.
I used to have the date and time in the upper right hand corner and then yesterday morning it was just gone. I can't figure out how to get it back up there. I've looked everywhere I thought it would be to put it back on there and I've had no such luck.
I'm trying to find a proper command to move a certain set of files according to date/time range. I am thinking that the command should be something like:
I wrote a hack script that outputs the following every so often: Code: 01/04/11 10:33:02: 97,1413,1447,2860 I must leave the data format the same --but I want a special number from it. In this case it's 97 and it's always going to be the first in the 4 columns of comma delimited items. I can extract with this:
Code: cat datafile | awk -F" " {'print $3'} | awk -F"," {'print $1'} But that's really sloppy. Can someone point out a better way of doing this (with awk) and tell me why?
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.For example, here is what I need to strip:
Date: 11/09/09
If I manually run the following SED command, it works great, however I cannot seem to find a way to use the actual "date" command within SED, to get the desired results.
WORKING: sed -i -e 's/Date: 11/09/09/ /' myfile
I've been messing around with various attempts to do this using the "date" command within SED, but I just can seem to get it right. I've also attempted defining variables which call separate "date" commands for day, month, year and inject them via standard variable calling, echoing variable, expanding variable with brackets, etc... Here are a few of the SED command attempts I've tried:
Quote:
sed -i -e 'sate: `date +%D`: :' myfile sed -i -e "s/Date: `date +%d`/`date +%m`/`date +%y`/ /" myfile sed -i -e 's/Date: `date +%d`/`date +%m`/`date +%y`/ /' myfile sed -i -e 's/Date: $(date +%D) / /' myfile
I need to replace it with the equivalent number of spaces, as I'm going to be overlaying a PCL Logo here and need to keep the structure of the rest of the file. Cannot have the remaining portion of the line shifting left.
Currently I'm using `ls -l | grep "Mar 13" ` for listing today log files.Output :-rw------- 1 root root 2188192 Mar 13 10:33 audit.logBut my requirement like below,note permission,date,size...audit.log Note : Where 10 logs file are same directory in different date , But I'm looking files which are logging in today date (Mar 13)
Sometimes it is possible to trick a Linux app by calling it like this:
HOME=/tmp/foo myapp
This would make myapp think /tmp/foo is the home directory, it won't try to get the user id, find its home directory via getpwent(). This is useful when myapp must be forced to dump some of its config files into a non-standard location different than ~.
A similar trick can be done like this: LANG=foo LC_ALL=bar myapp
This is useful when myapp needs to be called once with a different locale without having to make the change persistent by using the export bash built-in or even modify stuff in /etc/profile.
Is it possible to pull the same trick with time and date? The goal is to make an app use another time than the system ones. The final goal - to make timestamps that appear in logs/commit messages not being tied to the system time.
I am reading about jiffies in linux kernel. In one of the related example in the book Linux Device Driver, the author use head -8 /proc/currentime to print out some time information.
However this file is not present in my linux installation (kernel: 2.6.32-131.6.1.el6.x86_64). Why is it the case? Is it because the file path is no longer valid, or it is a distribution feature thing? It is not present in OSX too. What would be an equivalent in OSX?
I want to run a script that runs after every 15 minutes that i will do using crontab. But in script want to search a string from the last 15 minutes logs in log file containing data of whole day.
how i can search the string according to time difference that is logs from from current time and current time - 15 minutes.
Sample logs are as follows:
26-Aug-2010 16:38:46,055|9172310750|subscription_app|31ba267e%3A12aadd47bdc%3A50e9|ChargeAmount|ChargingIntercep tor - subscriber details processed sucessfully- {arg0.referenceCode=balanceEnquiry:true;subsChannel:Unknown;channelType:Subscription;transactionId:3
### TO DO: Determine the report file name based on the source directory name and current date### The report name and thumbnail directory must follow this pattern: source-%j-%H### for example, for pictures in /home/you/pictures, the file name will be: pictures-%j-%H### HINT: Use sed to extract the directory name from the path and combine it with date command output
I'd like to change a files modification date "only" without changing the time. I'm aware of the 'touch' command but is seems like it only allows changing both the date and time, and not one of them. Any ideas on an easy way to change a file's modification date without also changing its time? (I have a long list of files and thus would like to run one to command to change them all)Example: Change a file's (month) timestamp from "2010-09-23 11:59:23" to "2010-10-23 11:59:23"Background: I accidentally set the wrong month on my camera and ended up with all photos having a modification timestamp with the wrong month.