My personal method is to type "ffmpeg" and then hit Ctrl+R repeatedly until I make it to the last time I used it to do what I want to do again now, and then adapt the command from history to my current needs.
It's not very efficient, but I don't feel it needs to be, and it requires no particular setup (except setting Bash to keep history forever but that's something useful I would do anyway for other use cases).
I've found this is much more efficient if I add a comment at the end of the command describing what it does, then my C-r search can find that description, rather than just, say, any command in invoking some particular executable.
Why not do `history | grep ffmpeg`? Each line will be prefixed with its place in the history ("445 ffmpeg --whatever") and you can just press `!445` to run it.
Ah, yes. This served me fairly well for some time. However, I also needed to remember the actual tool I used for the job. Was it ffmpeg? ffprobe? gifsicle? was it ImageMagick's convert? Not too bad if these are the only tools, but I also use pandoc, BluetoothConnector, pdftotext, qpdf, multiple AppleScripts, qrencode, system_profiler, fb-rotate, duti, sips, git... Bash history also remembers failed attempts, so I need to filter those out as I recall the successful one...
Wrapping the winning command with a memorable function makes it a bit easier for me to recall the right incantation via fuzzy searching. For example: "set default" (resolves to dwim-shell-commands-macos-set-default-app) vs "duti" (which I can never remember).
Essentially, you just mark the code blocks with `:script name`, and then can list or execute the block from a terminal. This also keeps the script in context within whatever other notes you had on the topic, when you were figuring it out etc. And if something turns out to be a useful snippet, you move it out to an actually separate script. :)
I use Typinator expansions with the input video path (from the clipboard) as a variable to perform common ffmpeg operations, such as downsize, speed up, extract audio, strip audio, export frames to create GIF animations, or encoding as MP4.
Typinator lets you use what's on the clipboard but also add scripting (say, Python or JavaScript) when certain parameters need to be calculated, like sizes or names.
[+] [-] p4bl0|3 years ago|reply
It's not very efficient, but I don't feel it needs to be, and it requires no particular setup (except setting Bash to keep history forever but that's something useful I would do anyway for other use cases).
[+] [-] Y_Y|3 years ago|reply
[+] [-] tempodox|3 years ago|reply
A line like
only shows history entries that start with the current text when you hit cursor-up, for instance.[1] https://www.gnu.org/savannah-checkouts/gnu/bash/manual/html_...
[+] [-] gumby|3 years ago|reply
[+] [-] xenodium|3 years ago|reply
Wrapping the winning command with a memorable function makes it a bit easier for me to recall the right incantation via fuzzy searching. For example: "set default" (resolves to dwim-shell-commands-macos-set-default-app) vs "duti" (which I can never remember).
[+] [-] dceddia|3 years ago|reply
It stores shell history in a SQLite database and you can use Ctrl+R to fuzzy search it.
[+] [-] m463|3 years ago|reply
As a matter of fact, I automatically (subconsciously) type control-r before every command.
I think I've only ever typed this command once:
[+] [-] BeetleB|3 years ago|reply
[+] [-] taviso|3 years ago|reply
https://github.com/denisidoro/navi
[+] [-] BeetleB|3 years ago|reply
[+] [-] markusl2ll|3 years ago|reply
Essentially, you just mark the code blocks with `:script name`, and then can list or execute the block from a terminal. This also keeps the script in context within whatever other notes you had on the topic, when you were figuring it out etc. And if something turns out to be a useful snippet, you move it out to an actually separate script. :)
[+] [-] nonoesp|3 years ago|reply
Typinator lets you use what's on the clipboard but also add scripting (say, Python or JavaScript) when certain parameters need to be calculated, like sizes or names.
[+] [-] patchtopic|3 years ago|reply
https://www.youtube.com/watch?v=9kaIXkImCAM