The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
647 views

Whats the most efficient way of adding milliseconds to this code?

#----------------------------------------------------------------------------- # # Get time string # #----------------------------------------------------------------------------- # sub formatTime ...
1
vote
1answer
379 views

Why ls -lrth and ls -ltch gives different results

I was trying to find the time of database backup. Normally i use ls -ltch But this time i used ls -lrth It gave me different result for One file and all date-stamps were same for both ...
1
vote
2answers
4k views

Solaris + display file time stamp [year][month][day]

I have Solaris 10 machine I need to verify time stamp of some file in my Solaris machine And to get the following format [year][month][day] Example of working command on Linux ls -l ...
7
votes
2answers
4k views

How to find difference between two timestamps up to milliseconds?

I am new to shell scripting. The heart of my script is to find the difference between two timestamps up to milliseconds. With me I have a file with content of timestamps only as 2012-09-13 ...
3
votes
1answer
285 views

How can I get high-precision timestamps (better than 1s) with Samba?

I did a quick test and got the results below. Whats with the horrible time resolution? Is there a way I can make it better? creation 129971441605098285 mod 129971442166583272 a.ToFileTimeUtc() ...
2
votes
2answers
315 views

Why sudo timestamp is not updated when NOPASSWD is set?

I've set up sudo not to prompt for password by editing the sudoers file: myuser ALL=(ALL:ALL) NOPASSWD: ALL And it works fine, running sudo with no password prompting. But when entering sudo -v I ...
3
votes
4answers
943 views

Modification and Access time of a file?

Is it possible to change the file modification time without changing the file acess time?
1
vote
1answer
827 views

rsync error: Time value of file truncated on receiver

I run the following rsync command to back up my data. I am on Ubuntu 12.04. rsync -rt --delete --links --exclude-from '/home/john/rsync-exclude.txt' /media/data/ server:/backup/data The data ...
0
votes
2answers
632 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
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) ...
1
vote
1answer
365 views

rename files maching specific mtime value within directory

I use simple set of shell commands to in order to create mysqldumps daily. The script is called by cron daemon. It looks like: presentdate="`date +%d-%m-%Y_%H:%M.%S`" basedir="/var/db_my_backup" ...
1
vote
2answers
310 views

Remove oldest folders + files (50GB) from a folder when share/HD reaches 95% full capacity

I have a big share (~5TB) that is getting full. Now I want to make a script that deletes data from 2 specified folders. But this need to be the oldest files/folders and it need to stop when ~50GB has ...
16
votes
4answers
768 views

Finding command execution time in hindsight

I've just executed a long-running process from the bash prompt. In hindsight, I wish I'd run time on it, or noted down the time at which I kicked it off. Is there any way of getting this information ...
10
votes
4answers
1k views

Preserve modified time stamp after edit

For files within a specific folder, I would like vim to never touch "modified" timestamp at all. The background is that I use Bloxsom for blogging, which uses plain text files in ~/bloxsom as source ...
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 ...
2
votes
2answers
278 views

find command for the newest 500 files in a directory tree and also be POSIX compliant

I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
3
votes
1answer
1k views

See if file has been copied to USB

Is there a way to see if a file has been copied to an USB drive? (Ex: I have the file secret.db and I suppose that my friend has copied it into his USB drive. With stat $filename I cannot see the ...
5
votes
1answer
892 views

Get “date” to understand a timestamp phrase of a different language

My web-scraping scripts have long enjoyed using date -d to read in human-formatted time and date stamps like "March 11, 1999" and convert to any other format I need via the -s parameter. How might I ...
3
votes
3answers
4k views

How can I change 'change' date of file?

How can I change 'change' date? $ touch -t 9901010000 test;stat test File: `test' Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: fe01h/65025d Inode: 11279017 ...
6
votes
7answers
2k views

Bash, remove oldest files

I`m trying to delete old files from directory and leave only 3 newest files. cd /home/user1/test while [ `ls -lAR | grep ^- | wc -l` < 3 ] ; do rm `ls -t1 /home/user/test | tail -1` ...
5
votes
1answer
1k views

On what occasion will inode change?

I checked manual of find , and there's an option -ctime which specify the last modification time of inode. But on what occasion would inode change ? When is that option useful ?
13
votes
4answers
5k views

How can I do a “copy if changed” operation?

I would like to copy a set of files from directory A to directory B, with the caveat that if a file in directory A is identical to a file in directory B, that file should not be copied (and thus its ...
14
votes
3answers
4k views

How to list files that were changed in a certain range of time?

How can I list recursively all files that were changed between 22.12.2011 and 24.12.2011?
2
votes
3answers
3k views

How to delete the oldest directory in a given directory? [duplicate]

Possible Duplicate: Shell script for moving oldest files? I have a backup directory that stores x other directories that require backuping. I need something that will run before another ...
6
votes
1answer
2k views

How do I get the difference between two timestamps?

I am creating a simple backup script. I would like to have a message saying "You last backed up x days ago" on login. I can create a file when I do the backup "backup/.last_backup_timestamp" but what ...
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 ...
2
votes
4answers
478 views

Access the last file (alphabetically) in a directory

I'm trying to open a file with vim from the command line, the file is in a directory filled with automatically generated files that are prepended with a time stamp. Since I don't know the time stamps ...
5
votes
2answers
856 views

Why does Unix store timestamps in a signed integer?

Why is a signed integer used to represent timestamps? There is a clearly defined start at 1970 that's represented as 0, so why would we need numbers before that? Are negative timestamps used anywhere? ...
4
votes
1answer
383 views

Only use mtime comparison with rsync?

Is it possible to sync files via rsync and let rsync only compare mtime informations? Or is there another tool for this job? That means that such a tool only copies src to destination if the src is ...
27
votes
3answers
86k views

Get file created/creation time? [duplicate]

Possible Duplicate: How do I do a ls and then sort the results by date created? Is there a command in Linux which displays when the file was created ? I see that ls -l gives the last ...
3
votes
1answer
835 views

How to recursively synchronize file timestamps across servers?

Suppose I run an rsync command to mirror a server, but forget to supply the -t option. The mirror will now have different timestamps to the original. What is the easiest way to fix this, without ...
7
votes
6answers
6k views

Shell script for moving oldest files?

How do I write a script for moving just the 20 oldest files from one folder to another? Is there a way to grab the oldest files in a folder?
3
votes
2answers
336 views

On touching a new file why is mtime and ctime older than atime?

I have this: $ ls -l ff ls: cannot access ff: No such file or directory $ touch ff $ stat ff File: `ff' Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: ...
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.
3
votes
3answers
2k views

Delete files based on year

I need to delete all files in a directory that were created in 2009. What command can I use to do that?
6
votes
2answers
722 views

What can you do to a file without triggering the “Change” Timestamp?

What can you do to a file without triggering the "Change" stat? For instance, it appears that simply changing a bit will trigger Change.
4
votes
2answers
1k views

Determine file system timestamp accuracy

File timestamps accuracy is limited to one second for EXT3, one microsecond for UFS, and one nanosecond for EXT4 (at least according to experience). Is there any way to determine this based only on ...
11
votes
3answers
1k views

What file systems on Linux store the creation time?

Are there any (good known, reliable) file systems on Linux that store the creation time of files and directories in the i-node table? If there are, is the "changed" time replaced by the creation ...
12
votes
6answers
6k views

Correlating /var/log/* timestamps

/var/log/messages, /var/log/syslog, and some other log files use a timestamp which contains an absolute time, like Jan 13 14:13:10. /var/log/Xorg.0.log and /var/log/dmesg, as well as the output of $ ...
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: ...