Yesterday I wanted to use again ffmpeg to make a screencast and couldn't remember exactly the complete command that suited my needs (video, audio format, etc.). I knew you had used it at some point but couldn't remember the entire command, with all its (endless) parameters. The solution? Find the way attempting in the historial de commands entered in the terminal. |
The «history» command allows you to list the history of all the commands entered in the terminal. To filter the results we can combine it with the grep command as follows:
history | grep ffmpeg
This will list all the commands you have entered that contain the word "ffmpeg" somewhere. This is precisely what I was looking for.
Another very useful method is to press "Ctrl + R" and type the word you want to search for. The difference with the previous method is that it will search for the last command entered that contains that word, not all.
I am more of CTRL + R (I imagine that for convenience); As some of the colleagues who have commented indicate: just press it several times until we find the command we are looking for 😉
Thanks for the information. Sometimes commands that seem too simple save your day. Especially when you have typed dozens and dozens of lines. Greetings from Zapatista lands in resistance.
Thank you very much for your post, it helped me a lot, I just have one question, once I have the PID I needed, how can I execute that PID? thanks