Celeb Glow
general | March 20, 2026

Undoing all the terminal commands in the last 24 hours?

I am very new to Linux. I followed a seemingly long guide that explains how to establish a LAMP-based Drupal-dev environment via the Ubuntu terminal. This installation guide includes many commands, that also makes uses of symbolic links, mv's of files, etc, and I seem to did a few mistakes in the way.

Can I undo every action I did in the terminal in the last 24 hours somehow? It seems this is my last option before formatting the Virtual machine (an action I would be very glad not to take)...

I just want to start all over again with another guide...

2

1 Answer

You can't directly undo a command. Unfortunately, Linux does not support this feature.

You can use the command history to list all the previous commands you used.

You have to find the reverse command for all of them (e.g. if you invoked a command sudo apt-get install you have to invoke a sudo apt-get purge).

Unfortunately, not all command have a simple reverse command (e.g. if you run a sudo apt-get upgrade you should find out all the updated packages and downgrade them).

My suggestion is to find out a way to clean the actual situation, for instance, you can try to delete all the packages that you installed. If you want to be sure that you're in a completely clean situation, you have to format the VM.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy