How to get the mtime of a file on Linux from the file’s path? You can use stat to get the file status including the mtime: %y time of last modification, human-readable %Y time of last modification, seconds since Epoch As an example, $ stat -c %y ./file 2017-06-26 13:33:06.764042064 +0800 $ stat -c %Y ./file 1498455186 Read more: How to get a path’s mtime in C++ on Linux? How to get a FILE pointer from a file descriptor and how to get a file descriptor from a FILE pointer in C on Linux? How to redirect anything written on a file to another file in linux? How to test whether a file exists and is a block special file in Python on Linux? How to convert a ps file to a pdf file How to detect whether a file is being written by any other process in Linux? How to calculate the average of value in lines of a text file on Linux by a script? How to make a unique temporary file in Bash on Linux?