0
votes
0answers
7 views

Move all files in directory to date-time based structure [duplicate]

I am hoping someone here can help me with (hopefully) a simple task... I have a folder (/img/) with thousands of pictures in, and I need to move them into a date-time based folder structure based on ...
3
votes
2answers
288 views

How do I pipe output to date -d “value”?

I have a date like "2014-01-30 05:04:27 GMT", and if I run date -d "2014-01-30 05:04:27 GMT", the output is in my server's timezone ("Thu Jan 30 16:04:27 EST 2014"). With the use of grep and cut, I ...
0
votes
3answers
2k views

Better way to replace timestamp by date when reading a squid log

Tonight i was trying to look at my proxie's lines, and I came up with this, which seems all but KISS. How would you do it simply ? awk '{ trunc=sprintf("%.0f", $1) ;$1="" ; system("echo -n `date +%R ...
8
votes
4answers
1k views

Put a text in front of every new line that a program prints to stdout

So I want to do some logging and therefor, want to put a date in front of a bash script's output. The problem is that is has multiple lines of output. I am able to only put the date before the whole ...
13
votes
3answers
657 views

How to insert the date into vim

In vim you can execute comands with "!". You can combine that with "r" to insert the output into your current buffer. :r!date Fri Jul 20 09:39:26 SAST 2012 will insert the date into a file. ...
2
votes
4answers
286 views

How to cd to a newly created dir?

cd "$(mkdir -v "$(date -R)"|sed s+.`(.*)'.*)" This is meant to create a dir named $(date -R). I could simply cd $(date -R), but the culprit is the date could change since the previous command was ...
1
vote
2answers
1k views

How do I list files modified on or before particular date?

Using linux commands , is there way to list files which are created an hour (or particular date) before ?.
1
vote
3answers
1k views

How to Change Server Date?

How do I change a Linux web server's date through SSH?
7
votes
5answers
6k views

How to convert from day of year and year to a date YYYYMMDD?

I'm looking to go from day of year (1-366) and year (e.g. 2011) to a date in the format YYYYMMDD?
13
votes
3answers
17k views

how to add a day to date in bash?

For example, I have date: 4 August 1993 and I want to add 348 days to it, how can I do it in bash?