coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the best way to touch a file and set its time of the last ti


From: Andreas Schwab
Subject: Re: What is the best way to touch a file and set its time of the last time of a bunch of other files?
Date: Fri, 07 Aug 2015 11:09:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> Peng Yu <address@hidden> writes:
>
>> Hi, `touch -r` allows one to set the time of a file same as a
>> reference file. What if one wants to set the time to be the last time
>> of multiple files? Is there an easy way to do so?
>
> $ touch -d @$(stat -c %s $files | sort -n | tail -n1) $file
                        %Y

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]