Key Concepts

Review core concepts you need to learn to master this subject

Command line environment

The environment of the command line refers to the settings and preferences of the current user. It enables users to set greetings, alias commands, variables, and much more.

Environment
Lesson 1 of 1
  1. 1
    Each time we launch the terminal application, it creates a new session. The session immediately loads settings and preferences that make up the command line environment. We can configure the env…
  2. 2
    Nice job! You just edited a file in the nano text editor. How does it work? $ nano hello.txt nano is a command line text editor. It works the same way as a desktop text editor like TextEdit or…
  3. 3
    A bash profile is a file used to store environment settings for your terminal, and it’s accessible by the name ~/.bash_profile. When a session starts, it loads the contents of the bash profil…
  4. 4
    As we mentioned in the last exercise, you can add settings and commands that execute every time a new terminal session is started. One type of setting you can create is called an alias: alias …
  5. 5
    We can add as many aliases as we want in a bash profile. Here are two more examples: alias hy=”history” hy is set as an alias for the history command in the bash profile. The alias is then made…
  6. 6
    Environment variables are variables that can be used across commands and programs and hold information about the environment. What happens when you store this in ~/.bash_profile? export US…
  7. 7
    PS1 is an environment variable that defines the makeup and style of the command prompt. What happens when this is stored in ~/.bash_profile? export PS1=”>> “ 1. export PS1=”>> “ sets the co…
  8. 8
    What happens when you type this command? $ echo $HOME The HOME variable is an environment variable that displays the path of the home directory ~. You can specify and change the HOME variable i…
  9. 9
    PATH is an environment variable that stores a list of directories separated by a colon. What happens when you type this command? $ echo $PATH /home/ccuser/.gem/ruby/2.0.0/bin:/usr/local/sbin:/u…
  10. 10
    The env command stands for “environment,” and returns a list of the environment variables for the current user. What happens when you type the env command? env The env command returns a number…
  11. 11
    Congratulations! You learned to use the bash profile to configure the environment. What can we generalize so far? * The environment refers to the preferences and settings of the current user. *…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo