https://drive.google.com/file/d/1Q0ccpqO7java3zLgWoyND1reSUBiwooG/view?usp=sharing

1. Types of Shell Variables

Explanation

Commands

# System variables
echo $USER
echo $SHELL
echo $PWD
echo $HOSTNAME

# View all variables
set

# User-defined variable
var1=555
echo $var1
unset var1        # Delete variable
echo $var1        # Now empty

Lab Steps

  1. Check system info:

    echo "User: $USER, Shell: $SHELL"
    
    
  2. Create and delete a variable:

    myvar=hello
    echo $myvar
    unset myvar
    echo $myvar
    
    

Tips & Warnings


2. The PATH Variable

Explanation

PATH is a colon-separated list of directories where the shell looks for executable commands. When you type ls, the shell searches each directory in PATH for a file named ls.

Commands

echo $PATH
which ls          # Shows full path: /usr/bin/ls