2
votes
3answers
66 views

Convert a number of seconds elapsed to date from arbitrary start date

I want to convert a particular amount of seconds to a date. In my case the it's the number of seconds elapsed since 1st of January 0001. If it were for seconds elapsed from epoch it would be easy: $ ...
2
votes
5answers
456 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: ...
1
vote
3answers
115 views

Convert a date format

I have one problem with my date format. I want to change from one format to the other and vice verse. My date formats are: Format1 : 1/24/2014 Format2 : Jan 24 How can I do this?
0
votes
1answer
66 views

Why date +3 equals 3?

Yes, this is a minor issue, but I wonder why date +3 outputs 3 Other options like: date -3 raise an error.
2
votes
1answer
95 views

Any better method than this for sorting files by their creation date?

I needed to display a list of directories sorted by their creation date and I came up with this code snippet that I thought was kind of clever. Is there a more obvious way to do this that I'm missing? ...
0
votes
3answers
45 views

how to touch files like report-07/05/13

when I want to touch files like report-05/07/13 with command touch report-$(date +%D) it gives me an error like this: touch: cannot touchreport-07/05/13': No such file or directory` How can I build ...
2
votes
5answers
2k views

How do I set time and date from the Internet?

How do I retrieve the date from the Internet and set my computer's clock, from the command line?
1
vote
1answer
254 views

Unix Date command not working for few servers

I am trying to execute date command in unix server for yesterday. The commands tried are : date --date ="1 day ago" date --date ="1 days ago" date --date ="yesterday date --date ="-1 day" These ...
2
votes
2answers
257 views

CentOS 5.6 live time feature without repeatedly executing date command

I am using CentOS 5.6, is there a way to view a "live" time, without constantly executing the date command? Constantly excuting the date command can be quite frustrating and repetitive when checking ...
2
votes
5answers
404 views

Is it possible to reference the most recently modified file in a command line argument?

I frequently download PDF files with heinous numeric file names from my browser. These automatically go into ~/Downloads. Ideally I would like to just be able to open these files with: evince "the ...
3
votes
9answers
2k views

How to generate a year-quarter date from the command line?

I'm interested in outputting a representation of the current year-quarter, as well as the year-quarter for the previous month. If today is 2012 January 1st, I'd like to get 2012q1 and 2011q4 as ...
6
votes
3answers
14k views

Getting all files that have been modified on a specific date

Is it possible to find all php files within a certain directory that have been modified on a certain date I'm using find /var/www/html/dir/ -mtime -28 | grep '\.php' to get files modified within ...
8
votes
6answers
7k views

date, get current 15 minute interval

Is there any way I can get the current 15 minute interval using the date command or similar ? e.g. something like date %Y.%m.%d %H:%M will give me 2011.02.22 10:19 , I need something that yields ...
19
votes
5answers
22k views

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).