rem is a small tool for remembering things on the command line. It can be used to store commands and execute them later on. Or to simply store lines of text.
$ rem [flags] command [argument]
- -h, help - Shows this help.
- -a, add [string] - Adds a command/text.
- rm [index] - Removes line with given index number.
- echo [index] - Displays line with given index number.
- -f, filter [regexp] - Filters stored commands by given regular expression.
- here - Creates a .rem file in the given directory. Default: ~/.rem
- clear - Clears currently active .rem file, ./.rem or ~/.rem
- [index|tag] - Executes line with given index number / tag name.
- -g - Use global rem file ~/.rem
- -t - Tag for command when adding with -a/add.
- -p - Print command to stdout before executing index/tag.
Run rem without any arguments to list all stored commands/strings.
$ go get github.com/mborho/rem
On Linux you can install a released binary directly:
$ sudo wget https://github.com/mborho/rem/releases/download/v0.15.0/rem_0.15.0_linux_amd64 \
-O /usr/local/bin/rem && sudo chmod +x /usr/local/bin/rem
See releases for the specific binary (amd64, arm, arm64) to use.
Create a local .rem file in the directory you are in:
$ rem here
Remember commands:
$ rem add ls -la
$ rem add mysqldump -u name -h 172.17.42.1 -P 49176 -p demo-db
List commands stored:
$ rem
0 ls -la
1 mysqldump -u name -h 172.17.42.1 -P 49176 -p demo-db
Execute ls -la (listnumber 0)
$ rem 0
insgesamt 12
drwxrwxr-x 2 martin martin 4096 Dez 5 14:41 .
drwxrwxr-x 6 martin martin 4096 Dez 5 14:33 ..
-rw------- 1 martin martin 60 Dez 5 14:42 .rem
You can also use parenthesis like $(pwd) or operators like && or pipes |. If neccessary usse quotes to escape when adding a command.
$ rem -t count-lines -a 'cat $HOME/.bashrc | wc'
$ rem count-lines
179 709 6053
Remove a command:
$ rem rm 1
psolbach for the name rem!
GPLv3 - see LICENSE