Creating Permanent Aliases in Linux.

J

john2025

Guest
Aliases allows you to do a mapping between a command and other. They allow to shorten long commands. Most shells like Zsh and Bash support bash aliases.
I. Bash Shell
The best method to make a separate aliases file, so you won't have to put them in ~/.bashrc, but to a file of your choice.
First, edit your ~/.bashrc file and add the following lines if they don't already exist, or uncomment them if they do:
- By default ~/.bashrc contains that inclusion -

if [ -f ~/.bash_aliases ]; then​
. ~/.bash_aliases​
fi​
II. Zsh Shell
Edit ~/.zshrc and add the following lines if they don't already exist, or uncomment them if they do:

if [ -f ~/.zsh_aliases ]; then​
. ~/.zsh_aliases​
fi​
i- for Bash Shell: run

sudo gedit ~/.bash_aliases​
or
ii- for Zsh Shell: run

sudo gedit ~/.zsh_aliases​

In that new file add your aliases. Here are some practical aliases developers and sysadmins often use:

# My custom aliases​
# Highlight the current day in cal​
alias cal='ncal -C'​
alias cls='clear'​
alias dir='dir --color=auto'​
alias egrep='egrep --color=auto'​
alias fgrep='fgrep --color=auto'​
alias grep='grep --color=auto'​
alias l='ls -CF'​
alias la='ls -lha'​
alias ld='sudo systemctl daemon-reload'​
alias ll='ls -alF'​
alias ls='ls --color=auto'​
# restart linux​
alias res='sudo shutdown -r now'​
# shutdown linux​
alias shut='sudo shutdown -h now'​
# To see the status of all services, run this command​
alias all='sudo systemctl list-units --type=service'​
# Possible values for --state= are active, running, stopped, enabled, disabled and failed.​
alias act='sudo systemctl list-units --type=service --state=active'​
alias fail='sudo systemctl list-units -all --state=failed'​
alias test='sudo systemctl --failed || sudo systemctl list-units --state failed'​
# For daily tasks aptitude update and aptitude upgrade should be all you need. If you're upgrading to a major release aptitude full-upgrade will do what you want.​
alias un='sudo aptitude update && sudo aptitude full-upgrade -y'​
alias unlock='sudo dpkg --configure -a || sudo service packagekit restart'​
alias up='sudo apt clean && sudo apt update'​
alias upev='sudo apt clean && sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y'​
alias vdir='vdir --color=auto'​
# Navigate up a parent directory using cd followed by number​
alias cd1='cd ..'​
alias cd2='cd ../..'​
alias cd3='cd ../../..'​
alias cd4='cd ../../../..'​
alias cd5='cd ../../../../..'​

save and exit. Once you save your edits, they won’t take effect immediately. For this, you must reload the configuration using the source command, by running:
source ~/.bash_aliases
or
source ~/.zsh_aliases
 

Attachments



My .bash_aliases
Code:
# Start gomuks Matrix Client
alias gomuks=/home/craig/.local/bin/gomuks

#yt-dlp
#alias yt-dlp="/home/craig/.local/bin/yt-dlp"

# snap update
alias refresh="sudo snap refresh"

# flatpak update
alias flatup="flatpak update"

# https://github.com/chubin/cheat.sh#installation
alias cheat="/home/craig/.local/bin/cht.sh"

# walk: Terminal File Manager
# https://github.com/antonmedv/walk
alias walk="walk --icons"

# Onelinershell https://github.com/Onelinerhub/shellhub
alias oh="/home/craig/.local/bin/oh.sh"

# ls command with a lot of pretty colors
# https://github.com/lsd-rs/lsd
alias ls='lsd'

# Show open ports
alias ports='sudo netstat -tulanp'

# Refresh .bashrc
alias bashrc="source ~/.bashrc"

# become root #
alias root='sudo -i'
alias su='sudo su'

# Fix which
#alias which='command -v'

# APT User Commands
alias search='apt search'
alias file='apt-file search'
alias policy='apt policy'
alias show="apt show"
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
alias update='sudo apt --update full-upgrade'
alias ainstall='sudo apt install'
alias apurge='sudo apt purge -y --autoremove'
alias upgrade='sudo nala upgrade'
alias aremove='sudo apt autoremove -y'
alias clean='sudo apt clean'
alias apt-backports='sudo apt install -t trixie-backports'
alias apt-testing='sudo apt install -t testing'
alias reboot='sudo reboot'
alias shutdown="sudo shutdown -P now"
fi

# Handy-dandy aliases for journalctl and systemctl
alias jc='sudo journalctl -b'
alias jca='sudo journalctl'
alias jcf='sudo journalctl -f'
alias jcr='sudo journalctl --list-boots'
alias sc='sudo systemctl'

