Cost: $0. Tools: your Ubuntu VMA software-based emulation of a complete computer that runs its own operating system and applications, isolated from the host hardware. Read more →, terminalThe window or screen where you type text commands and read their output, connected to a shell that runs those commands. Read more → only. No file manager for this whole lab.
Steps
- Build
~/company/with folders hr, engineering, sales, finance, it, each holding 3 .txt files. One command can do it:mkdir -p ~/company/{hr,engineering,sales,finance,it}thentouch ~/company/{hr,engineering,sales,finance,it}/file{1..3}.txt. Explain in your notes what the braces did. - Put at least one line of text in every file using
echoand>. - Copy the whole tree to
/tmp/company-backup. findevery .txt file in~/company. Save the output.grep -rfor a word you put in some files. Save the output.- Run
df -handfree -hintosystem-report.txt. - Open
system-report.txtin nano or vim and add a first line:System Report - <today's date>. - Back up
/etc/hosts, add a test entry, prove it with pingA tool that checks whether another device on a network is reachable and how long the round trip takes. Read more →, restore the backupA copy of data stored separately from the original, used to restore systems and files after data loss from hardware failure, deletion, ransomware, or disaster. Read more →, prove withdiffthat it is back. git initin~/course-notes, add everything, commit “initial commit - phases 1-3”.
Worked troubleshooting: the folders were not created where you expected
Symptom. You ran step 1, but cat company/hr/file1.txt says:
cat: company/hr/file1.txt: No such file or directory
Hypothesis. Two common causes. You are in a different folder than you think, or the shell did not expand ~ and the braces because they were inside quotes.
Test. pwd shows where you are. Then look for a folder literally named ~. On the course VM, running the step 1 command with the path in double quotes from /tmp gave this:
mkdir -p "~/company/{hr,it}"
ls /tmp/~
company
The shell created a folder called ~ in the current folder, with one folder inside literally named {hr,it}. Quotes turn off tilde and brace expansion.
Fix. Remove the wrong folder with care (rm -r "/tmp/~", quoted, so ~ is not expanded to your home folder), then rerun the command from step 1 without quotes.
Why it worked. Expansion is done by the shell before mkdir runs. mkdir did exactly what it was told; the shell just told it something different.
Proof (~/course-notes/phase-3-cli/)
commands-reference.md: every command from this phase, what it does, one example, in your own words.text-editor-notes.md: your editor, its keys, mistakes you made.git-reference.md: your commit workflow.challenge-notes.md: exact commands and output for steps 1 to 9.git log --onelineoutput pasted at the end.
Done when
Every step is in challenge-notes.md with real output, and git log shows your commit.
- GNU Bash manual (see Brace Expansion and Tilde Expansion), also as
bash(1): https://manpages.ubuntu.com/manpages/resolute/man1/bash.1.html