목록bash (4)
준호씨의 블로그

🎯 Conda 기본 환경(base) 자동 활성화 비활성화 방법Python 개발을 하다 보면 conda를 사용하는 경우가 많습니다. Anaconda나 Miniconda 설치 후 터미널을 열면 항상 base 환경이 자동으로 활성화되어 있는 걸 볼 수 있죠.(base) user@machine ~ %매번 conda deactivate를 치는 것도 귀찮고, base 환경을 굳이 항상 켤 필요가 없다면, 자동 활성화를 꺼두는 게 깔끔합니다. 오늘은 그 방법을 간단하게 소개합니다.🛠️ auto_activate_base란?auto_activate_base는 Conda가 터미널 실행 시 자동으로 base 환경을 활성화할지 여부를 설정하는 옵션입니다.기본값은 true로 되어 있어, 터미널을 열면 항상 (base)가 붙..
터미널에서 git 자동완성 (tab 으로 자동완성) 하기와 prompt 에 git 정보를 출력하는 방법이다. brew 로 bash-completion 설치 brew install git && brew install bash-completion ~/.bash_profile 에 다음 내용을 추가 한다. if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi GIT_PS1_SHOWDIRTYSTATE=true PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\03..
2018.11.01 내용 분리shell 프롬프트에 git branch 표시하기 http://junho85.pe.kr/1150우선 .git-completion.bash .git-prompt.sh 파일이 있어야 한다. .git-completion.bash 는 자동완성을 위한 것이고 .git-prompt.sh 는 프롬프트에 branch 정보를 표시하기 위함이다. 해당 파일들은 아래 경로에서 받을 수 있다. https://github.com/git/git/blob/master/contrib/completion/git-completion.bash https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh ~/.bashrc 설정 ~/.bashrc..
간혹 특정 텍스트 파일을 grep 할 때 해당 파일을 텍스트 파일로 인식 하지 않고 Binary file 로 인식 할 때가 있다. $ grep hello doc.txt Binary file (standard input) matches 이럴 때는 -a (혹은 --text) 옵션을 이용하면 된다. $ grep hello doc.txt -a man grep 해 보면 다음과 같은 내용을 찾을 수 있다. -a, --text Treat all files as ASCII text. Normally grep will simply print ``Binary file ... matches'' if files contain binary characters. Use of this option forces grep to out..