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

相关推荐
倔强的石头1066 小时前
【Linux指南】基础IO系列(八):实战衔接 —— 给微型 Shell 添加完整重定向功能
linux·运维·服务器
try2find6 小时前
打印ascii码报错问题
java·linux·前端
Ujimatsu6 小时前
虚拟机安装Ubuntu 26.04.x及其常用软件(2026.4)
linux·运维·ubuntu
恼书:-(空寄9 小时前
ES性能调优实战指南
elasticsearch
一直会游泳的小猫9 小时前
homebrew
linux·mac·工具·包管理
寒秋花开曾相惜9 小时前
(学习笔记)4.2 逻辑设计和硬件控制语言HCL(4.2.1 逻辑门&4.2.2 组合电路和HCL布尔表达式)
linux·网络·数据结构·笔记·学习·fpga开发
狂奔的sherry9 小时前
一次由 mount 引发的 Linux 文件系统“错觉”
linux·运维·服务器
小黑要努力9 小时前
智能音箱遇到的问题(一)
linux·运维·git
ch3nyuyu10 小时前
静态库和动态库的制作
linux·运维·开发语言
Elastic 中国社区官方博客10 小时前
Elasticsearch:智能搜索 - AI builder 及 skills
大数据·人工智能·elasticsearch·搜索引擎·ai·信息可视化·全文检索