If I do not edit the .bashrc or other config files, the environment variables that I've setted are gone when I logout, or turn off the terminal.
What I'm curious is, where are those 'temporary' env vars saved in?
As I guess, they might be in the memory. That makes sense because they will disappear when the terminal is turned off(equals the terminal I was using is gone from the memory). Am I correct?
man bash
). – goldilocks Apr 16 '15 at 12:24/proc/PID/
? I thought so but couldn't find them. – terdon Apr 16 '15 at 13:01/proc
. It's an interface to the kernel, which manages the process images. When you read a file there, it amounts to asking the kernel for information, which it retrieves from memory and provides. – goldilocks Apr 16 '15 at 13:03/proc
but not stored there. Thanks. – terdon Apr 16 '15 at 13:06/proc/[PID]/environ
. – goldilocks Apr 16 '15 at 13:06strings /proc/$$/environ
shows the variables (and values) that the current process inherited at its startup. – Chris Davies Apr 16 '15 at 14:09