# Making files immortal & executable
alias im+="sudo chattr +i"
alias im-="sudo chattr -i"
alias exe="sudo chmod +x"

#Add safety nets
# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'

# copy the current working directory to the clipboard
alias cpwd='pwd | xclip -selection clipboard'

# Clipboard
alias cpy="xclip -selection clipboard"

# quick directory movement
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# go to the last directory you were in
alias back='cd $OLDPWD'

# quickly find files and directory
alias ff='find . -type f -name'
alias fd='find . -type d -name'

# Create Python virtual environment
alias ve='python3 -m venv  --system-site-packages ./venv'
alias va='source /home/craig/Projects/venv/bin/activate'
#alias va='source ./venv/bin/activate'

# Ping Commands
# Stop after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
alias pg="ping google.com -c 5"

# alias shortcuts
alias rpi="sudo rpi-update"
alias rpi-next="sudo SKIP_BOOTLOADER=1 rpi-update next"
alias raspi="sudo raspi-config"
alias clr="clear"
alias clrh="history -c -w ~/.bash_history"
alias df='df -H'
alias du='du -ch'
alias mk="mkdir -p"
alias loading="sudo dmesg > ~/dmesg.txt"

# ls Commands
## Colorize the ls output and human readable sizes ##
# alias ls='ls --color=auto --human-readable -al'
## Use a long listing format ##
# alias ll='ls -la'
## Show hidden files ##
# alias l.='ls -d .* --color=auto'
# Listing files in folder
# alias listkb="ls -l --block-size=K"
# alias listmb="ls -l --block-size=M"

## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'

# Colorize diff output
alias diff='colordiff'

# Start calculator with math support
alias bc="bc -l"

# Resume wget by default
alias wget="wget -c"

# ps Commands
alias ps="ps auxf"
# Get top process eating cpu
alias pscpu="ps auxf | sort -nr -k 3"
alias pscpu10="ps auxf | sort -nr -k 3 | head -10"
# Get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'

# Free and Used Ram
alias meminfo='free -l'
alias free='free -mt'

# Run top in alternate screen
#alias top='tput smcup; top; tput rmcup'

Things added to my .bashrc
Code:
## Added Options ##
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

# Powerline
# Powerline is a statusline plugin
# https://github.com/powerline/powerline
. /usr/share/powerline/bindings/bash/powerline.sh

# Midnight Commander
# GNU Midnight Commander is a visual file manager
# https://midnight-commander.org/
. /usr/lib/mc/mc.sh

# ibus-typing-booster
# Description: Completion input method to speedup typing
# https://mike-fabian.github.io/ibus-typing-booster/documentation.html#adding-to-desktop
 export GTK_IM_Module=ibus
 export XMODIFIERS=@im=ibus
 export QT_IM_Modules=ibus

# fzf https://github.com/junegunn/fzf
# fzf is a general-purpose command-line fuzzy finder
# Info /usr/share/doc/fzf/README.Debian
# Enable fzf keybindings for Bash
source /usr/share/doc/fzf/examples/key-bindings.bash
# Enable fuzzy auto-completion for Bash (Not needed on Debian)
# source /usr/share/doc/fzf/examples/completion.bash

# fzf-tab-completion: Tab completion using fzf
# https://github.com/lincheney/fzf-tab-completion
source /home/craig/fzf-tab-completion/bash/fzf-bash-completion.sh
bind -x '"\t": fzf_bash_completion'

# Additional key bindings for fzf, primarily Bash.
# https://github.com/atweiden/fzf-extras
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] \
  && source "$HOME/.fzf-extras/fzf-extras.sh"

# Fix PATH
PATH=$PATH:/home/craig/.local/bin:/usr/local/sbin:/usr/sbin:/sbin:

. "$HOME/.cargo/env"

# bashacks https://github.com/merces/bashacks/
. /usr/bin/bashacks

source ~/.bash_completion/rustup
source ~/.bash_completion/cargo

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm

# shellfirm will intercept any risky patterns and immediately prompt a small challenge
# https://github.com/kaplanelad/shellfirm
# Source our file at the end of our bash profile (e.g. ~/.bashrc, ~/.profile, or ~/.bash_profile)
#echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc

# Load pre-exec command on shell initialized
#echo 'source ~/.shellfirm-plugin.sh' >> ~/.bashrc[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
source ~/.shellfirm-plugin.sh

