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:
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:
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.
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
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
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
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
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
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
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
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
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
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
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:
curl -X GET https://example.com
For formatted JSON output:
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
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
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:
nginxsystemdcrondbus-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:
grep INFO app.log
Perform a case-insensitive search:
grep -i info app.log
Count matching lines:
grep -c INFO app.log
My practice result was:
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:
awk '/INFO/ {print}' app.log
Display DEBUG entries:
awk '/DEBUG/ {print}' app.log
One useful feature of awk is its ability to access individual fields.
For example:
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:
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:
- File management is more than creating and deleting files. Archiving and securely transferring data are important server administration tasks.
- Networking knowledge is essential. Commands like
ping,mtr,ip, andsshelp investigate connectivity and network configuration. - The terminal can interact with web services. Tools like
curlandwgetare useful when working with APIs and remote resources. - System monitoring matters. Understanding CPU, memory, and processes helps when managing cloud servers.
- Text-processing tools are powerful.
grep,awk, andsedare 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.
Linux
DevOps
AWS
Cloud Computing
Beginners
About the author
- I am a BCA graduate actively building expertise in Cloud Infrastructure Engineering
Comments
Join the discussionNo comments yet. Be the first to comment.
