virtualenvwrapperスクリプトで生成された新しい環境コマンドを削除する方法は?

virtualenvwrapperスクリプトで生成された新しい環境コマンドを削除する方法は?

virtuarenvwrapper.sh私のシステムにPythonの代替バージョンを設定するためにインストールして実行しました。スクリプトにはどこかに配置された一連のコマンドがあり、これを開くgnome-terminalたびに次のものが表示されます。

bash: which: command not found...
bash: -m: command not found...
virtualenvwrapper.sh: There was a problem running the initialization hooks. 

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON= and that PATH is
set properly.
user@localhost ~]$

このコマンドを削除したいのですが、そのコマンドがどこにあるのかがわかりません。私は見たことがない:

  • ~/.bash_profile
  • ~/.bashrc
  • /etc/bashrc

このコマンドは私のユーザー端末とルート端末で実行されます。端末を開くときに実行したいコマンドをどこに入力できますか?

ベストアンサー1

このようなものを追跡しようとするたびに、私は小さな関数を使います。

grep_bash(){
    grep -H "$@" ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login \
        /etc/bash.bashrc /etc/profile /etc/environment /etc/profile.d/* \
        /etc/pam.d/* 2>/dev/null
}

これをファイルに追加したら、~/.bashrcこれを使用してbash初期化ファイル内の文字列を見つけることができます。

ただし、ここで最も可能性の高いシナリオは、あなた~/bashrcまたは他の人が他のファイルを調達し、それ問題があります。したがって、単語sourceや文字を見つけてください.

grep -wE '\.|source' ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login \
        /etc/bash.bashrc /etc/profile /etc/environment /etc/pam.d/*\ 
         /etc/profile.d/* 2>/dev/null

おすすめ記事