Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
12
votes
7
answers
56949
views
How to get system time with microsecond Resolution
I want to know current system time with microsecond Resolution. `date +%s` returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying this value? By delay I mean suppose at time `t` secs i query and it gives me value `t + t'` what is `...
I want to know current system time with microsecond Resolution.
My Use case: I am recording Videos using multiple Raspberry Pis simulatenously. Now I want to timestamp each frame of videos so that I can align them. Currently for timestamp it's using boot time(time since boot). Boot time is accurate but it's different for each Raspberry Pi. I have configured all Pi's to a NTP Server thus all have same System time. So basically I want the timestamp of System time not Boot Time. How can I do that ?
date +%s
returns Time in seconds since epoch(1-1-1970). How can I get time in microseconds Resolution. How much delay is in querying this value? By delay I mean suppose at time t
secs i query and it gives me value t + t'
what is t'
? My Use case: I am recording Videos using multiple Raspberry Pis simulatenously. Now I want to timestamp each frame of videos so that I can align them. Currently for timestamp it's using boot time(time since boot). Boot time is accurate but it's different for each Raspberry Pi. I have configured all Pi's to a NTP Server thus all have same System time. So basically I want the timestamp of System time not Boot Time. How can I do that ?
Coderaemon
(229 rep)
May 21, 2015, 10:23 AM
• Last activity: Jul 11, 2025, 10:46 AM
7
votes
3
answers
2667
views
Set directory timestamps to most recently modified file within (recursively)
How do I change the timestamp of a directory and all the sub-folders within that directory to reflect the modification times of the contained files? For example with this directory structure: [Jan 9] root ├── [Jan 3] file1 ├── [Jan 7] file2 ├── [Jan 6] sub1 │   ├── [Jan 2] file3 │ ...
How do I change the timestamp of a directory and all the sub-folders within that directory to reflect the modification times of the contained files?
For example with this directory structure:
[Jan 9] root
├── [Jan 3] file1
├── [Jan 7] file2
├── [Jan 6] sub1
│ ├── [Jan 2] file3
│ └── [Jan 1] file4
└── [Jan 4] sub2
└── [Jan 8] file5
Here is a one liner to generate that:
mkdir -p root/sub1 root/sub2 && touch -d '2018-01-08' root/sub2/file5 && touch -d '2018-01-04' root/sub2/ && touch -d '2018-01-01' root/sub1/file4 && touch -d '2018-01-02' root/sub1/file3 && touch -d '2018-01-06' root/sub1/ && touch -d '2018-01-07' root/file2 && touch -d '2018-01-03' root/file1 && touch -d '2018-01-09' root/
It can be listed with
tree -D
I'd like to change the timestamps on the three directories to be:
[Jan 8] root
├── [Jan 3] file1
├── [Jan 7] file2
├── [Jan 2] sub1
│ ├── [Jan 2] file3
│ └── [Jan 1] file4
└── [Jan 8] sub2
└── [Jan 8] file5
Note:
- The current timestamps on the directories are completely ignored and the new time stamps are set only based on the contents.
- Time stamps bubble up to multiple levels of parent directories.
The reason that I'm doing this is for a directory that gets copied with rsync. The directory is checked into git and could get rsynced from any place that has the repository checked out. To ensure that rsync is consistent and idempotent from the various places, I need to ensure that the time stamps and permissions of everything are in a known state. I already have a script that sets the timestamps of files based on when they were committed to git. I also have a script that sets the permissions on all files and directories to a known state. The only portion that I'm struggling with is bubbling time stamps from the files up to parent directories.
I would like one line or short script that I can run from the command line to set directory timestamps based on the timestamps of their contents.
Stephen Ostermiller
(1044 rep)
Jan 10, 2018, 11:45 AM
• Last activity: Jul 9, 2025, 08:04 AM
393
votes
12
answers
248432
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 the time being prefixed is the time at which the line was printed. How can I achieve this?
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 the time being prefixed is the time at which the line was printed. How can I achieve this?
anon
Dec 13, 2011, 11:49 AM
• Last activity: Jun 21, 2025, 01:25 PM
1
votes
1
answers
1925
views
ptpd won't start as a service
Now this really is getting me nuts. I installed `ptpd` on ubuntu 14.04 and it I just can't get this to work to run as a service. In `/etc/default/ptpd` I have the following entries: `START_DAEMON = yes` and `PTPD_OPTS = "-G -h -b eth0"` but that won't work. When I do `sudo ptpd -G -h -b eth0` by com...
Now this really is getting me nuts. I installed
ptpd
on ubuntu 14.04 and it I just can't get this to work to run as a service.
In /etc/default/ptpd
I have the following entries:
START_DAEMON = yes
and
PTPD_OPTS = "-G -h -b eth0"
but that won't work.
When I do sudo ptpd -G -h -b eth0
by command line then the program is starting fine.
I already tried to put ptpd -G -h -b eth0
into a batch file called usr/local/bin/start.sh
and start this file by /etc/rc.local
but that won't work too. The program is just not starting automatically.
Any kind of help is very appreciated.
Tecbill
(51 rep)
Nov 30, 2017, 02:54 PM
• Last activity: Jun 18, 2025, 06:06 PM
4
votes
3
answers
643
views
Why does stat show different timezones corresponding to different files?
I always thought that the timezone is not stored by the filesystem, and that stat would show times formatted with the current timezone of the user, and therefore if I do stat on various files *today* then the timezone should not change. However this answer https://unix.stackexchange.com/questions/11...
I always thought that the timezone is not stored by the filesystem, and that stat would show times formatted with the current timezone of the user, and therefore if I do stat on various files *today* then the timezone should not change. However this answer https://unix.stackexchange.com/questions/119323/stat-command-detail-information suggests the opposite! Different files appear with different timezones! Does anyone know why?
user324831
(113 rep)
Jun 11, 2025, 05:29 PM
• Last activity: Jun 13, 2025, 12:04 AM
2
votes
2
answers
6662
views
Convert/replace time from epoch milliseconds to human readable date in logfiles
I have a log file with the following structure ```none 1522693524403 entity1,sometext 1522693541466 entity2,sometext 1522693547273 entity1,sometext ... ``` Now I would like to replace the time from epoch milliseconds to `DD.MM.YYYY HH:MM:SS` in all of the log files with a bash command on a Debian Sy...
I have a log file with the following structure
1522693524403 entity1,sometext
1522693541466 entity2,sometext
1522693547273 entity1,sometext
...
Now I would like to replace the time from epoch milliseconds to DD.MM.YYYY HH:MM:SS
in all of the log files with a bash command on a Debian System.
I tried different solutions provided here and on other websites but it did not really work for me.
fastboot
(57 rep)
Dec 5, 2020, 02:30 PM
• Last activity: May 15, 2025, 11:29 AM
2
votes
1
answers
2379
views
How to get epoch time with trace-cmd (frontend for ftrace)?
-32578 [001] **133767.868869**: kfree: call_site=ffffffff810e6f06 ptr=(nil) How to make `trace-cmd` report time in epoch time? The time by default is I think time since application uptime. This is a requirement to pinpoint exact time of the event. `trace-cmd list -O` options doesn't help either.
-32578 **133767.868869**: kfree: call_site=ffffffff810e6f06 ptr=(nil)
How to make
trace-cmd
report time in epoch time? The time by default is I think time since application uptime. This is a requirement to pinpoint exact time of the event.
trace-cmd list -O
options doesn't help either.
themagicalyang
(191 rep)
Dec 12, 2016, 05:10 AM
• Last activity: May 2, 2025, 10:07 AM
0
votes
2
answers
81
views
How to programmatically deduplicate files into hard links while maintaining the time stamps of the containing directories?
Continuing https://unix.stackexchange.com/a/22822, how to deduplicate files, given as a list, into hardlinks, while maintaining the timestamps of their directories? Unfortunately, `hardlinks` changes the time stamps: ```sh $ mkdir d1 $ mkdir d2 $ mkdir d3 $ echo "content" > d1/f1 $ echo "content" >...
Continuing https://unix.stackexchange.com/a/22822 , how to deduplicate files, given as a list, into hardlinks, while maintaining the timestamps of their directories? Unfortunately,
hardlinks
changes the time stamps:
$ mkdir d1
$ mkdir d2
$ mkdir d3
$ echo "content" > d1/f1
$ echo "content" > d2/f2
$ echo "content" > d3/f3
$ ls -la --full-time d1 d2 d3
d1:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:26:18.624828807 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:26:07.397001442 +0200 ..
-rw-r--r-- 1 username username 8 2025-04-23 17:26:18.624828807 +0200 f1
d2:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:26:26.016715230 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:26:07.397001442 +0200 ..
-rw-r--r-- 1 username username 8 2025-04-23 17:26:26.016715230 +0200 f2
d3:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:26:29.296664852 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:26:07.397001442 +0200 ..
-rw-r--r-- 1 username username 8 2025-04-23 17:26:29.296664852 +0200 f3
$ hardlink -v -c -M -O -y memcmp d1/f1 d2/f2 d3/f3
Linking /tmp/d1/f1 to /tmp/d2/f2 (-8 B)
Linking /tmp/d1/f1 to /tmp/d3/f3 (-8 B)
Mode: real
Method: memcmp
Files: 3
Linked: 2 files
Compared: 0 xattrs
Compared: 2 files
Saved: 16 B
Duration: 0.000165 seconds
$ ls -la --full-time d1 d2 d3
d1:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:26:18.624828807 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:27:19.631893228 +0200 ..
-rw-r--r-- 3 username username 8 2025-04-23 17:26:18.624828807 +0200 f1
d2:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:28:45.922576280 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:27:19.631893228 +0200 ..
-rw-r--r-- 3 username username 8 2025-04-23 17:26:18.624828807 +0200 f2
d3:
total 4
drwxr-xr-x 2 username username 60 2025-04-23 17:28:45.922576280 +0200 .
drwxrwxrwt 29 root root 820 2025-04-23 17:27:19.631893228 +0200 ..
-rw-r--r-- 3 username username 8 2025-04-23 17:26:18.624828807 +0200 f3
As we see, two file have been replaced with hard links, which is good.
However, the time stamps of d2
and d3
have been updated. That's NOT what we want.
Ideally, we'd like to have a command that gets a list of files from
find /media/my_NTFS_drive -type f -size $(ls -la -- original_file| cut -d' ' -f5)c -exec cmp -s original_file {} \; -exec ls -t {} + 2>/dev/null
and converts them into hard links to original_file
. If the time stamps of the hardlinked files are to be the same, change them to the oldest among the time stamps of original_file
and its copies. The time stamps of the directories containing original_file
and its copies have to be retained. Clearly, all this has to be automated. (No question we can do it with manual inspection and touch
. From a user's viewpoint, it could be done with just another switch to hardlinks
. As the task seems rather standard, my hope is that in the past decades, someone has already written a standalone program, perhaps even a shell script.)
AlMa1r
(1 rep)
Apr 23, 2025, 03:38 PM
• Last activity: Apr 23, 2025, 06:49 PM
0
votes
0
answers
44
views
Changed behavior of sleep command in Linux suspend and resume testing
I am working on an embedded Linux system (kernel-5.10.220). Now I am testing the suspend and resume in this system with a watchdog time as the wakeup source to wake system up from suspend. The watchdog interrupt comes in every 5 seconds, and the script calls `sleep 10` to add 10 seconds delay betwee...
I am working on an embedded Linux system (kernel-5.10.220).
Now I am testing the suspend and resume in this system with a watchdog time as the wakeup source to wake system up from suspend.
The watchdog interrupt comes in every 5 seconds, and the script calls
sleep 10
to add 10 seconds delay between continous test.
And there is NO RTC in system!
Here is my testing script.
#!/bin/sh
trap ctrl_c INT
function ctrl_c()
{
echo "Exiting"
exit 0
}
count=0
sec=10
while [ true ]
do
echo ">>>>>>>>>>> Testing suspend $count"
echo mem > /sys/power/state
echo ">>>>>>>>>> Testing suspend 0
>>>>>>>>>> Testing suspend 1
>>>>>>>>>> Testing suspend 2
>>>>>>>>>> Testing suspend 3
>>>>>>>>>> Testing suspend 4
>>>>>>>>>> Testing suspend 5
>>>>>>>>>> Testing suspend 6
<<<<<<<<<<< Resumed after suspend
Thu Jan 1 06:33:12 UTC 1970
From the output of date
, the script did NOT delay 10 seconds between tests. The real interval of 10 seconds sleeping is about 2 or 3 seconds!
So why sleep 10
did NOT sleep for 10 seconds in the suspend and resume testing?
wangt13
(631 rep)
Apr 10, 2025, 01:14 AM
14
votes
4
answers
13019
views
Determine file system timestamp precision
File timestamps precision 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 filesystem info? The hacky alternatives I can think of are either to limit all my unit tests to secon...
File timestamps precision 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 filesystem info?
The hacky alternatives I can think of are either to limit all my unit tests to seconds (which I do now), or to
touch
a bunch of files and checking which digits are zero in stat -c %x
.
l0b0
(53368 rep)
Apr 19, 2011, 07:01 AM
• Last activity: Mar 30, 2025, 08:11 PM
8
votes
1
answers
2402
views
File has been changed, but its "date modified" is the same. How is that possible?
Here is a test file `test.applescript`: ``` display dialog "foo" buttons {"OK"} cancel button 1 default button 1 ``` At 4:05 PM I compiled it to `test.app`: ``` osacompile -o test.app test.applescript ``` At 4:07 PM I edited `test.applescript` by replacing `foo` with `bar`, and then compiled it agai...
Here is a test file
test.applescript
:
display dialog "foo" buttons {"OK"} cancel button 1 default button 1
At 4:05 PM I compiled it to test.app
:
osacompile -o test.app test.applescript
At 4:07 PM I edited test.applescript
by replacing foo
with bar
, and then compiled it again, overwriting the existing test.app
file. (It was overwritten successfully. If I run it, the dialog shows me "bar", not "foo".)
display dialog "bar" buttons {"OK"} cancel button 1 default button 1
osacompile -o test.app test.applescript
But nevertheless the date modified
value of test.app
is still 4:05 PM. Why is that? How is that possible?
Output of stat -x
:
File: "test.app"
Size: 96 FileType: Directory
Mode: (0755/drwxr-xr-x) Uid: ( 501/ john) Gid: ( 20/ staff)
Device: 1,17 Inode: 79429067 Links: 3
Access: Sun Mar 23 16:05:52 2025
Modify: Sun Mar 23 16:05:52 2025
Change: Sun Mar 23 17:20:48 2025
Birth: Sun Mar 23 16:05:52 2025
jsx97
(1347 rep)
Mar 23, 2025, 01:17 PM
• Last activity: Mar 23, 2025, 04:18 PM
3
votes
4
answers
1881
views
Full file date (without GNU utilities)
I am trying to obtain the full date (created or modified) of a particular file for passing to another program. I have tried variations of options with the ls command but none provide a full date for files less than 6 months old and I have limit usage of the options. When I try certain options I have...
I am trying to obtain the full date (created or modified) of a particular file for passing to another program. I have tried variations of options with the ls command but none provide a full date for files less than 6 months old and I have limit usage of the options. When I try certain options I have seen trying to research this I get the following message:
usage: ls [-1ACFHLNRabcdefgilmnopqrstuxEUX] [File...]
None of which seems to provide what I needs as far as I can tell so I tried to use the stat command but it is not available to me.
I am using the Korn shell on AIX 5.3 which has limited commands available, can anyone suggest another way that I might be able to obtain a file's created or modified date as a full date (either dd/mm/yyyy or yyyy/mm/dd).
Matt_Roberts
(141 rep)
Jan 15, 2016, 12:51 PM
• Last activity: Mar 8, 2025, 03:45 PM
4
votes
1
answers
5962
views
How rsync decides which files needs to be updated?
Right now I have these commands: my_dir="$HOME/foo/bar"; rm -rf "$my_dir/WebstormProjects/"; rsync -r --exclude=".git" --exclude="node_modules" "$HOME/WebstormProjects/" "$my_dir/WebstormProjects/" instead of removing everything in `"$my_dir/WebstormProjects/"` and then copying over, I am looking to...
Right now I have these commands:
my_dir="$HOME/foo/bar";
rm -rf "$my_dir/WebstormProjects/";
rsync -r --exclude=".git" --exclude="node_modules" "$HOME/WebstormProjects/" "$my_dir/WebstormProjects/"
instead of removing everything in
"$my_dir/WebstormProjects/"
and then copying over, I am looking to use rsync
such that it will only overwrite files in "$my_dir/WebstormProjects/"
if the files in "$HOME/WebstormProjects/"
are newer. So something like this:
my_dir="$HOME/foo/bar";
rsync -r --newer --exclude=".git" --exclude="node_modules" "$HOME/WebstormProjects/" "$my_dir/WebstormProjects/"
**is it possible to copy files only if they are newer than the destination files?**
I did some reading:
https://www.tecmint.com/sync-new-changed-modified-files-rsync-linux/
it says:
> By default, rsync only copies new or changed files from a source to
> destination...
I assume it does this by comparing relative file paths? Files with the same path/name are considered to be the same?
Alexander Mills
(10734 rep)
Aug 13, 2018, 10:35 PM
• Last activity: Feb 4, 2025, 11:53 AM
7
votes
5
answers
14221
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 contents, i.e. hashing the file before and after should yield the same result. Situation: I made the...
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 contents, i.e. hashing the file before and after should yield the same result.
Situation: I made the mistake of moving pictures and videos from the internal storage of my phone to an SD card using Android's stock tool to do so (‘Settings’ → ‘Storage’ → ‘Transfer data to SD card’). Unfortunately, this bumped the timestamps of all of the files, and also messed around with directories other than DCIM/
(pictures and videos were also moved from the Download/
, image/
, Pictures/
, and video/
directories). In hindsight it seems silly that I used such a tool (I'd normally use Ghost Commander ), but it appeared as a notification when running low on space and it just looked so easy. I'm now trying to piece back together the timestamps of various pictures and videos.
I'm effectively looking for a video equivalent to the following command , which I used to sort out the images in DCIM/100ANDRO/
:
exiv2 -T mv *.JPG
I skimmed through some FFmpeg documentation , but I see no mention of read-only commands or printing timestamps.
(Unfortunately for my situation, this approach does not offer a solution for files I didn't create, such as those in Download/
, for which I want to appear in the media collection in chronological order of when I obtained them.)
James Haigh
(739 rep)
Feb 24, 2014, 02:44 AM
• Last activity: Jan 8, 2025, 08:44 AM
0
votes
3
answers
189
views
How to show seconds of last modified date when using sftp command?
When I use WinSCP to access my SFTP server, it shows me the last modified (changed) date including seconds. If I use `sftp` on Linux and run `ls -l`, it only shows the hours and minutes, but no seconds. How can I also show the seconds using `sftp`, like WinSCP does it? I already checked the `sftp` m...
When I use WinSCP to access my SFTP server, it shows me the last modified (changed) date including seconds. If I use
sftp
on Linux and run ls -l
, it only shows the hours and minutes, but no seconds. How can I also show the seconds using sftp
, like WinSCP does it?
I already checked the sftp
man page and the ls
options there, but could not find a matching option.
me.at.coding
(3169 rep)
Dec 16, 2024, 07:45 PM
• Last activity: Dec 19, 2024, 04:46 PM
1
votes
1
answers
88
views
GNU `make`, modification times, leap seconds and NTP
GNU `make` relies on timestamps to see if a dependency was changed after some file was built. If you make a change during the leap second or an NTP adjustment, is it possible that `make` will believe the dependency is older than the built file when it really isn't? This would cause the file to never...
GNU
make
relies on timestamps to see if a dependency was changed after some file was built. If you make a change during the leap second or an NTP adjustment, is it possible that make
will believe the dependency is older than the built file when it really isn't? This would cause the file to never be rebuilt.
Tomek Czajka
(121 rep)
Dec 17, 2024, 08:38 PM
• Last activity: Dec 17, 2024, 08:58 PM
4
votes
3
answers
1354
views
Is there a reason why I can't use find to scan modified files for viruses and malware?
I need to scan Linux systems for viruses/malware, on the entire file system. There are few options to consider. - One is normally what users do: Use antivirus to scan system once a day. - The second option is to find files modified in last one day and give that list to antivirus program. I tested fo...
I need to scan Linux systems for viruses/malware, on the entire file system. There are few options to consider.
- One is normally what users do: Use antivirus to scan system once a day.
- The second option is to find files modified in last one day and give that list to antivirus program.
I tested following bash command
find
on directory with 5 million empty files, and it's extremely efficient.
date;find /test/ -type f -ctime -1 1>./find_ctime.out 2>./find.errors;date
It takes only about 5 seconds.
I am using -ctime
option just to overcome some program changing modification time using utility such as touch.
Most admins when they talk about a system scan, they talk about having antivirus do the complete scan.
Is there a reason why find should not be used to get a list of files modified and scan them?
EDIT: I have posted following question which _may_ have an answer to why no antivirus seems to use "find" based incremental approach: https://unix.stackexchange.com/questions/787940/is-there-a-way-to-use-linux-find-and-filter-if-specific-process-was-the-only-o
user1578026
(161 rep)
Dec 9, 2024, 04:27 AM
• Last activity: Dec 13, 2024, 07:21 PM
0
votes
0
answers
41
views
Is there a way to use linux "find" and filter if specific process was the only one accessed it?
I am trying to find out a way to do incremental antivirus scan. My current approach under evaluation is using "find". You can see relevant question here: https://unix.stackexchange.com/questions/787860/is-there-a-reason-why-i-cant-use-find-to-scan-modified-files-for-viruses-and-ma/ Please note - the...
I am trying to find out a way to do incremental antivirus scan. My current approach under evaluation is using "find". You can see relevant question here: https://unix.stackexchange.com/questions/787860/is-there-a-reason-why-i-cant-use-find-to-scan-modified-files-for-viruses-and-ma/
Please note - the question already posted above is using modified time but I found out that clamav scans files even if it is accessed or opened not just modified.
The antivirus in question is clamav. Clamav, just like every other AV has option of on access scanning i.e. it would scan a file as soon as it's **acccessed** or **opened**. That means I have to change\use command:
find /test/ -type f -atime -1 1>./find_ctime.out 2>./find.errors
Unfortunately I cannot use clamav "On Access Scanning" feature - one reason being it's too heavy on system.
If I use "find" this is a problem I run into:
- I start first scan at 12:00 midnight on 10 files.
- When I use "find" next day at 12:00 midnight, I have to give start time at 12:00 midnight previous day. I cannot given start time when scan was finished to find
because that would leave system vulnerable.
- Problem with this approach is, it would include 10 files clamav (clamscan) accessed yesterday.
- I cannot blindly exclude yesterday's list, __even if__ access timestamp was in yesterday's scan window because that will make system vulnerable, even though chances are very small.
- and the cycle will repeat next day and so on until it would include ALL files on the system.
So I wanted to exclude a file if **only** clamscan\clamdscan has accessed it since last scan. I used stat
and do not see any relevant field in output. I also searched in find
documentation but I could not find it.
Is there a way to use linux "find" and filter if specific process was the only one accessed it?
Thanks in advance!
user1578026
(161 rep)
Dec 11, 2024, 04:49 AM
30
votes
10
answers
23668
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][1] for blogging, which uses plain text files in `~/bloxsom` as source of all articles. The article date (and therefore order of appearence) is based on modification...
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 of all articles. The article date (and therefore
order of appearence) is based on modification date of the text file. I don't
want article pop up like if it's *new* whenever I just fix a typo. (I do *lots*
of them... :D)
So far, vim changes timestamp and the original stamp is lost forever. This is
OK and I want to keep it that way for most of files on the system. But I don't
want that for the blog files - I can always touch
the file if I need.
Any ideas on how to tweak vim into this behavior?
Alois Mahdal
(4598 rep)
Jul 15, 2012, 05:05 PM
• Last activity: Dec 7, 2024, 07:12 PM
4
votes
1
answers
329
views
ISO 8601 intervals in date arithmetic with date command
I can make some date arithmetic with `date` command like ``` $ date -u -d '3 days 2024-12-01T00:00:00Z' +%FT%H:%M:%SZ 2024-12-04T00:00:00Z $ ``` The `date` command can parse quite a lot of date formats, including ISO-8601 formats. Is there an easy way to make it to interpret also ISO-8601 intervals?...
I can make some date arithmetic with
date
command like
$ date -u -d '3 days 2024-12-01T00:00:00Z' +%FT%H:%M:%SZ
2024-12-04T00:00:00Z
$
The date
command can parse quite a lot of date formats, including ISO-8601 formats.
Is there an easy way to make it to interpret also ISO-8601 intervals? Naive approach fails...
$ date -u -d 'PT3D 2024-12-01T00:00:00Z' +%FT%H:%M:%SZ
date: invalid date ‘PT3D 2024-12-01T00:00:00Z’
$
Roux
(143 rep)
Dec 1, 2024, 08:00 PM
• Last activity: Dec 2, 2024, 12:09 PM
Showing page 1 of 20 total questions