The tag has no wiki summary.

learn more… | top users | synonyms

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 ?
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). ...
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 ...
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
2answers
64 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 ...
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 ...
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
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 ...
1
vote
3answers
61 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 ...
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
93 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 ...
1
vote
2answers
425 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 ...
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
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' ...
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 ...
2
votes
1answer
73 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 ...
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
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 ...
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 ...
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
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
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 ...
6
votes
7answers
693 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 ...
3
votes
3answers
997 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 ...
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/, ...
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 ...
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
691 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 ...
1
vote
1answer
883 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
45 views

SVN wants to commit everything after server re-install

the motherboard of a dedicated server I'm renting since five years went south and the motherboard got replaced by a new one. The very old (Debian) distro couldn't keep up with all the new hardware on ...
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
395 views

rsync and backup and changing timezone

I back up my pictures from my camera using rsync, using: rsync -vzrtl --progress --stats --timeout=0 host destination Now I was in a different timezone when I did my first backup then I moved to a ...
0
votes
2answers
1k views

Solaris 10 modified time

In Solaris 8, when we access the file, the access time changes but modified time remains same. But in Solaris 10, we see that both access and modified time changes when accessing the file. We checked ...
3
votes
2answers
3k views

list all files newer than given timestamp and sort them

I want to list all files (sorted by date) that are newer than timestamp in format 20130207003851 in directory /tmp only. Subdirectories can be omitted. Using SUSE Linux Enterprise Server 11. The ...
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
1answer
422 views

Validate Unix Timestamp using BASH

My google-fu has failed me so I'm hoping someone here can point me in the right direction. I'm in the middle of doing some data validation efforts and I suspect the system is recording some invalid ...
0
votes
2answers
168 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 ...