[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh

# zoxide is a smarter cd command, inspired by z and autojump.
# https://github.com/ajeetdsouza/zoxide
eval "$(zoxide init bash)"

# Walk -- a terminal navigator.
# https://github.com/antonmedv/walk
function lk {
  cd "$(walk "$@")"
}


### Added by surfraw. To remove use surfraw-update-path -remove
    export PATH=$PATH:/usr/lib/surfraw
### End surfraw addition.
 
Last edited:
My .bash_aliases
Code:
# Start gomuks Matrix Client
alias gomuks=/home/craig/.local/bin/gomuks

#yt-dlp
#alias yt-dlp="/home/craig/.local/bin/yt-dlp"

# snap update
alias refresh="sudo snap refresh"

# flatpak update
alias flatup="flatpak update"

# https://github.com/chubin/cheat.sh#installation
alias cheat="/home/craig/.local/bin/cht.sh"

# walk: Terminal File Manager
# https://github.com/antonmedv/walk
alias walk="walk --icons"

# Onelinershell https://github.com/Onelinerhub/shellhub
alias oh="/home/craig/.local/bin/oh.sh"

# ls command with a lot of pretty colors
# https://github.com/lsd-rs/lsd
alias ls='lsd'

# Show open ports
alias ports='sudo netstat -tulanp'

# Refresh .bashrc
alias bashrc="source ~/.bashrc"

# become root #
alias root='sudo -i'
alias su='sudo su'

# Fix which
#alias which='command -v'

# APT User Commands
alias search='apt search'
alias file='apt-file search'
alias policy='apt policy'
alias show="apt show"
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
alias update='sudo apt --update full-upgrade'
alias ainstall='sudo apt install'
alias apurge='sudo apt purge -y --autoremove'
alias upgrade='sudo nala upgrade'
alias aremove='sudo apt autoremove -y'
alias clean='sudo apt clean'
alias apt-backports='sudo apt install -t trixie-backports'
alias apt-testing='sudo apt install -t testing'
alias reboot='sudo reboot'
alias shutdown="sudo shutdown -P now"
fi

# Handy-dandy aliases for journalctl and systemctl
alias jc='sudo journalctl -b'
alias jca='sudo journalctl'
alias jcf='sudo journalctl -f'
alias jcr='sudo journalctl --list-boots'
alias sc='sudo systemctl'

# Making files immortal & executable
alias im+="sudo chattr +i"
alias im-="sudo chattr -i"
alias exe="sudo chmod +x"

#Add safety nets
# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'

# copy the current working directory to the clipboard
alias cpwd='pwd | xclip -selection clipboard'

# Clipboard
alias cpy="xclip -selection clipboard"

# quick directory movement
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# go to the last directory you were in
alias back='cd $OLDPWD'

# quickly find files and directory
alias ff='find . -type f -name'
alias fd='find . -type d -name'

# Create Python virtual environment
alias ve='python3 -m venv  --system-site-packages ./venv'
alias va='source /home/craig/Projects/venv/bin/activate'
#alias va='source ./venv/bin/activate'

# Ping Commands
# Stop after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
alias pg="ping google.com -c 5"

# alias shortcuts
alias rpi="sudo rpi-update"
alias rpi-next="sudo SKIP_BOOTLOADER=1 rpi-update next"
alias raspi="sudo raspi-config"
alias clr="clear"
alias clrh="history -c -w ~/.bash_history"
alias df='df -H'
alias du='du -ch'
alias mk="mkdir -p"
alias loading="sudo dmesg > ~/dmesg.txt"

# ls Commands
## Colorize the ls output and human readable sizes ##
# alias ls='ls --color=auto --human-readable -al'
## Use a long listing format ##
# alias ll='ls -la'
## Show hidden files ##
# alias l.='ls -d .* --color=auto'
# Listing files in folder
# alias listkb="ls -l --block-size=K"
# alias listmb="ls -l --block-size=M"

## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'

# Colorize diff output
alias diff='colordiff'

# Start calculator with math support
alias bc="bc -l"

# Resume wget by default
alias wget="wget -c"

# ps Commands
alias ps="ps auxf"
# Get top process eating cpu
alias pscpu="ps auxf | sort -nr -k 3"
alias pscpu10="ps auxf | sort -nr -k 3 | head -10"
# Get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'

# Free and Used Ram
alias meminfo='free -l'
alias free='free -mt'

# Run top in alternate screen
#alias top='tput smcup; top; tput rmcup'

Things added to my .bashrc
Code:
## Added Options ##
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

# Powerline
# Powerline is a statusline plugin
# https://github.com/powerline/powerline
. /usr/share/powerline/bindings/bash/powerline.sh

# Midnight Commander
# GNU Midnight Commander is a visual file manager
# https://midnight-commander.org/
. /usr/lib/mc/mc.sh

# ibus-typing-booster
# Description: Completion input method to speedup typing
# https://mike-fabian.github.io/ibus-typing-booster/documentation.html#adding-to-desktop
 export GTK_IM_Module=ibus
 export XMODIFIERS=@im=ibus
 export QT_IM_Modules=ibus

# fzf https://github.com/junegunn/fzf
# fzf is a general-purpose command-line fuzzy finder
# Info /usr/share/doc/fzf/README.Debian
# Enable fzf keybindings for Bash
source /usr/share/doc/fzf/examples/key-bindings.bash
# Enable fuzzy auto-completion for Bash (Not needed on Debian)
# source /usr/share/doc/fzf/examples/completion.bash

# fzf-tab-completion: Tab completion using fzf
# https://github.com/lincheney/fzf-tab-completion
source /home/craig/fzf-tab-completion/bash/fzf-bash-completion.sh
bind -x '"\t": fzf_bash_completion'

# Additional key bindings for fzf, primarily Bash.
# https://github.com/atweiden/fzf-extras
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] \
  && source "$HOME/.fzf-extras/fzf-extras.sh"

