我想在LinuxBash中判断一个文件是否是在超过x次之前创建的.
假设该文件名为text.txt,时间为2小时.
if [ what? ]
then
echo "old enough"
fi
我想在LinuxBash中判断一个文件是否是在超过x次之前创建的.
假设该文件名为text.txt,时间为2小时.
if [ what? ]
then
echo "old enough"
fi
仅限修改时间
if test `find "text.txt" -mmin +120`
then
echo old enough
fi
您可以使用-cmin
表示更改,或使用-amin
表示访问时间.正如其他人指出的,我认为你无法追踪创作时间.