Forrest logo
back to the faketime tool

faketime:tldr:54fad

faketime: Fake the time to this evening, before printing the result of `date`.
$ faketime '${today 23:30}' ${date}
try on your machine

This command uses the faketime utility to run a command with a specific faked date and time. Let's break it down:

  • faketime: This is the utility that allows you to fake the system time while executing a command.

  • ${today 23:30}: This is a special syntax used to represent the current date and time in the format "YYYY-MM-DD HH:MM". ${today} is a command that retrieves the current date and time, and 23:30 sets the time to 11:30 PM.

  • ${date}: This is a placeholder representing the command that you want to run with the fake time. It can be replaced with any other command or script you want to execute.

So, when you run the command faketime '${today 23:30}' ${date}, the faketime utility will execute the command represented by ${date}, but the system time will be faked to the date and time specified in ${today 23:30}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the faketime tool