Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stavshamir/bag
bash alias generator
https://github.com/stavshamir/bag
alias aliases aliasing bash java
Last synced: 3 months ago
JSON representation
bash alias generator
- Host: GitHub
- URL: https://github.com/stavshamir/bag
- Owner: stavshamir
- License: mit
- Created: 2018-06-04T07:15:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-10T11:34:32.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T05:38:08.129Z (4 months ago)
- Topics: alias, aliases, aliasing, bash, java
- Language: Java
- Size: 62.5 KB
- Stars: 42
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bag - Bash Alias Generator
This tool suggests aliases based on non-aliased frequently used commands, and provides a painless way to apply them.
## Build
1. Run:
```bash
$ ./gradlew fatJar
```
2. Create a home directory for the application
3. Into the home directory, copy the files install.sh, build/libs/bag-1.0-SNAPSHOT.jar and build/resources/main/alias.sh
4. From the home directory, run:
```bash
$ source install.sh
```## -OR- Download from [here][zip] and install:
1. Unzip
2. From the unzipped directory, run:
```bash
$ source install.sh
```## Usage:
```bash
bag [-c [-a ]]
-a,--alternative create an alias with an alternative name
-c,--create create an alias with the suggested name
-h,--help print usage
-l,--print-all print a list of all suggested aliases
-p print a list of suggested aliases
```
*The new aliases become available after restarting the shell.*## Examples:
1. Printing a list of suggested aliases
```bash
$ bag -p
SUGGESTED COMMAND TIMES USED
(1) fab foo -a -b -c 42
(2) bde bar -d -e -f 5
```2. Creating a suggested alias
```bash
$ bag -c 1
New alias was created: alias fab='foo -a -b -c'
```3. Creating a suggested alias with an alternative name
```bash
$ bag -c 2 -a bam
New alias was created: alias bam='bar -d -e -f'
```[zip]: https://github.com/stavshamir/stavshamir.github.io/blob/master/deployed/bag.zip?raw=true