mydotfiles/bash_aliases
2024-12-24 19:38:25 +03:00

105 lines
2.6 KiB
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- mode: sh;-*-
# SHOPT
shopt -s autocd # Automatically enter the written directory
shopt -s cdspell # Automatically detect folder even if it is misspelled
shopt -s histverify # Reruns the previous command (e.g !!123)
shopt -s expand_aliases # expand aliases
# Flatpak
alias fpu='flatpak update'
alias fpi='flatpak install'
alias fpl='flatpak list'
alias fpr='flatpak uninstall'
# DNF
alias upd='fpu && sudo dnf update'
alias upg='upd'
alias ins='sudo dnf install'
alias rem='sudo dnf remove'
alias sea='dnf search'
# History
cl () {
HISFIL=$HOME/.bash_history
if [ -f "$HISFIL" ]; then
rm $HISFIL
clear
history -cw
else
clear
history -cw
fi
}
# ARCHIVE EXTRACTION
# usage: ex <file>
ex ()
{
if [ -f "$1" ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' ex() aracılığıyla çıkarılamıyor" ;;
esac
else
echo "'$1' geçerli bir dosya değil"
fi
}
# Emacs
alias e='emacs -nw'
# Edit bash aliases
alias ba='e ~/.bash_aliases'
# Guile alias
alias guile='guile3.0'
# Colorize the grep command output for ease of use (good for log files)
alias grep='grep --color=auto'
# Make mount command output pretty and human readable format
alias mount='mount |column -t'
# Stop after sending count ECHO_REQUEST packets
alias ping='ping -c 5'
# Copy progress bar
alias cpv='rsync -ah --info=progress2'
# Change 'ls' to 'eza'
alias la='eza -al --color=always --group-directories-first' # Default list alias
alias ls='eza -a --color=always --group-directories-first' # All files and dirs
alias ll='eza -l --color=always --group-directories-first' # Long format
alias lt='eza -aT --color=always --group-directories-first' # Tree listing
alias l.='eza -a | egrep "^\."'
# Change 'cat' to 'bat'
alias cat='bat'
# Git
alias addup='git add -u'
alias addall='git add .'
alias branch='git branch'
alias checkout='git checkout'
alias clone='git clone'
alias commit='git commit -m'
alias fetch='git fetch'
alias pull='git pull origin'
alias push='git push origin'
alias stat='git status' # 'status' is protected name so using 'stat' instead
alias tag='git tag'
alias newtag='git tag -a'