ps1 썸네일형 리스트형 도커 컨테이너 터미널 프롬프트(PS1) 색상 변경 도커 컨테이너 터미널 프롬프트(PS1) 색상 변경 Dockerfile에서 컨테이너 내에서 사용할 터미널 프롬프트(PS1)를 설정하려면 Dockerfile 내에서 ENV 지시문을 사용하여 PS1 환경 변수를 설정할 수 있습니다. Dockerfile 파일 생성 vim Dockerfile FROM centos:7 LABEL website="sangchul.kr" ENV PS1="\[\e[33m\]\u\[\e[m\]\[\e[37m\]@\[\e[m\]\[\e[34m\]\h\[\e[m\]:\[\033[01;31m\]\W\[\e[m\]$ " RUN echo 'PS1=$PS1' >> ~/.bashrc Docker 이미지 빌드 docker build --tag centos-ps1:0.1 . 컨테이너 실행 docker r.. 더보기 [shell] bash colors bash colors 스크립트 편집 vim z.sh $ vim z.sh #!/bin/bash color_reset=$(tput sgr0) color_red=$(tput setaf 1) color_blue=$(tput setaf 4) echo "${color_red}sangchul.kr${color_reset}" echo "${color_blue}sangchul.kr${color_reset}" 스크립트 실행 결과 sh z.sh tput 명령어 사용 echo "블로거 `tput setaf 1`sangchul.kr`tput sgr0`." bash 프로파일에 등록하여 컬러 사용하기 vim .bashrc $ vim .bashrc RED="\033[0;31m" PINK="\033[1;31m" YELLOW="\033.. 더보기 [url] Easy Bash PS1 Generator Easy Bash PS1 Generator http://ezprompt.net export PS1="\[\e[31m\]\u\[\e[m\]\[\e[37m\]@\[\e[m\]\[\e[33m\]\h\[\e[m\]:\[\033[01;36m\]\W\[\e[m\]$ " 더보기 이전 1 다음