A
A
Anastasia2021-08-08 20:47:19
linux
Anastasia, 2021-08-08 20:47:19

Is it possible to know what commands I sent to Ubuntu 20?

Hello. I'm setting up a VPS here, or rather I'm trying ... At least to understand how it's done ... In short, I accidentally closed the console. Is it possible to somehow raise the history of the commands that I did?

Well, if the console was still open. It would be possible through the "up arrow" to simply rewrite all the commands. What if everything is closed? In general, information about the entered commands is stored somewhere?

I tried history , but it only showed me the commands of the current session, and the previous ones did not.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2021-08-08
@nastya97core

If the session was terminated, then the history will not be saved.
The history of commands entered in bash is stored in ~/.bash_history
To prevent such excesses from happening, use tmux

K
Karpion, 2021-08-08
@Karpion

It depends on which shell was accepting the commands. For example, when working through Deco Commander, upon exiting the shell program, the command history is cleared. But shells like bash or csh store the command history in a file, the details depend on the settings.

D
Drno, 2021-08-08
@Drno

there is a .bash file in the root of the user folder, something there ... (on a VPS, of course) there is a history of commands in it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question