Skip to main content
Engineering LibreTexts

02-E.16: System Wide User Profiles

  • Page ID
    26821
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Global Profiles

    In Linux, settings that impact all users or the entire system are referred to as global. So, user profiles that affect all users are known as global user profiles. These files allow administrators to set system wide settings that will be the default setting for all users. Through their individual profiles, users can change or edit these settings to customize their environment.

    We are going to take a look at these global profiles, what files are involved, and what they provide for the users.

    A Quick Sidebar

    When we are discussing scripts in Linux there are two methods of using a script.

    Executing (or Running the Script)

    This is similar to executing/running any compiled program in Linux - like executing the file to open up a web browser or a word processor.

    ...BUT...

    Executing a script will run each of the commands in the script file in a new shell process, which means it will be a new process id with a new environment.

    To clarify this:

     ./somescript 

    will execute somescript provided that this script file is executable and located in the current directory. We know it is looking for the file in the current directory since the command specifically includes the leading ./ - the . specifies this directory. Specifying in this fashion is necessary because the current directory is usually not (and usually should not be) in the user's $PATH .

    Likewise, the command:

     somescript 
    

    will execute somescript if the file is executable and located in any of the directories listed in this user's $PATH .

    Source a Script

    Alternatively, sourcing a script will run each of the commands contained in the script file within the current shell process. So, the command:

     source somescript 

    will source somescript . The file need not be executable but it must be a valid shell script. The file can be in current directory or in a directory in $PATH .

    The command

     . somescript 

    will also source somescript . Bash defines the command source as an alias to dot, so the above two commands are basically the same.


    This page titled 02-E.16: System Wide User Profiles is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Patrick McClanahan.

    • Was this article helpful?