Alias for Linux/Mac

Alias

alias for Linux/Mac

Tips: use alias show system alias.

nefetch and onefetch

alias s="neofetch"

alias c="onefetch"

make

alias mk="make"

zsh

alias sz="source ~/.zshrc"

fzf

alias f="fzf"

alias ff='fzf --preview "bat --color=always {}"'

grep

alias grep="grep --color=auto"

claude

alias cl='claude --dangerously-skip-permissions --append-system-prompt "$(cat ~/.claude/system-prompt.txt)"'

du

alias du1="du -hd 1"

clear

alias clr="clear"

alias c="clear"

cd

alias "."="cd ..."

alias "..."="cd .../..."

alias "..."="cd .../.../..."

alias "..."="cd .../.../.../..."

or:

alias "cd1"="cd ..."

alias "cd2"="cd .../..."

alias "cd3"="cd .../.../..."

alias "cd4"="cd .../.../.../..."

kubectl

alias k="kubectl"

alias kg="kubectl get"

alias ke="kubectl edit"

alias kexec="kubectl exec -it"

alias klf="kubectl logs -f"

alias ka="kubectl apply"

alias kcf="kubectl create -f"

alias kd="kubectl describe"

git

~/.gitconfig

复制代码
[alias]
    # git branch ==> git b
    br = branch
    # git commit -s -m "xx" ==> git c "xxx"
    c  = commit -s -m
    co = checkout
    ch = cherry-pick
    dump = cat-file -p
    hist = log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short
    st = status
    type = cat-file -t

alias gg="git clone"

alias gpl="git pull"

alias gps="git push"

alias ga="git add ."

alias gss="git stash save"

alias gsp="git stash pop"

docker

alias dex="sudo docker exec -it"

alias drm="docker rm $(docker ps -a -q)" # remove all containers

alias dclean="docker system prune -af" # clean system

python

alias py="python3"

alias pi="pip3 install"

alias sv="source venv/bin/active"

alias pyserve="python3 -m http.server" # pyserve 58080

grep/egrep

alias grep="grep --color=auto"

macos ip

alias myip=ifconfig en1 | grep inet | grep -v inet6 | cut -d ' ' -f2

相关推荐
sR916Mecz2 分钟前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
java·linux·服务器
扑火的小飞蛾18 分钟前
Windows 10 与 Kali Linux SSH 免密互信配置指南
linux·windows·ssh
0xDevNull25 分钟前
Linux服务器日志查看完全指南
linux·运维·服务器
songx_9931 分钟前
Linux基础1
linux·运维·服务器
蓝天居士33 分钟前
cpio命令详解(3)
linux·cpio
菱玖39 分钟前
Linux 系统性能排查常用指令
linux·运维·服务器
A__tao39 分钟前
Elasticsearch Mapping 一键生成 Go Struct,支持嵌套解析
elasticsearch·es
huangwxiao41 分钟前
HTB——Oopsie
linux·网络安全·htb
i建模1 小时前
华为MateBook X Pro 2020款在Ubuntu系统中提升音质
linux·ubuntu·华为
皮卡蛋炒饭.1 小时前
进程间通信
linux·运维·服务器