brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: find -newer lists everything changed since a reference file

Find
~/tips/tip-find-newer-reference-file

find /etc -type f -newer /tmp/before-upgrade

Lists the files modified after the moment of a reference file.

A timestamp file marks a moment, and find can compare against it. That works without any date maths.

touch /tmp/before-upgrade
# ...do the upgrade...
find /etc -type f -newer /tmp/before-upgrade

-newer FILE matches files whose modification time is later than that of the reference file. It is a clean way to see which config files an installer touched, or which files a backup job needs to copy. The reference file can be any existing file, for example the last backup archive. -anewer and -cnewer test the access time and the status change time of each file against the modification time of the reference.

Further reading: find manual page

More Find tips find / -maxdepth 1 -fstype proc find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/null find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} + find /srv/data -depth -print find /srv -xdev -samefile /srv/downloads/movie.mkv All Find tips (46) All topics

Link