Skip to content

benavern/z-alias

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

Z-ALIAS

Edit your bash aliases the funny way

npm

About

This project provides an easy solution for using aliases from your command line. z-alias solves the hassle of remembering how to create / edit / delete your aliases.

Install

npm i -g z-alias

Usage

z-alias -h
  Usage:
    $ z-alias [options] [arguments]

    Options:
    --list, -l    List all aliases
    --open, -o    Open aliases file in your favorite editor
    --search, -s  Search in aliases
    --add, -a     Add an alias
    --edit, -e    Edit an alias
    --remove, -r  Remove an alias

    --help, -h    Display help
    --version, -v Print z-alias version

  Examples:
    $ z-alias -l
    $ z-alias -o
    $ z-alias -s [<searchTerm> <searchTerm2> ...]
    $ z-alias -a [<aliasName> "<aliasCommand>"]
    $ z-alias -e [<aliasName> "<aliasCommand>"]
    $ z-alias -r [<aliasName> <aliasName2> ...]

  Configuration:  
    * To change the path of the aliases file, paste and adapt this line
      at the end of your .bashrc file.

      export Z_ALIAS_FILE=~/.bash_aliases
  
    * To make your aliases available in all new shells paste this line
      at the end of your .bashrc file (adapt if above line has been added).

      if [ -f ~/.bash_aliases ]; then source ~/.bash_aliases; fi

Config

In your ~/.bashrc, ~/.zshrc, ...

Change aliases file path

If not set, defaults to : ~/.bash_aliases

# Change aliases file path
export Z_ALIAS_FILE="/path/to/aliases"

Make your aliases available on all shells

Add that block at the end or your .bashrc or .zshrc file.

# Make aliases available
if [ -f ~/.bash_aliases ]; then source ~/.bash_aliases; fi

About

Edit your bash aliases the funny way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published