How to find where an environment variable is set

后端 未结 3 1741
眼角桃花
眼角桃花 2020-12-24 16:01

Say I have some environment variable PROJECT_HOME. I want to find out which file it is set in. How do I do this?

相关标签:
3条回答
  • 2020-12-24 16:05
    grep -r PROJECT_HOME /etc $HOME
    

    will probably find it.

    0 讨论(0)
  • 2020-12-24 16:21
    find $HOME -type f -exec grep -Hn 'PROJECT_HOME' {} \;
    
    0 讨论(0)
  • 2020-12-24 16:22

    I like using ack! in these kind of situations. I would change into the likely super directory and do an ack PROJECT_HOME.

    0 讨论(0)
提交回复
热议问题