As well as /etc/profile
which others have mentioned, some Linux systems now use a directory /etc/profile.d/
; any .sh
files in there will be sourced by /etc/profile
. It’s slightly neater to keep your custom environment stuff in these files than to just edit /etc/profile
.
More Related Contents:
- When should I wrap quotes around a shell variable?
- Looping through the content of a file in Bash
- Why should eval be avoided in Bash, and what should I use instead?
- How do I write standard error to a file while using “tee” with a pipe?
- How to kill a child process after a given timeout in Bash?
- How to generate a core dump in Linux on a segmentation fault?
- What does $@ mean in a shell script?
- Better way to rename files based on multiple patterns
- Forcing bash to expand variables in a string loaded from a file
- Linux: copy and create destination dir if it does not exist
- What is the difference between using `sh` and `source`?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Extract file basename without path and extension in bash [duplicate]
- How do you find the original user through multiple sudo and su commands?
- How to sort a file in-place?
- How can I remove the last character of a file in unix?
- Managing log files created by cron jobs
- How to run a shell script on a Unix console or Mac terminal?
- How do I syntax check a Bash script without running it?
- How to check if a file is empty in Bash?
- Is it OK to use the same input file as output of a piped command?
- Should PATH contain directories or full paths to binaries?
- Execute a command without keeping it in history [closed]
- When to wrap quotes around a shell variable?
- How do you normalize a file path in Bash?
- Running shell script in parallel
- Difference between shell and environment variables
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- Bash script to remove ‘x’ amount of characters the end of multiple filenames in a directory?
- How do you run a script on login in *nix?