We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Shell Configuration

Bash and Zsh both have configuration files that run automatically each time you start a new shell session. These files are used to set up your shell environment. They can be used to set up aliases, functions, and environment variables.

These files are located in your home directory (~) and are hidden by default. The ls command has a -a flag that will show hidden files:

ls -a ~
  • If you're using Bash, .bashrc is probably the file you want to edit.
  • If you're using Zsh, .zshrc is probably the file you want to edit or create if it doesn't yet exist.

Assignment

As part of your audit, you're trying to figure out what shell commands run automatically when a user logs in on the machine. You need to confirm which shell configuration file is being used.

  1. nano ~/.bashrc
    # or, if you're using Zsh:
    nano ~/.zshrc
    

    In nano, use Ctrl+O to save the file (confirm any prompts with Enter), then Ctrl+X to exit. The command list is at the bottom of the screen.

  2. echo "Hello from the shell!"
    

Answer the question.