IT/Linux
Linux 사용시 유용한 환경 변수와 프로필 구성
by blogger
2024. 8. 12.
bash alias
alias ls='ls --color=true --time-style=long-iso'
alias ll='ls -alh'
alias ..='cd ..'
alias dps='docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Size}}\t{{.RunningFor}}\t{{.Ports}}"'
alias dstat='docker stats --format "table {{.Name}}\t{{.PIDs}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}"'
echo alias dps=\'docker ps -a --format \"table {{.Names}}\\t{{.Status}}\\t{{.Size}}\\t{{.RunningFor}}\\t{{.Ports}}\"\' >> ~/.bash_profile
echo alias dstat=\'docker stats --format \"table {{.Name}}\\t{{.PIDs}}\\t{{.CPUPerc}}\\t{{.MemUsage}}\\t{{.MemPerc}}\\t{{.NetIO}}\\t{{.BlockIO}}\"\' >> ~/.bash_profile
History 출력 날짜 포멧 및 리스트 갯수
# /etc/profile 에 추가
HISTTIMEFORMAT="[%F %T] "
HISTSIZE=10000
HISTFILESIZE=20000
export HISTTIMEFORMAT HISTSIZE HISTFILESIZE
bash-completion
yum install -y bash-completion
kubectl completion bash >> ~/.bashrc
curl -L https://raw.githubusercontent.com/docker/cli/v$(docker version --format '{{.Server.Version}}' | sed 's/-.*//')/contrib/completion/bash/docker >> ~/.bashrc