• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

faketime: command not found

by Deepika

“faketime” is a command-line tool in Linux-based systems that allows a user to run a command with a fake system time. This means that the command will see a different system time than the actual one, allowing the user to test how the command behaves under different time conditions.

faketime works by intercepting calls to the system time functions and replacing the actual time with a fake time. The fake time can be specified in various ways, such as a specific date and time, or a relative offset from the current time. For example, you can use faketime to test how a program behaves when the system time is set to a specific date in the past or future, or to test how a program handles leap years or daylight saving time changes.

It is important to note that faketime does not change the system time, it only changes the time seen by the command it runs. This means that other programs and processes running on the system will still see the actual system time. Also, faketime does not affect the hardware clock or the system time in any way. It only affect the time returned by time() and similar functions.

If you encounter the below error while running the command faketime:

faketime: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install faketime
Ubuntu apt-get install faketime
Arch Linux pacman -S faketime
Kali Linux apt-get install faketime
Fedora dnf install faketime
OS X brew install faketime
Raspbian apt-get install faketime

faketime Command Examples

1. Fake the time to this evening, before printing the result of `date`:

faketime 'today 23:30' date

2. Open a new `bash` shell, which uses yesterday as the current date:

faketime 'yesterday' bash

3. Simulate how a program would act next Friday night:

faketime 'next Friday 1 am' path/to/program

Filed Under: Linux

Some more articles you might also be interested in …

  1. cabal: Command-line interface to the Haskell package infrastructure (Cabal)
  2. ddcutil: command not found
  3. flock: command not found
  4. register_new_matrix_user: command not found
  5. zip Command Examples in Linux
  6. File Access Commands in Linux – find, sort, head, tail
  7. How to identify the HBA cards/ports and WWN in Linux
  8. lumen Command Examples
  9. which: command not found
  10. as: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright