# My Linux Learning Week: Essential Commands I Practiced on AWS EC2

*Five days of hands-on Linux practice covering file archiving, networking, HTTP tools, system monitoring, and text processing.*

## Introduction

Linux is an important part of cloud infrastructure and DevOps engineering. Many cloud workloads run on Linux servers, making Linux knowledge valuable for managing infrastructure, troubleshooting problems, and maintaining applications.

I continued my Linux learning journey by practicing commands on an AWS EC2 Ubuntu instance.

Instead of only learning command syntax, I focused on running commands, observing their output, and understanding their practical applications.

In this blog, I'm sharing the commands I practiced and the concepts I learned throughout the week.

## Day 1: File Archiving and Remote File Transfer

### 1\. `tar` — Archiving and Compression

The `tar` command is used to combine multiple files and directories into a single archive. It can also work with compression utilities such as gzip.

**Creating a compressed archive:**

```bash
tar -cvzf cloud.tar.gz cloud/
```

Options explained:

- `c` – Create a new archive.
- `v` – Display files being processed.
- `z` – Compress using gzip.
- `f` – Specify the archive filename.

**Extracting an archive:**

```bash
tar -xvzf cloud.tar.gz
```

- `x` – Extract files.
- `v` – Display extraction details.
- `z` – Decompress gzip archive.
- `f` – Specify the archive filename.

**Practical application:** Creating backups, packaging application files, and preparing directories for transfer.

### 2\. `scp` — Secure Copy

The `scp` command transfers files and directories between local and remote machines using SSH.

I practiced transferring an entire directory from an AWS EC2 instance to my local machine.

```bash
scp -i key.pem -r ubuntu@<EC2-HOST>:/home/ubuntu/linux .
```

Options explained:

- `-i` – Specifies the SSH private key.
- `-r` – Copies directories recursively.
- `ubuntu@<EC2-HOST>` – Remote username and server address.
- `/home/ubuntu/linux` – Source directory.
- `.` – Destination is the current local directory.

**Practical application:** Transferring application files, configuration files, and other resources between servers.

## Day 2: Network Diagnostics and Configuration

Networking is essential when working with cloud infrastructure. Linux provides several utilities to inspect network interfaces, test connectivity, and troubleshoot communication problems.

Here are the commands I practiced.

### 1\. `ping` — Network Connectivity

```bash
ping youtube.com
```

The `ping` command sends ICMP Echo Request packets and measures the round-trip time of responses.

It helps check whether a destination is reachable and provides basic latency information.

### 2\. `tracepath` — Network Path Tracing

```bash
tracepath google.com
```

This command displays the network path towards a destination by identifying intermediate hops.

It can also provide Path MTU information, which helps understand packet-size limitations along the route.

### 3\. `netstat` — Network Statistics

```bash
netstat -tuln
```

The `netstat` utility displays network information such as connections, listening ports, and network statistics.

Options:

- `t` – TCP connections.
- `u` – UDP connections.
- `l` – Listening sockets.
- `n` – Display numerical addresses and ports.

It is useful for inspecting network services and listening ports.

### 4\. `mtr` — Network Diagnostics

```bash
mtr youtube.com
```

`mtr` (My Traceroute) combines functionality similar to `ping` and traceroute.

It continuously displays information about network hops, including:

- Packet loss percentage.
- Average latency.
- Best and worst response times.
- Number of packets sent.

I found this particularly interesting because it allowed me to observe network performance as it updated.

### 5\. `whois` — Domain Registration Information

```bash
whois google.com
```

The `whois` command retrieves publicly available domain registration information.

It can display details such as:

- Domain registrar.
- Registration and expiry dates.
- Name servers.
- Domain registration status.

This was an interesting way to explore publicly available domain information.

### 6\. `ip address show` — Network Interfaces

```bash
ip address show
```

This command displays network interfaces and their assigned IP addresses.

Some common interface types include:

- `lo` – Loopback interface.
- `eth0` – Ethernet interface.
- `docker0` – Docker bridge interface, when Docker is installed.

It helps understand how network interfaces are configured on a Linux machine.

### 7\. `iw` — Wireless Network Information

```bash
iw dev
```

The `iw` utility is used to inspect and configure wireless devices on Linux.

It can display wireless interfaces and their properties.

### 8\. `ss` — Socket Statistics

```bash
ss -tuln
```

The `ss` command displays socket information, including TCP and UDP sockets and listening ports.

It is a modern alternative to many common `netstat` operations.

**My takeaway from Day 2:** These tools helped me understand how Linux systems communicate with other machines and how to inspect network-related information.

## Day 3: HTTP and Web Tools

This day focused on interacting with web servers and network services directly from the Linux terminal.

### 1\. `telnet` — Testing TCP Connections

```bash
telnet google.com 80
```

The `telnet` command can establish a TCP connection to a specified host and port.

I used it to test connectivity to a web server on port 80.

It also helped me understand that HTTP communication can be exchanged over a TCP connection using a text-based request.

### 2\. `curl` — Transferring Data

