Tag Info

New answers tagged

0

You need to write in BIOS, Suppose you want to change date strings to the following string: root@debian:/home/mohsen# date -s "Sat May 23 18:56:59 IRDT 2015" root@debian:/home/mohsen# hwclock -w An first line you set a date, But you need to write in bios, In second line with hwclock -w you write your time in bios.


0

You don't need microseconds resolution, milliseconds will do for about 20 to 60 frames per second. If you you get system time for all Pis from a NTP Server one time, they will be missaligned after some time again, because each internal clock may have an individual error of about 100 ppm (part per million). After 200 seconds you might have a difference of up ...


1

A few options: ksh93 or recent bash, any system (shell builtin): printf "%(%Y%m%d)T\n" 1427792481 zsh any system (builtin): zmodload zsh/datetime strftime %Y%m%d 1427792481 GNU date: date -d@1427792481 +%Y%m%d GNU awk: awk 'BEGIN{print strftime("%Y%m%d", 1427792481)}' perl: perl -MPOSIX -le 'print strftime "%Y%m%d", localtime 1427792481'


1

If you have configured all of the Raspberry Pis to a local NTP Server, i.e. you've set up an NTP Server on your LAN, then their synchronization should be adequate for your video frame timestamping task. Both Bash and Python need to make a system function call to retrieve the system time. There's no advantage in using Bash to make that call. Both Python ...


8

There's no much point asking for this kind of precision in a shell script, given that running any command (even the date command) will take at least a few hundreds of those microseconds. In particular, you can't really use the date command to time the execution of a command with this kind of precision. For that, best would be to use the time command or ...


4

As you said date +%s returns the number of seconds since the epoch. So, date +%s%N returns the seconds and the current nanoseconds. Dividing date +%s%N the value by 1000 will give in microseconds.i.e echo $(($(date +%s%N)/1000))


9

date +%s%N will give the nano seconds since epoch To get the micro seconds just do an eval expr `date +%s%N` / 1000


1

If you follow the next link on the documentation page: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-pam-timestamp-remove.html you can find a reference to the pam_timestamp_check utility. The pam_timestamp_check utility will check the validity of the file and the return value can be checked. See also man pam_timestamp_check for details. On my ...


0

In addition to the answers already given, note that you can directly specify your dates: find -type f -newermt "2011-12-22" \! -newermt "2011-12-24" or find -type f -newermt "2011-12-22 00:00:00" \! -newermt "2011-12-24 13:23:00" if you additionally want to specify the time.


2

One of your problems is that you left out the double quotes around the command substitution, so the output from the date command was split at spaces. See Why does my shell script choke on whitespace or other special characters? This is a valid command: cp -a /home/bpacheco/Test1 "/home/bpacheco/Test2-$(date +"%m-%d-%y-%r")" If you want to append to the ...


3

Think of a directory as a text file that looks something like: 123:foo.txt 234:bar.txt 123:other-name-for-foo.txt That's all there is (at least in traditional Unix file systems). foo.txt is not a child of that directory in that it's not an exclusive relationship. It's just that the file of inode number 123 is referenced in two entries of that directory: ...


2

As @Celada said, this is really easy to test. One note however: ctime is the last time where inode informations have been changed (the inode number doesn't change). So: If a file's content is stored outside its inode, changing its content will change the mtime to the present, but will that changes its ctime and atime to the present? If you ...


2

You need two more sentences: atime will change only when you read, open, or touch the file. ctime is also changed when content of file changed. With these in mind, we can answer your questions easily: If a file's content is stored outside its inode, changing its content will change the mtime to the present, but will that changes its ctime and ...


0

-mtime N means files whose age A in days satisfies N ≤ A < N+1. In other words, -mtime N selects files that were last modified between N and N+1 days ago. -mtime -N means files whose age A satisfies A < N, i.e. files modified less than N days ago. Less intuitively, -mtime +N means files whose age A satisfies N+1 ≤ A, i.e. files modified at least N+1 ...



Top 50 recent answers are included