This tutorial covers the fundamental skills needed to get started in system administration. Learn about operating systems, user management, networking basics, system monitoring, and automation using shell scripts. Real-world examples and practice exercises are provided.

Beginner30 minutes

Step 1: Operating System Fundamentals

- Understand the role of an operating system

- Compare Linux, macOS and Windows for system administration

- Learn basic OS commands and navigation

- Practice with the command line interface

ls -l /etc

Practice Exercise

Write commands to:

  • Create a new directory called scripts in your home directory
  • Create a new empty file in scripts called sys_info.sh
  • Change the file permissions of sys_info.sh to be executable

Show Solution
1. mkdir ~/scripts
2. touch ~/scripts/sys_info.sh
3. chmod +x ~/scripts/sys_info.sh

Step 2: User and Group Management

- Create, modify and delete user accounts

- Understand Linux file permissions and ownership

- Manage groups and group membership

- Set and modify file permissions

useradd -m john

Practice Exercise

Write commands to:

  • Create a new user account named mike with default settings
  • Add mike to the existing group developers
  • Copy your scripts directory to mike's home directory
  • Change ownership of mike's scripts directory to mike

Show Solution
1. sudo useradd -m mike
2. sudo usermod -a -G developers mike 
3. sudo cp -r ~/scripts /home/mike
4. sudo chown -R mike:mike /home/mike/scripts

Step 3: Networking Basics

- Understand IP addresses, subnets, and ports

- Configure network interfaces

- Diagnose network connectivity issues

- Learn key networking commands

ip addr show

Practice Exercise

Write commands to:

  • Display your system's hostname
  • Show IP address and subnet mask of your ethernet interface
  • Ping google.com and show first 4 responses
  • Trace the route packets take to reach www.linkedin.com

Show Solution
1. hostname
2. ip addr show eth0
3. ping -c 4 google.com
4. traceroute www.linkedin.com

Step 4: System Monitoring Essentials

- Monitor CPU, memory and disk usage

- Check system logs for errors

- Set up basic performance monitoring

- Learn to use tools like top, df, and tail

top -c

Practice Exercise

Write commands to:

  • Display top 5 processes consuming the most memory
  • Show current disk usage of your home directory
  • Monitor system logs in real-time for error messages
  • Save error messages from system logs to a file called errors.log in your scripts directory

Show Solution
1. ps aux --sort=-%mem | head -n 6
2. du -sh ~
3. sudo tail -f /var/log/syslog | grep --color -i error
4. sudo grep -i error /var/log/syslog > ~/scripts/errors.log

Step 5: Automation with Shell Scripts

- Understand basic shell script syntax

- Learn concepts like variables, conditions, and loops

- Automate repetitive tasks with simple scripts

- Schedule scripts with cron

#!/bin/bash
echo "Hello, $USER"

Practice Exercise

Write a shell script to:

  • Print "System Info Report" followed by the current date and time
  • Save the output of the top command to a file called top_output.txt in the current directory
  • Append the disk usage of the / directory to the same file on the next line
  • Print "Report generated!" when done
Bonus: Schedule the script to run daily at 8am using crontab

Show Solution
#!/bin/bash
echo "System Info Report"
date
top -n 1 -b > top_output.txt
du -sh / >> top_output.txt
echo "Report generated!"
```

To schedule in crontab:
`0 8 * * * /path/to/script.sh`

Sign in to take Cornell notes on this lesson — they save automatically and stay with your account.

Sign in

Click to access the login or register cheese