Files
dotfiles/.bashrc.d/10_aliases.sh
Kenji Morishige 522b004632 fix: Linux/Ubuntu compatibility for shell configs and dotfiles manager
00_env.sh:
  - yaml2json: use python3 (python3 first, python fallback) — Ubuntu 20+ has no 'python'
  - pyenv init: moved out of Darwin-only block; now runs everywhere if pyenv installed
  - xterm ls alias: split by OS — Linux gets 'ls --color=auto', macOS gets 'ls -G'

10_aliases.sh:
  - psg: guard with 'command -v pstree' (not installed by default on Ubuntu)
  - ps-m: Linux-only (--sort flag is GNU ps, not available on macOS)
  - gitresetpw: OS-conditional — osxkeychain on Darwin, store on Linux

dotfiles_manager.sh:
  - Replace both hardcoded 'brew install gnupg' die messages with _require_gpg()
    helper that gives apt-get hint on Linux and brew hint on macOS
2026-02-23 13:33:28 -06:00

41 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# 10_aliases.sh — Universal aliases, safe on all machines and profiles
# ============================================================================
# Navigation / file listing
alias l='less'
alias t='tail -f'
alias la='ls -a'
alias lf='ls -FA'
alias ll='ls -lAh | more'
alias lt='ls -tlAh | more'
alias a='alias'
alias h='history 25'
# Screen
alias sl='screen -list'
alias sr='screen -r'
# Process inspection
# pstree may not be installed on all systems
command -v pstree >/dev/null 2>&1 && alias psg='pstree | grep'
# --sort is a GNU ps flag (Linux only)
[[ "$(uname -s)" == "Linux" ]] && alias ps-m='ps aux --sort -rss'
# Docker — short forms
alias d='docker'
alias di='docker images'
alias dp='docker ps'
alias dr='docker run'
alias db='docker build'
# Git helpers
alias giturl='git config --get remote.origin.url'
# Git credential helper is OS-specific
if [[ "$(uname -s)" == "Darwin" ]]; then
alias gitresetpw='git config --global credential.helper osxkeychain'
else
alias gitresetpw='git config --global credential.helper store'
fi
alias git-clean='git-prune-branches'