It is my handy helper to work with shell aliases. I've created this project to get some practice with Go, so it is not some serious program, but still can be usefull for you.
shell-alias help
Print a little help information to standard out
shell-alias list
Print a list of aliases you have in name=command format.
shell-alias add --name="" --command=""
Add new alias with name and command provided.
shell-alias delete --name=""
Delete existing alias from.
Program will auto detect .shellrc file in your home directory: first it will try to find .zshrc (for Mac users), then it goes to find .bashrc.
If one of them here, working with it.
If no one here, program will ask you for name of .shellrc file you want to create, and then create it for you.
Also you can force path of your .shellrc file by providing it via --path parameter to each command (list, add, delete).
- ssh:
git clone [email protected]:Seokky/shell-alias.git
- https:
git clone https://github.com/Seokky/shell-alias.git
go build
go install
Discover the Go install path, where the go installed the package
go list -f '{{.Target}}'
It will print something like /Users/<username>/go/bin/shell-alias.
Copy this output.
Then open your shell rc file. Probably is:
- MacOs:
nano ~/.zshrc
- Linux:
nano ~/.bashrc
Add this line to the end of file:
PATH="$PATH:*/Users/\<username\>/go/bin/shell-alias*"
Press ctrl+X, then Y, and Enter to save changes.
Then run in shell:
- MacOs:
source ~/.zshrc
- Linux:
source ~/.bashrc
Now you can use shell-alias
!