2
votes
5answers
277 views

Listing files greater than particular timestamp in file name?

I have a directory in linux which has a list of log files where log files get auto generated if some job runs. Each log file gets appended with the timestamp like "JobName_TimeStamp" UPDATED: ...
2
votes
1answer
38 views

convert to epoch and back

I've used the following two perl command lines successfully: perl -e 'use Time::Local; print timelocal(7,51,10,22,3,2014), "\n";' which returns 1398163867, and perl -e 'print ...
1
vote
2answers
67 views

Is there a way to add some info about time/date to TTY prompt?

If you have a graphical display manager, you can notice date and time there, but I haven't seen such a thing when it comes to TTY. If I want to check the current time (or date) I have to log in. It's ...
2
votes
3answers
298 views

Timezone setting in Linux [closed]

I'm setting the timezone to GMT+6 on my Linux machine by copying the zoneinfo file to /etc/localtime, but the date command is still showing the time as UTCtime-6. Can any one explain to me this ...
0
votes
2answers
910 views

Sleep until next occurrence of specific time

I need a series of commands or a single command that sleeps until the next occurrence of a specific time like "4:00" occurs. How would I do that? The at command or a cronjob is not a option because ...
10
votes
3answers
954 views

What is the recommended way to synchronize time using NTP?

This question has come up a number of times in a localized way, this question is meant to provide the preferred/best method for synchronizing a system's clock using NTP. The solution should handle ...
1
vote
2answers
298 views

Moving Older Version Files to another folder via a script [closed]

I am trying to find a way of getting my cmd script to look through my folder, find the older versions of the pdf docs in the folder and move them to another folder called older versions. Problem I am ...
0
votes
1answer
135 views

How do you time how long a command took to run? [duplicate]

How would you find out how long a running process took to complete? Example: date; dd bs=1m if=/foo of=bar; date ^This example only has 1 second of resolution. Any shell is acceptable.
0
votes
2answers
1k views

Date time in Linux bash [closed]

I am trying to display a date time in the form of 07/08/2013 16:52:13 by using command in bash script: dt=`date '+%d/%m/%Y_%H:%M:%S'` which variable is used to populate a CSV file. The only ...
2
votes
2answers
4k views

Correct use of TZ, date, and hwclock?

I'm working on an Buildroot developed ARM/ulibc Linux distribution for a custom board. I'm trying to understand the relationship between If I do this, as I've seen on a few examples online: # date ...
6
votes
2answers
5k views

Good method to compare time?

I need to check for the current time and abort the script if it is not proper time of day I am supposed to run it. Also, if anyone else runs it, it should abort. For example: I need my script to only ...
3
votes
2answers
2k views

I messed up my system clock in Arch Linux

I installed Arch a couple of days ago. Just realized the date/time were off by a day and one hour. I changed it using timedatectl set-time. Then used hwclock --systohc to set the hardware clock. ...
0
votes
2answers
208 views

I want to add the above date to each line on a prstat log file

I have a prstat log, as you all know the date and time is recorded on the top of the log file, I would like to add that date and time to the begging of each line until it gets to a new date, then I ...
1
vote
2answers
15k views

How can I set the time in Centos so that resetting the OS doesn't revert to its default value?

I have a VPS running on Cent Os 5.8 (x86). There are situations in which we are forced to reset the entire VPS (it hangs and the only way to get it back on is to reset it). When we do so, the time is ...
0
votes
1answer
246 views

Setting system/hardware clock under Debian

I have installed a system with a London timezone, instead of using Central European Time. The problem is, that hwclock says the time is 11:00, date says the time is 11:00. I have changed the timezone ...
4
votes
2answers
2k views

/etc/shadow date of last password change—UTC or local time?

man 5 shadow gives the following description of the third field in each line: The date of the last password change, expressed as the number of days since Jan 1, 1970. The value 0 has a ...
2
votes
2answers
301 views

Padding day / time values to ensure 3 digit length

I have a script which renders timestamps in the format YYYY'DDD'TTT where Y = year, D = day out of 365 and T = time in 1000th's of the day: #!/bin/bash clear s=$(($(date +"%H*3600+%M*60+%S"))) ...
8
votes
1answer
3k views

Is there a way to adjust the formatting of the date/time in the GNOME 3 login screen and desktop?

I'm specifically looking to change the formatting in two places: On the desktop, the date/time reads "Sat 21:05". I would like it to read "23-Jul-11 21:05" or "23 Jul 11 21:05". In other words, I ...
-1
votes
1answer
2k views

Sum of grep results

I need to output the sum of a grep results for a certain time, for now i hard coded the time grep but any help will be very much appreciated, my problem is i cant output the results on the script. If ...
7
votes
3answers
550 views

Forcing an 'added' alias to every command

Is it possible to forcibly add a timing alias (for lack of a better way to phrase it) to every command in bash? For example, I would like to have a specific user who whenever a command is run, it is ...