How do I find all the files that were created today in Unix/Linux?

后端 未结 11 669
梦谈多话
梦谈多话 2020-12-24 00:21

How do I find all the files that were create only today and not in 24 hour period in unix/linux

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 01:02

    After going through may posts i found the best one that really works

    find $file_path -type f -name "*.txt" -mtime -1 -printf "%f\n"
    

    This prints only the file name like abc.txt not the /path/tofolder/abc.txt

    Also also play around or customize with -mtime -1

提交回复
热议问题