8

I accidentally cleared my screen and I need to see my previous output, any way to see output/results of previous commands? I understand that I can see my past commands using history command but I am not looking for that

1 Answers1

2

You can use !!. This command prints the output of the last command you ran. For example:

me@dev:~$ cat test.txt
This is the test file.

And i cleared my screen.. Then i ran the !! command. And output is here:

me@dev:~$ !!
cat test.txt
This is the test file.

Look here for more..

NOTE: You shouldn't use clear while clean your screen, instead you should use Ctrl+L because terminal remembers clear as the last command.

myrn
  • 31
  • 4