Skip to content

Instantly share code, notes, and snippets.

@aneesh-joshi
Last active March 12, 2024 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneesh-joshi/d04ec283263b0617d5cadc4663c190b4 to your computer and use it in GitHub Desktop.
Save aneesh-joshi/d04ec283263b0617d5cadc4663c190b4 to your computer and use it in GitHub Desktop.
My useful aliases.
# Easy editing and sourcing of .bashrc
alias vbrc='vim ~/.bashrc ; source ~/.bashrc'
# Quick git commands
alias gs='git status'
alias gd='git diff';
alias gl='git log';
alias glol='git log --oneline'
alias gdno='git diff --name-only;'
alias gad='git add .'
alias ga='git commit --amend;'
alias gane='git commit --amend --no-edit;'
alias gb='git branch'
# Quick Basic Commands
alias p='pwd';
alias l='ls';
alias sl='ls';
alias ltr='ls -ltr';
alias la='ls -la';
alias ltra='ls -ltra';
# Tmux
alias tmx='tmux'
alias tls='tmux ls'
alias tl='tmux ls'
alias ta='tmux attach -t '
# Find
alias fn='find . -name '
# Grep
alias g='grep -rn'
alias gi='grep -rni'
# Vim
alias v='vim'
# Find
f() {
find . -name "*$1*"
}
# Aliases from @a3y3
# https://gist.github.com/a3y3/d0e772fcf9f43ff59e182c50154d55a4
stty stop ^J # use ctrl+j to stop terminal output, enabling you to use forward search using ctrl+s
function cecho () {
# zsh:
print -P "%F{green}$1%f";
# If you're using bash: echo -en '\E[0;32m';
# TODO check which shell is being used and use the approprite command
echo -en $1;
echo;
tput sgr0;
return;
}
# use cl for cd then ls
function cl () {
args=${@:-'.'}
cd $args && cecho $(pwd) && ls -ACFv --group-directories-first
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment