update .bashrc desktop

This commit is contained in:
zj
2025-11-24 02:40:44 +08:00
parent 5d929cef18
commit 2961829007
6 changed files with 263 additions and 10 deletions

View File

@@ -25,6 +25,7 @@ alias ....='cd ../../..'
# 系统信息
alias df='df -h'
alias du='du -h'
alias dus='du -sh * | sort -nr'
alias free='free -h'
# Git 快捷方式
@@ -34,6 +35,38 @@ alias gc='git commit'
alias gp='git push'
alias gl='git log --oneline'
alias tms='sh /home/smart/.tms3/starter/tms-tools.sh'
alias rtms='sh /home/smart/.tms3/starter/restart'
# 文件大小查看别名
alias size='ls -lahSr' # 简单版本
alias sizes='du -sh * | sort -h' # 准确版本
alias sizeall='du -sh .[!.]* * 2>/dev/null | sort -h' # 包含隐藏文件
# 详细版本,显示文件权限和大小
alias sizedetail='du -sh * | sort -h | while read s n; do ls -ld "$n" | awk '\''{printf "%-10s %-5s %-8s ", $1, $3, $4}'\''; echo "$s $n"; done'
# 文件大小查看函数
fsize() {
local path="${1:-.}" # 默认当前目录
local depth="${2:-0}" # 目录深度
echo "=== 文件大小统计: $path ==="
if [ "$depth" -eq 0 ]; then
# 只显示当前目录下的文件
du -sh "$path"/* 2>/dev/null | sort -h
else
# 显示指定深度的目录结构
find "$path" -maxdepth "$depth" -type f -exec du -sh {} + 2>/dev/null | sort -h
fi
}
# 快捷别名
alias sz='fsize . 0'
alias sz1='fsize . 1'
alias sz2='fsize . 2'
# 环境变量
export EDITOR=vim
export VISUAL=vim
@@ -44,12 +77,8 @@ export HISTFILESIZE=20000
export WINE_HOME="/home/smart/wine"
export PATH="$WINE_HOME/bin:$PATH"
# 如果需要,还可以设置其他 Wine 相关变量
# export WINEPREFIX="$HOME/.wine" # Wine 前缀目录
# export WINEARCH=win64 # 架构 (win32/win64)
# 彩色提示符
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='\[\033[01;33m\]\t\[\033[00m\] \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# 实用函数
mkcd() { mkdir -p "$1" && cd "$1"; }