The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
5answers
11k views

Display time stamp in dd/mm/yyyy_hh:mm:ss:ms in Unix or Linux

I need help to display date and time in desired format in Unix/ Linux. My desired format is: dd/mm/yyyy hh:mm:ss:ms in Unix or Linux. I got close using the following command: echo $(date +%x_%r) ...
3
votes
4answers
1k views

Convert Unix timestamp into human-readable format on AIX

I need to convert unix timestamp (number of seconds since 1970, e.g. 1381260225 is Tue Oct 8 19:23:45 GMT 2013) into a standard human-readable format. I could get some answers by googling but those ...
8
votes
4answers
4k views

How to get milliseconds since Unix epoch?

I want to do a bash script that measures the launch time of a browser for that I am using an html which gets the time-stamp on-load in milliseconds using JavaScript. In the shell script just before i ...
2
votes
1answer
46 views

Delete *.txt files by date between MMDDYYYY and MMDDYYYYY

How can I use rm to delete *.txt files between MMDDYYYY and MMDDYYYY ?
0
votes
2answers
634 views

Correct timeline of a .ts file

I have some MVs that is recorded from a TV, but timeline was incorrect somehow: Anyone know some tool that can fix it ? The media plays fine, just the displayed stuff doesn't look good
25
votes
2answers
17k views

How do I do a ls and then sort the results by date created?

In what order are the dated ordered by? Certainly not alphanumeric order. ls -lt sorts by modification time. But I need creation time.
2
votes
3answers
951 views

How do I mass-convert the “last modified” dates in a particular directory?

For example, say, I know that my time-offsets are off by several hours (perhaps because my system clock was a few hours ahead at a certain time). In that case, how would I mass-change the "last ...
1
vote
2answers
81 views

How to get SCP execution time in milliseconds?

I have a script in which i am reading source and destination IP address from a csv file and recording the time in milliseconds it is taking to copy the file from source to destination (using scp). ...
2
votes
2answers
43 views

Stat command detail information

I am running command stat -c%y filename on linux system. Output: 2014-03-08 13:26:29.335545828 -0800 I am not able to understand the last -0800 thing. Anyone have any idea?
0
votes
0answers
23 views

Shell script time output over java enviroment

I am running a script from java program using sshxcute API. Script contains: #!/bin/sh data=`stat -c%y filename` echo $data Script running on bash gives output: 2014-03-08 13:26:29.335545828 -0800 ...
0
votes
2answers
65 views

copy files modified after specific date using cp switches

When I execute the command find . -mtime -60 I get the list of files modified within the last 60 days. So when I execute find . -mtime -60 -exec cp {} /tmp/1 \; I can copy these files to a new ...
1
vote
2answers
52 views

How can i keep the mtime of files and directories in bash when I use rsync or cp? For use in Backup/Incremental Backup

I have a new NAS box and after looking through numerous backup solutions I've found doing it manually through PuTTy to work the best. After logging in to the box through PuTTy as root, I first need ...
1
vote
2answers
71 views

When do inode modification times change? [closed]

I am currently reading UNIX by Bach. I encountered a problem while reading the section on inodes in the 4th chapter. A file modified time is shown as 1:45pm but the inode modified time is shown as ...
16
votes
4answers
5k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.
2
votes
2answers
91 views

How can I restore file timestamps of video recordings using the embedded metadata?

I'm looking for a command that will read the metadata of a ‘*.mp4’ file and touch the file's timestamp with the creation time of the video. The command should be read-only with respect to the file ...
1
vote
1answer
31 views

Is it possible to use the at command to schedule a job to run at a given timestamp?

I want to schedule a file to run using the at command, as described in this tutorial. I see that the at command supports the posix format -- but I don't see any mention of timestamps. Surely it is ...
2
votes
2answers
58 views

How to change “date modified” of multiple folders, to be the same of that of a .mkv that's inside each one, using Cygwin

