The terminal and the shell: your first commands
You tell the terminal, the shell and the console apart, read the parts of a command (command, options, arguments), separate the shell’s own commands from external programs, make formatted output with echo and printf, learn the quoting rules and file names with special characters, use history and shortcuts; at the end you read a code from an oddly named file and find which program PATH picks.
Level 101 · 45 min
Daniel gives you your first real tip: "You can’t do security work without understanding why a command works or doesn’t. Get to know the shell first."
The terminal is the window on screen: it shows what you type and draws the output. The shell (here bash) is the interpreter behind that window: it reads the line you type, splits it into parts, expands variables and special characters, then runs the program. The console is the screen and keyboard attached directly to the machine.
Analogy: the terminal is a telephone handset, the shell the operator at the other end of the line. You talk into the handset; the operator understands what you said and connects you to the right person. If you know the operator’s rules (quotes, spaces, special characters), you won’t be connected to the wrong person.
What you will do in this lesson
- Which shell are you in?
- The parts of a command
- The shell’s own commands
- Formatted output: echo and printf
- The quoting rules
- Names with spaces and special characters
- History and shortcuts
- The oddly named note
- Which program runs?
- Short quiz
Skills you will earn
- The terminal, the shell and /etc/shells
- Telling command, options and arguments apart
- Asking what a command is (type, which -a)
- Formatted output with echo and printf
- Quoting rules and names with special characters
- Working fast with Tab completion, history and cd -
- Shell shortcuts and history expansion (!!, Ctrl+R)
- Reading files with cat
- PATH and the command search order
← What Linux is and why security teams use it · Linux fundamentals · Getting help: man, info, --help →
Start for free