get timestamp in script code example Example: get current timestamp shell // If you want to get unix timestamp, then you need to use: timestamp=$(date +%s)