How to change "date modified" of multiple folders to be the same of that of the .mkv that's inside each one. eg. there's folder1 which contains a file 1.mkv folder1: 2/17/14 1.mkv: 1/6/12 I want ...
18
votes
2answers
4k views

Prepending a timestamp to each line of output from a command

I wish to prepend a timestamp to each line of output from a command. For example: foo bar baz would become [2011-12-13 12:20:38] foo [2011-12-13 12:21:32] bar [2011-12-13 12:22:20] baz ...where ...
4
votes
2answers
72 views

In Linux Fedora, How can I select files to move by time interval

How can I select and move files that were written in a specified time interval, such as 1530 to 1730 local time on a recent date? Background: I use Linux Fedora 12, and I have made my first, and long ...
3
votes
1answer
51 views

timestamp of newly created file is in the future

On my machine at work I experience weird timestamps of files. This is bothering me, because it messes with make. To reproduce the issue, this suffices: $ touch foo $ stat -c %y foo 2014-01-31 ...
1
vote
2answers
427 views

How to log Serial data with time stamp?

I have an Arduino sending serial data to the computer. I'm able to view the data using a Serial console. But, I want to be able to log it with time stamp. I want a ready made script or program that ...
1
vote
1answer
19 views

Timestamp ts not working with thinkfan

I wanted the output of thinkfan -n output with a timestamp next to it so I can later analyse the patterns, and found this question: Prepending a timestamp to each line of output from a command, which ...
2
votes
2answers
183 views

get age of given file

How can I get the age of a given file in, at least, days? I'm well aware of ls -lh and similar commands. I want something that will work sort of like this: getfage <FILE> # prints out '12d' ...
2
votes
1answer
156 views

Hardware Timestamping using PTP

I'm new to Linux programming. I have an Intel NIC with e1000e driver. I'm working on accurate time stamping of packets being captured from a network. My question is if I want to use RT Linux how ...
1
vote
3answers
63 views

Adding timestamp to file/dir name

I am trying to write a script, that will copy file or directory with added timestamp to filename/dirname Something like: cover.jpg --> cover_18-01-2014_17:37:32.jpg directory --> ...
63
votes
15answers
11k views

What are the legitimate uses of the `touch` command?

What's the point of the touch command? I know I can create empty files with it, but so is also the case with echo -n. Otherwise, why would someone need to change the timestamps of a file? Unless to ...
6
votes
3answers
5k views

How do I change folder timestamps recursively to the newest file?

I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder. So for example: ...
0
votes
1answer
81 views

Where does bash store the time commands were executed?

Enabling history to display time via export HISTTIMEFORMAT='%F %T ' shows the times of the commands but .bash_history doesn't contain any times. Where does bash store the times the commands were ...
3
votes
2answers
95 views

Identify and assign most recent file to shell variable

I have a directory of .jpg files that continuously grows. I want to copy the most recent one elsewhere. This is what I currently have and it works, just curious if there's a better way to identify the ...
1
vote
1answer
77 views

touch and tar from a text file

Am trying to zip a certain number of files and am stuck at below point, ls -lrt /lag/cnn/*/*/*/adb.tar.gz | grep -nri ABC >> sample.txt In sample.txt i got filesNames on which i have to do ...
7
votes
2answers
98 views

What counts as a file modification or change?

Does renaming affect the file modify or access time? Is there a list somewhere of what changes which times?
3
votes
2answers
74 views

Is there any mitigation against touch date/time forgery?

I have been using touch -t to change time of a file when I started using Linux, is there any mitigation against touch date/time forgery? Like, echoing original created date and time, even after using ...
2
votes
1answer
74 views

Chrony 506 Cannot talk to daemon

I'm having trouble configuring chrony to sync the time between my raspberry pi and a desktop computer in an isolated network. My raspberry pi's chrony.config file looks like this: server master ...
4
votes
3answers
127 views

What could be the use case of changing modified time of a file to the future?