```bash
curl https://example.com
```

The `curl` command transfers data to and from URLs.

It supports multiple protocols and is commonly used for testing APIs and interacting with web services.

For an HTTP GET request:

```bash
curl -X GET https://example.com
```

For formatted JSON output:

```bash
curl -s https://api.example.com/users | jq
```

Here:

- `-s` – Silent mode.
- `|` – Sends the output to another command.
- `jq` – Formats and processes JSON data.

### 3\. `wget` — Downloading Files

```bash
wget https://example.com/file.pdf
```

The `wget` command downloads files from web servers.

It is useful for downloading resources directly from the terminal and automating downloads through scripts.

**My takeaway from Day 3:** I became more comfortable interacting with web resources without depending on a graphical browser.

## Day 4: System Monitoring with `top`

### `top` — Real-Time Process Monitoring

```bash
top
```

The `top` command provides a continuously updated view of system processes and resource utilization.

During practice, I explored:

**1\. CPU usage**

Displays CPU utilization and idle time.

**2\. Memory usage**

Shows information about total, free, used, and available memory.

**3\. Process information**

Displays running and sleeping processes, along with their process IDs.

**4\. Resource consumption**

Helps identify processes consuming CPU and memory resources.

I also observed processes such as:

- `nginx`
- `systemd`
- `cron`
- `dbus-daemon`

Understanding these processes gave me a better idea of what runs in the background on a Linux server.

**Practical application:** Monitoring server performance and identifying resource-intensive processes.

## Day 5: Text Processing and Log Analysis

This was one of the most interesting parts of my learning week.

Linux provides powerful text-processing utilities that help administrators and DevOps engineers inspect application logs, filter information, and process text files.

I practiced three important commands: `grep`, `awk`, and `sed`.

### 1\. `grep` — Searching Text

The `grep` command searches for matching patterns in files.

**Search for INFO entries:**

```bash
grep INFO app.log
```

**Perform a case-insensitive search:**

```bash
grep -i info app.log
```

**Count matching lines:**

```bash
grep -c INFO app.log
```

My practice result was:

```text
15
```

This meant that 15 lines contained the matching INFO pattern.

### 2\. `awk` — Pattern Scanning and Processing

The `awk` command is a powerful text-processing language.

It can search patterns, extract fields, and generate reports from structured text.

**Display lines containing INFO:**

```bash
awk '/INFO/ {print}' app.log
```

**Display DEBUG entries:**

```bash
awk '/DEBUG/ {print}' app.log
```

One useful feature of `awk` is its ability to access individual fields.

For example:

```bash
awk '{print $1, $2}' app.log
```

This prints the first and second whitespace-separated fields from each line.

### 3\. `sed` — Stream Editor

The `sed` command processes text streams and performs operations such as substitution.

**Replace INFO with DEBUG in the output:**

```bash
sed 's/INFO/DEBUG/g' app.log
```

Explanation:

- `s` – Substitute.
- `INFO` – Search pattern.
- `DEBUG` – Replacement text.
- `g` – Replace all matching occurrences on each line.

By default, this displays the modified output without changing the original file.

**Practical application:** Modifying text, processing configuration files, and transforming log data.

## Key Lessons from This Week

After five days of hands-on practice, here are my biggest takeaways:

1. **File management is more than creating and deleting files.** Archiving and securely transferring data are important server administration tasks.
2. **Networking knowledge is essential.** Commands like `ping`, `mtr`, `ip`, and `ss` help investigate connectivity and network configuration.
3. **The terminal can interact with web services.** Tools like `curl` and `wget` are useful when working with APIs and remote resources.
4. **System monitoring matters.** Understanding CPU, memory, and processes helps when managing cloud servers.
5. **Text-processing tools are powerful.** `grep`, `awk`, and `sed` are valuable for working with application logs and configuration files.

Most importantly, I realized that understanding what a command does is more valuable than simply memorizing its syntax.

**Learning one concept at a time, practicing consistently, and building strong fundamentals.** 🚀

If you're also learning Linux, Cloud Computing, or DevOps, I'd love to connect and learn from your experiences.

---

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/e58caf09-fe29-41d2-8579-dcc7e8b7d9ae.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/8f2703c1-1bdf-4790-aabb-51c45d0f1785.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/ecf424ba-504d-44c9-b706-3bd88eb0782d.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/3464dbf2-5f5c-4415-a9df-6df6a6a3317f.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/946071bb-bea9-4067-bb4a-df12e003cee9.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/000d8145-c304-45c6-b00d-ea32ab5aa957.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/44a96179-2e70-4a06-a9e9-12ea27719d45.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/68349ede-e9fd-422b-9349-07574dcb5ee2.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/75a37ba1-94b1-42c1-94c1-c7a32aa8b8d3.png align="center")

![](https://cdn.hashnode.com/uploads/covers/6a92622364e613a4d641d3de/8bc0c54e-794d-45c0-8360-d0dd0277b478.png align="center")

Linux

DevOps

AWS

Cloud Computing

Beginners
