Skip to content

andrew1044/bash-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Alias

Folders are for different environments. The shared folder containes all the useful aliases.

Folder Env Description
shared all Shared alias's for all envs
aws-ap1 windows6 box windows dev box alias

Cloning

This is a bare repository, use the following command to clone as required

git clone --separate-git-dir=~/.myconf /path/to/repo ~

Sourcing files

Add the following to .bashrc/.zshrc

Individual file

[[ ! -f ~/path/to/file ]] || source ~/path/to/file

Directory

Recursive sourcing multiple files in multiple directories

# Define array of directory paths
ALIAS_DIRS=(
    /path/to/dir1
    /path/to/dir2
    /path/to/dir3
)

export WERK="/mnt/work/"
for ALIAS_DIR in "${ALIAS_DIRS[@]}"; do
  if [ -d "$ALIAS_DIR" ]; then
    for file in "$ALIAS_DIR"/*; do
      if [ -f "$file" ]; then
        # echo "sourcing $file" # testing
        . "$file"
      fi
    done
  else
    echo "$ALIAS_DIR directory does not exist..."
  fi
done

SSH public key not working

ensure ssh agent is working

eval `ssh-agent -s`

add ssh key

ssh-add ~/.ssh/<ssh_key.key>

About

Bash aliases for extra fun

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages