Linux Environment Variables
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
The global variables will be inherited by child processes.
You can create a global variable for your current session doing:
This variable will be accessible by your current sessions and its child processes.
You can remove a variable doing:
The local variables can only be accessed by the current shell/script.
From: https://geek-university.com/linux/common-environment-variables/
DISPLAY – the display used by X. This variable is usually set to :0.0, which means the first display on the current computer.
EDITOR – the user’s preferred text editor.
HISTFILESIZE – the maximum number of lines contained in the history file.
HISTSIZE – Number of lines added to the history file when the user finish his session
HOME – your home directory.
HOSTNAME – the hostname of the computer.
LANG – your current language.
MAIL – the location of the user’s mail spool. Usually /var/spool/mail/USER.
MANPATH – the list of directories to search for manual pages.
OSTYPE – the type of operating system.
PS1 – the default prompt in bash.
PATH – stores the path of all the directories which holds binary files you want to execute just by specifying the name of the file and not by relative or absolute path.
PWD – the current working directory.
SHELL – the path to the current command shell (for example, /bin/bash).
TERM – the current terminal type (for example, xterm).
TZ – your time zone.
USER – your current username.
Change the value of this variable to 0, so when you end your session the history file (~/.bash_history) will be deleted.
Change the value of this variable to 0, so when you end your session any command will be added to the history file (~/.bash_history).
The processes will use the proxy declared here to connect to internet through http or https.
The processes will trust the certificates indicated in these env variables.
Change how your prompt looks.
Root:
Regular user:
One, two and three backgrounded jobs:
One background job, one stopped and last command didn't finish correctly:
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)