I was reading through the man page of ls on UNIX, specifically OS X Mavericks. This got me intrigued: If the modification time of the file is more than 6 months in the past or future, then the ...
1
vote
1answer
47 views

GNU date epoch +%s vs. now in timestamp phrases with computations including months?

I am trying to do date computations in a shell script using gnu date with timestamp phrases and fail to explain these differences. Can someone enlighten me? Is this a bug? % date -u -d "now" Fri Aug ...
2
votes
1answer
129 views

Why Linux syslog file does not follow the RFC3339 protocol?

Why Linux syslog file: /var/log/syslog does not follow the timestamp format defined in the protocol http://tools.ietf.org/html/rfc5424#page-11?
1
vote
1answer
886 views

Comparing file times in ksh

I have developed a script which will compare two dates. #!/bin/ksh #################################################################### # #DECLARING ALL THE VALUES AND PATHS # ...
1
vote
1answer
121 views

How can I finding the Modify/Access/Change time of a file or directory? [closed]

I am using Debian 7.2 and would like to know the shell command for finding the MAC time of a file or directory. I tried man -k "MAC" and got a lot of hits about macros. I then tried man -k "MAC ...
6
votes
7answers
694 views

timestamp before an echo

Exists a nicer way to create timestamp in front of an echo? Currently I do it this way: #!/bin/sh if mount | grep -q /mnt/usb; then echo `date +%R\ ` "usb device already mounted" else ...
4
votes
4answers
1k views

Changing the timestamp of a symlink

I know how to change the timestamp of a regular file: touch -t 201301291810 myfile.txt I was not able to do the same with a symlink. Is it possible? Distro: RHEL 5.8
1
vote
3answers
111 views

How to ensure File System is Mounted with ' atime ' enabled ?

Let's run mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type ...
0
votes
2answers
73 views

Programmatically get folders last edit time

How can I programmatically get a folders latest edit? I have already written the following script: #!/usr/bin/perl my @ls_command_result=qx(ls -l); my @the_folder=grep /folder_i_want/, ...
3
votes
3answers
998 views

How can I change the date modified of a folder to the last changed file inside? [duplicate]

In my media center directory all modified times of my folders are somehow not the desired date. How can I change all modified times of the main folders to the modified time of the newest media-file ...
1
vote
1answer
369 views

How to set system time from Unix timestamp

I know arbitrary timestamp and I want to set system time using it. I've tried following: date +%s -s "1371729865" date +%s -s '1371729865' date +%s -s 1371729865 but without success. The idea is, ...
1
vote
1answer
249 views

Attaching the time-stamp to the name of a log file

I have a Makefile which I invoke using the following command: $ make analyze foo=History01 I have the following Makefile and I need to attached the timestamp to the name of the log file: ...
4
votes
2answers
197 views

Extract timestamp from a gzip file

How can I know the raw original timestamp of a file foo compressed with gzip without having to decompress foo.gz? gzip --verbose --list foo.gz and file foo.gz will print formatted date and time.
5
votes
1answer
185 views

What does the “00:00:00” timestamp mean in kern.log?

I'm looking for causes of a particular problem in kern.log. There are many entries with a 00:00:00 timestamp: Jun 11 00:00:00 mymachine kernel: [ 0.000000] Initializing cgroup subsys cpusetJun 11 ...
15
votes
3answers
1k views

How does touch -t work internally?

How does touch -t command works exactly, internally (I tried to find its source code but couldn't)?
14
votes
2answers
692 views

How long is the password for executing a command with sudo cached?

If I run a command which requires root privileges with sudo, I will be asked to enter the current user's password. After that for a while, if I execute the same sort of commands with sudo, I won't be ...
4
votes
2answers
169 views

Sort files by modification time

I've seen many questions and answers here using a construction along the lines of list_dir=`ls -t /path/to/dir/` for i in $list_dir; do or ls -t | while read i; do Now, I know that you shouldn't ...