Skill 2 in course 1.1: Command-Line Foundations

Shell Fluency

Run commands with correct syntax, redirect and pipe their output, switch users and find answers in the documentation.

Beginner4 lessons20 exercises2 h 25 min

You will be able to

  • Read a prompt and a command line: command, options, arguments, and which parts the shell expands first.
  • Switch between users correctly with su, su - and sudo, and know which environment you get.
  • Combine commands with pipes and redirect standard output and standard error independently.
  • Use globbing, brace expansion, quoting and command substitution without surprises.
  • Find the right command and the right option using man, info, apropos and /usr/share/doc, offline.

Lessons

  1. 01Prompt, syntax and switching usersRead the prompt, build a correct command line, and move between users without losing track of who you are.whoamiidhostnamepwdtypewhich0/5 exercises
  2. 02Redirection and pipesSend output to files, keep errors apart from results, and chain small commands into pipelines.>>>2>&><|0/5 exercises
  3. 03Globbing, expansion and quotingKnow exactly what the shell rewrites before a command runs, and quote to stop it when you must.echo'*'{}$()aliashistory0/5 exercises
  4. 04Finding answers offline: man, info and /usr/share/docOn the exam there is no internet. Find the command, the option and the example in the system's own documentation.manaproposinfoman -k/usr/share/doc--help0/5 exercises