02-E.16: System Wide User Profiles

Linux - The Penguin Marches On · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    02-E.16: System Wide User Profiles

    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 was last modified on Tue, 04 Oct 2022 06:52:06 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Patrick McClanahan.