# Fix PATH
PATH=$PATH:/home/craig/.local/bin:/usr/local/sbin:/usr/sbin:/sbin:

. "$HOME/.cargo/env"

# bashacks https://github.com/merces/bashacks/
. /usr/bin/bashacks

source ~/.bash_completion/rustup
source ~/.bash_completion/cargo

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm

# shellfirm will intercept any risky patterns and immediately prompt a small challenge
# https://github.com/kaplanelad/shellfirm
# Source our file at the end of our bash profile (e.g. ~/.bashrc, ~/.profile, or ~/.bash_profile)
#echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc

# Load pre-exec command on shell initialized
#echo 'source ~/.shellfirm-plugin.sh' >> ~/.bashrc[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
source ~/.shellfirm-plugin.sh

[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh

# zoxide is a smarter cd command, inspired by z and autojump.
# https://github.com/ajeetdsouza/zoxide
eval "$(zoxide init bash)"

# Walk -- a terminal navigator.
# https://github.com/antonmedv/walk
function lk {
  cd "$(walk "$@")"
}


### Added by surfraw. To remove use surfraw-update-path -remove
    export PATH=$PATH:/usr/lib/surfraw
### End surfraw addition.
GOOD ONE!
️️✍️✍️️️
 
My .bash_aliases
Code:
# Start gomuks Matrix Client
alias gomuks=/home/craig/.local/bin/gomuks

#yt-dlp
#alias yt-dlp="/home/craig/.local/bin/yt-dlp"

# snap update
alias refresh="sudo snap refresh"

# flatpak update
alias flatup="flatpak update"

# https://github.com/chubin/cheat.sh#installation
alias cheat="/home/craig/.local/bin/cht.sh"

# walk: Terminal File Manager
# https://github.com/antonmedv/walk
alias walk="walk --icons"

# Onelinershell https://github.com/Onelinerhub/shellhub
alias oh="/home/craig/.local/bin/oh.sh"

# ls command with a lot of pretty colors
# https://github.com/lsd-rs/lsd
alias ls='lsd'

# Show open ports
alias ports='sudo netstat -tulanp'

# Refresh .bashrc
alias bashrc="source ~/.bashrc"

# become root #
alias root='sudo -i'
alias su='sudo su'

# Fix which
#alias which='command -v'

# APT User Commands
alias search='apt search'
alias file='apt-file search'
alias policy='apt policy'
alias show="apt show"
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
alias update='sudo apt --update full-upgrade'
alias ainstall='sudo apt install'
alias apurge='sudo apt purge -y --autoremove'
alias upgrade='sudo nala upgrade'
alias aremove='sudo apt autoremove -y'
alias clean='sudo apt clean'
alias apt-backports='sudo apt install -t trixie-backports'
alias apt-testing='sudo apt install -t testing'
alias reboot='sudo reboot'
alias shutdown="sudo shutdown -P now"
fi

# Handy-dandy aliases for journalctl and systemctl
alias jc='sudo journalctl -b'
alias jca='sudo journalctl'
alias jcf='sudo journalctl -f'
alias jcr='sudo journalctl --list-boots'
alias sc='sudo systemctl'

# Making files immortal & executable
alias im+="sudo chattr +i"
alias im-="sudo chattr -i"
alias exe="sudo chmod +x"

#Add safety nets
# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'

# copy the current working directory to the clipboard
alias cpwd='pwd | xclip -selection clipboard'

# Clipboard
alias cpy="xclip -selection clipboard"

# quick directory movement
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# go to the last directory you were in
alias back='cd $OLDPWD'

# quickly find files and directory
alias ff='find . -type f -name'
alias fd='find . -type d -name'

# Create Python virtual environment
alias ve='python3 -m venv  --system-site-packages ./venv'
alias va='source /home/craig/Projects/venv/bin/activate'
#alias va='source ./venv/bin/activate'

# Ping Commands
# Stop after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
alias pg="ping google.com -c 5"

# alias shortcuts
alias rpi="sudo rpi-update"
alias rpi-next="sudo SKIP_BOOTLOADER=1 rpi-update next"
alias raspi="sudo raspi-config"
alias clr="clear"
alias clrh="history -c -w ~/.bash_history"
alias df='df -H'
alias du='du -ch'
alias mk="mkdir -p"
alias loading="sudo dmesg > ~/dmesg.txt"

# ls Commands
## Colorize the ls output and human readable sizes ##
# alias ls='ls --color=auto --human-readable -al'
## Use a long listing format ##
# alias ll='ls -la'
## Show hidden files ##
# alias l.='ls -d .* --color=auto'
# Listing files in folder
# alias listkb="ls -l --block-size=K"
# alias listmb="ls -l --block-size=M"

## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'

# Colorize diff output
alias diff='colordiff'

# Start calculator with math support
alias bc="bc -l"

# Resume wget by default
alias wget="wget -c"

# ps Commands
alias ps="ps auxf"
# Get top process eating cpu
alias pscpu="ps auxf | sort -nr -k 3"
alias pscpu10="ps auxf | sort -nr -k 3 | head -10"
# Get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'

# Free and Used Ram
alias meminfo='free -l'
alias free='free -mt'

# Run top in alternate screen
#alias top='tput smcup; top; tput rmcup'

Things added to my .bashrc
Code:
## Added Options ##
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

# Powerline
# Powerline is a statusline plugin
# https://github.com/powerline/powerline
. /usr/share/powerline/bindings/bash/powerline.sh

# Midnight Commander
# GNU Midnight Commander is a visual file manager
# https://midnight-commander.org/
. /usr/lib/mc/mc.sh

# ibus-typing-booster
# Description: Completion input method to speedup typing
# https://mike-fabian.github.io/ibus-typing-booster/documentation.html#adding-to-desktop
 export GTK_IM_Module=ibus
 export XMODIFIERS=@im=ibus
 export QT_IM_Modules=ibus

# fzf https://github.com/junegunn/fzf
# fzf is a general-purpose command-line fuzzy finder
# Info /usr/share/doc/fzf/README.Debian
# Enable fzf keybindings for Bash
source /usr/share/doc/fzf/examples/key-bindings.bash
# Enable fuzzy auto-completion for Bash (Not needed on Debian)
# source /usr/share/doc/fzf/examples/completion.bash

# fzf-tab-completion: Tab completion using fzf
# https://github.com/lincheney/fzf-tab-completion
source /home/craig/fzf-tab-completion/bash/fzf-bash-completion.sh
bind -x '"\t": fzf_bash_completion'

# Additional key bindings for fzf, primarily Bash.
# https://github.com/atweiden/fzf-extras
[[ -e "$HOME/.fzf-extras/fzf-extras.sh" ]] \
  && source "$HOME/.fzf-extras/fzf-extras.sh"

# Fix PATH
PATH=$PATH:/home/craig/.local/bin:/usr/local/sbin:/usr/sbin:/sbin:

. "$HOME/.cargo/env"

# bashacks https://github.com/merces/bashacks/
. /usr/bin/bashacks

source ~/.bash_completion/rustup
source ~/.bash_completion/cargo

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm

# shellfirm will intercept any risky patterns and immediately prompt a small challenge
# https://github.com/kaplanelad/shellfirm
# Source our file at the end of our bash profile (e.g. ~/.bashrc, ~/.profile, or ~/.bash_profile)
#echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc

# Load pre-exec command on shell initialized
#echo 'source ~/.shellfirm-plugin.sh' >> ~/.bashrc[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
source ~/.shellfirm-plugin.sh

[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh

# zoxide is a smarter cd command, inspired by z and autojump.
# https://github.com/ajeetdsouza/zoxide
eval "$(zoxide init bash)"

# Walk -- a terminal navigator.
# https://github.com/antonmedv/walk
function lk {
  cd "$(walk "$@")"
}


### Added by surfraw. To remove use surfraw-update-path -remove
    export PATH=$PATH:/usr/lib/surfraw
### End surfraw addition.
very cool!
 


Follow Linux.org

Staff online

Members online


Top