Skip to content
/ rem Public

rem is a small tool for remembering things on the command line.

License

Notifications You must be signed in to change notification settings

mborho/rem

Repository files navigation

rem - remember

Go Coverage Status rem

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.

Usage

$ rem [flags] command [argument]

Commands

  • -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.
  • edit [index] - Opens default editor in $EDITOR for editing a command.
  • -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.

Flags

  • -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.

Install

$ go get github.com/mborho/rem

Install binary

On Linux you can install a released binary directly:

$ sudo wget https://github.com/mborho/rem/releases/download/v0.17.0/rem_0.17.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.

Snap package

Get it from the Snap Store

Examples

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

Demo

asciicast

Thanks

psolbach for the name rem!

License

GPLv3 - see LICENSE

About

rem is a small tool for remembering things on the command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages