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

相关推荐
未济3 天前
linux 配置环境变量
linux
傲世仙尊3 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.3 天前
进程间通信
linux
Liuqy-053 天前
Linux IO编程——静态库、动态库
linux
彧azz3 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅3 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK3 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
Elasticsearch3 天前
Elastic Observability 的跨项目搜索:通过一个查询搜索所有关联项目
elasticsearch
琥珀色糖3 天前
SimlpeHttp
linux·服务器
qeen873 天前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程