4 ms·
history | sed 's/^ *[0-9]* *//' > commands.sh vi commands.sh (edit the file to only include your big nasty command lines, then comment them all out)
by jedberg 3y ago
history | sed 's/^ *[0-9]* *//' > commands.sh
vi commands.sh
(edit the file to only include your big nasty command lines, then comment them all out)
chmod +x commands.sh
Now every time you want to run a command, you just uncomment that line. If it needs changes, you can copy the line, change it, and now you have another command. You can even add comments to help you remember what each command is for.
- bomewish 3y agoWow this is kinda elegant. An improvement I can think of is putting it on your PATH so you can just invoke “commands” directly each time?