COM320 Computer Networks - Explore Linux in Your Browser

To get started with Linux, you can use a browser-based Linux virtual machine. Click the link below to access it:

https://bellard.org/jslinux/vm.html?url=alpine-x86.cfg&mem=192

Having access to a 'portable' free online Linux version can be useful in your future. Once the terminal loads, follow the tutorial below to learn essential Linux commands.

What is Linux and Why is it Popular?

Linux is an open-source operating system first developed by Linus Torvalds in 1991. Unlike proprietary systems like Windows or macOS, Linux’s source code is freely available, allowing anyone to modify and distribute it. This openness has led to a vast ecosystem of distributions (or "distros") like Ubuntu, Fedora, and Alpine, each tailored to specific needs. Linux powers a wide range of devices, from servers and supercomputers to smartphones and embedded systems.

Its popularity comes from several strengths: it’s free, highly customizable, and known for stability and security. The global community of developers continuously improves it, making it a reliable choice for both hobbyists and enterprises. Linux also excels in performance, running efficiently on everything from old hardware to cutting-edge systems, which explains its widespread adoption across industries.

Linux in Computer Networking

Linux is a cornerstone of modern computer networking. It runs most of the internet’s servers, including those hosting websites, cloud services, and DNS systems. Its built-in tools, like iptables for firewalls, ssh for secure remote access, and tcpdump for packet analysis, make it a go-to for network administrators. Linux’s ability to handle high network loads with low resource use is unmatched, especially in lightweight distros like Alpine.

In networking, Linux is used for routing, load balancing, and even as the foundation for software-defined networking (SDN). Its flexibility allows it to be deployed in data centers, IoT devices, and containers (e.g., Docker), where efficient network communication is critical. This versatility and robustness make Linux indispensable in today’s connected world.

40-Step Linux Command Tutorial

Follow these commands in the Linux terminal to learn the basics and progress to networking. Type each command and press Enter to see the result.

  1. whoami - Shows your current username (should be "root").
  2. pwd - Displays your current directory path.
  3. ls - Lists files.
  4. cd / - Moves to the root directory.
  5. ls -l - Lists files with details (or dir).
  6. mkdir myfolder - Creates a directory named "myfolder".
  7. cd myfolder - Enters "myfolder".
  8. touch file.txt - Creates an empty file named "file.txt".
  9. echo "Test text" > file.txt - Writes "Test text" to "file.txt".
  10. cat file.txt - Displays the contents of "file.txt".
  11. cp file.txt file2.txt - Copies "file.txt" to "file2.txt".
  12. mv file2.txt newfile.txt - Renames "file2.txt" to "newfile.txt".
  13. rm newfile.txt - Deletes "newfile.txt".
  14. cd .. - Moves up one directory level.
  15. rmdir myfolder - Removes "myfolder" (must be empty).
  16. clear - Clears the terminal screen.
  17. date - Shows the current date and time.
  18. uptime - Displays system uptime.
  19. uname -r - Shows the kernel version.
  20. df -h - Displays disk usage in a readable format.
  21. free - Shows memory usage.
  22. top - Monitors running processes (press q to exit).
  23. ps aux - Lists all running processes.
  24. kill [PID] - Stops a process by its PID (find PID with ps).
  25. echo $PATH - Shows the directories in your PATH variable.
  26. which echo - Locates the "echo" command’s binary.
  27. chmod 644 file.txt - Sets permissions on "file.txt".
  28. chown root file.txt - Changes "file.txt" ownership to root.
  29. passwd - Sets a new password for root (follow prompts).
  30. hostname - Displays the system’s hostname.
  31. ifconfig - Shows network interfaces (or use ip addr).
  32. ip addr - Lists IP addresses and network interfaces.
  33. ping 8.8.8.8 - Tests connectivity to Google’s DNS (Ctrl+C to stop).
  34. nc -zv google.com 443 - Test connection to https port on Google.
  35. uptime - Check how long the system has been up (running).
  36. nslookup google.com - Resolves a domain.
  37. curl https://kevincurran.org - Fetches a webpage.
  38. wget http://kevincurran.org/com320/labs/HTML-JavaScript.pdf - Downloads a webpage or online resource.
  39. route - Shows the routing table (or use ip route).
  40. ip route - Displays the routing table (modern alternative).

Note: If a command fails, try the next one.