In Bash, you can get the date and time using the command date. You can use it to form a more or less unique filename. Here is the code. date_string=$(date +"%Y-%m-%d.%0k.%M.%S") echo ${date_time} Output 2019-06-17.14.16.54 Linux, Bash About the author Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.