By default do terminal commands get logged?

I wanted to know if by default, does anything you enter into the terminal get logged somewhere in your system. I can imagine that to a certain degree it does because you can use the up and down arrows to recall commands entered, but acts similar to how RAM works in a computer, where once you close the terminal the commands are lost/removed? Or is there someone where within the computer that they are still being kept?

Answer

short: no

long: It depends:

  • most shells have a history mechanism which records command-lines.
  • shell-history usually is configurable (and may not be activated).
  • But things like text-editors generally do not (your keystrokes are not logged—usually)

Also, even with shells, it is not common to be able to have multiple instances of shells running and record all of the commands from these instance.

Besides shell-history, there are other ways to record your commands, e.g., using low-level auditing programs (which record the resources which your commands use), or text-only things like script (which can record all of the information sent from the computer to the terminal).

Even if your shell is not configured to record commands, you may work in an environment where auditing is configured. For those “by default”, there is a record.

Further reading:

Attribution
Source : Link , Question Author : TheHarpoon , Answer Author : Community

Leave a Comment