Module 4 cheat sheet: Linux & Web Servers

Move around Linux, manage files safely, and publish a website on EC2 with Apache or IIS.

All modules📖 Glossary

Navigation

CommandDoes
whoami / pwdwho and where am I
cd /path · cd .. · cd - · cd ~move around
ls -a · lllist, incl. hidden / long
sudo -i · exitbecome root · go back
history · clearpast commands · clear screen

Day 11 →

Files and folders

CommandDoes
mkdir -p a/bcreate folders
touch fempty file
cat f · cat > f · cat >> fview · overwrite · append
cp -r · mvcopy · move/rename
rmdir · rm -rfdelete empty · delete all (careful!)

Editors

vinano
Start typingijust type
Save & quitEsc → :wqCtrl+X → Y → Enter
Quit, no saveEsc → :q!Ctrl+X → N

Directory tree

PathMeaning
/root directory (top)
/rootroot user’s home
~current user’s home
/var/www/htmlApache website
/var/loglogs

Code: Apache on Ubuntu

sudo -i
apt update -y && apt install apache2 -y
systemctl enable --now apache2
echo "<h1>Hello from EC2</h1>" > /var/www/html/index.html

Common mistakes

  • Port 80 not open in the security group.
  • Skipping apt update before installing.
  • Saving index.html.txt on Windows.
  • Running rm -rf without checking pwd.

Day 12 →

Created by Ajeetkumar · EasyLearnSpace