Challenge - 5 Problems
Alias Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Output of alias command
What is the output of the following commands executed in sequence?
alias ll='ls -l'
llLinux CLI
alias ll='ls -l'
llAttempts:
2 left
💡 Hint
Remember that alias replaces the command with the shortcut before execution.
✗ Incorrect
The alias 'll' is set to 'ls -l', so running 'll' executes 'ls -l', which lists files in long format.
📝 Syntax
intermediate1:00remaining
Correct alias syntax
Which of the following is the correct way to create an alias named 'gs' for 'git status' in bash?
Attempts:
2 left
💡 Hint
Alias values must be enclosed in quotes.
✗ Incorrect
The correct syntax requires the alias name, an equal sign, and the command in quotes.
🔧 Debug
advanced2:00remaining
Why does this alias not work?
Given the alias:
What will be the output when you run
alias greet='echo Hello $USER'What will be the output when you run
greet and why?Attempts:
2 left
💡 Hint
Think about when variables inside single quotes get expanded.
✗ Incorrect
Variables inside single quotes are not expanded, so $USER is printed literally.
🚀 Application
advanced1:30remaining
Creating a persistent alias
You want to create an alias 'll' for 'ls -la' that works every time you open a terminal. Which file should you add the alias command to?
Attempts:
2 left
💡 Hint
This file runs every time a new interactive shell starts.
✗ Incorrect
~/.bashrc is the file where user-specific shell configurations like aliases are stored.
🧠 Conceptual
expert2:00remaining
Effect of alias in scripts
If you define an alias in your interactive shell, will it be available automatically inside a bash script you run? Why or why not?
Attempts:
2 left
💡 Hint
Think about how bash treats interactive vs non-interactive shells.
✗ Incorrect
Aliases are expanded only in interactive shells unless explicitly enabled in scripts.