You have no excuses now, use this free credit to launch your projects now on Digital Ocean.
Table of contents
How to find a previously executed command in GNU Linux?
How to find a previously executed command in GNU Linux?
Sometimes we execute commands that solve a specific task on our system. We may have done a file lookup using regular expressions or perhaps we accessed a server via ssh and no longer remember the IP address. Re-creating the regular expression from scratch can be very time consuming and perhaps finding the IP again can also be more time consuming than if we could simply retrieve the command. We can find a previously executed command in GNU/Linux in a simple way, here is how.
One way to do this would be to perform a search for the part of the command that we remember in the command history. This can be done as follows:
history | grep "comando que buscamos"
The history command will show the list of commands used, the pipe character “|” will redirect the result to the grep command, which will search for the string you specify.
How to kubernetes?
AdIf you're looking to learn Docker so you can work as a devops engineer or as the basis for learning kubernetes, you need to learn network fundamentals, git and github (to track your k8s yml files), containers and docker, I've written a few entries on them, but if you're going serious, why don't you invest a few bucks on an online course (like educative's devops path) and a certificate and get rid of all the hassle of looking for free courses here and there
Command CTRL + R
There is an even simpler way to perform this search. This method is a keystroke combination that, despite its simplicity and ease of use, is not very popular, even among regular users of GNU/Linux environments.
First we will open a terminal, then we will press CTRL + R, this will modify the cursor as follows:
(reverse-i-search)`': history
As we press the keys, the commands that match that search will appear. If the command we are looking for is in the ~.history file, it will be displayed instantly.