Shell Expansion & Globbing
Understand how the shell expands commands, including brace expansion, tilde expansion, and filename globbing patterns.
What is Shell Expansion?
In Linux, the shell is like a translator between you and the operating system. Before the shell runs your command, it often performs some 'magic' called expansion.
Shell expansion means the shell looks for special characters or patterns in your command and replaces them with something else. This happens before the command actually executes, saving you typing and making commands more powerful!
Your Home with Tilde `~`
The tilde (~) expansion is a super handy shortcut. It automatically expands to your current user's home directory.
Instead of typing /home/yourusername, you can just use ~. This is especially useful for navigating or referring to files in your home folder.
echo ~
echo ~/DocumentsAll lessons in this course
- Job Control (bg, fg, jobs)
- Shell Expansion & Globbing
- Aliases and Custom Prompts
- Shell Functions & Reusable Snippets