Last active
November 22, 2023 15:59
-
-
Save Lathanao/83b75e1938ce38ff864e7ac7f205c41d to your computer and use it in GitHub Desktop.
Miscellaneous Shell Alias for zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Miscellaneous Shell Alias | |
alias df='df -h' | |
alias du='du -hs ./* | sort -hr' | |
alias duu='sudo du -Pshx /* 2>/dev/null' | |
alias free='free -m' | |
alias htop="sudo htop" | |
alias grep="grep --color" | |
alias history="history -E -10000" | |
alias sys="sudo systemctl --no-pager" | |
alias ch="sed -i '/: /!d' ~/.zhistory" | |
alias pass='pwgen 14 1' | |
## Cpu nd pid commands | |
alias pid='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head' | |
alias cpu='watch grep \"cpu MHz\" /proc/cpuinfo' | |
## Better common app | |
alias htop="sudo htop" | |
alias grep="grep --color" | |
alias history="history -E -10000" | |
alias ch="sed -i '/: /!d' ~/.zhistory" | |
alias sys="sudo systemctl --no-pager" | |
alias pass='pwgen 14 1' | |
## Files and directories | |
alias size='sudo du -Sh ./ | sort -rh | head -n 10' | |
alias wcl='ls -1 | wc -l' | |
alias word='ls -1 | wc -l' | |
alias c="clear" | |
alias ls='ls --color=auto --block-size=K' | |
alias ll='ls -la' | |
alias l.='ls -d .* --color=auto' | |
alias cd..='cd ..' | |
alias ..='cd ..' | |
alias ...='cd ../../../' | |
alias ....='cd ../../../../' | |
alias .....='cd ../../../../' | |
alias .4='cd ../../../../' | |
alias .5='cd ../../../../..' | |
## Git | |
alias br="git branch" | |
alias st="git status -sb" | |
alias log="git log -n 30 --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'" | |
alias logg="lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
# http://blog.kfish.org/2010/04/git-lola.html | |
alias lol = log --graph --decorate --pretty=oneline --abbrev-commit | |
alias lola = log --graph --decorate --pretty=oneline --abbrev-commit --all | |
alias rank="git shortlog -sn --no-merges" | |
## Git again | |
alias gitu='git add . && git commit && git push' | |
alias diff="git diff $(git rev-parse HEAD)..origin/HEAD" | |
alias diffname="git diff --name-only $(git rev-parse HEAD)..origin/HEAD" | |
alias git_pull="git clean -xf && git pull --quiet" | |
alias git_clone="git clone --depth 1 --quiet --single-branch" | |
alias list="git config --list --show-origin --show-scope" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment