LINUX FOR NETWORK ENGINEER _ LINUX BASICS
LINUX FOR NETWORK ENGINEER _ LINUX BASICS
ENGINEER
LINUX BASICS
21-APRIL-2025
STRUCTURE
LINUX
WHY LINUX?
In this guide, we’ll explore everything from distro selection to permissions, from scripting to
automation.
There are hundreds of Linux distributions. Here’s how to choose based on purpose:
Example: Want to use Ansible, Git, Docker? Go for Ubuntu 22.04 LTS.
Installation tools:
A network engineer often needs to modify configuration files, create scripts, or troubleshoot logs.
That’s where text editors come in.
nano /etc/network/interfaces
• Ctrl+O: Save
• Ctrl+X: Exit
vim /etc/hosts
• i: Insert mode
• Esc: Exit insert
• :wq: Save and quit
Use Vim for remote SSH sessions; use VS Code for local DevOps scripting.
Brace expansion:
man -k network
/
├── bin/ → Essential binaries (e.g., ls, cp)
├── etc/ → System configs (e.g., networking)
├── home/ → User home directories
├── root/ → Root user’s home
├── usr/ → User applications
├── var/ → Logs, spools
├── tmp/ → Temporary files
├── dev/ → Devices (e.g., /dev/sda)
Commands:
df -h # Disk usage
du -sh * # Size of current dir
mount # Mounted filesystems
/etc/ is critical for sysadmins and neteng — store configs like DNS, network, sshd.
Meaning:
• - : Regular file
• rwx : Owner can read/write/execute
• r-x : Group can read/execute
• r-- : Others can only read
Ownership Commands:
cp file.txt /backup/
cp -r configs/ /etc/ # Recursive copy
Move files
mv file.txt /var/tmp/
mv *.log /var/logs/
Delete files
rm file.txt
rm -rf /tmp/old_logs/
Create users:
Groups:
File to know:
View info:
id netadmin
groups netadmin
SYMBOLIC MODE:
chmod u+x script.sh # Add execute to user
chmod go-rwx file.txt # Remove all access from group and others
View Processes:
Kill Processes:
Background Jobs:
./long_job.sh &
jobs
fg %1 # Resume job
nohup and screen let you run persistent processes over SSH.
INSTALLING PACKAGES
APT (Debian/Ubuntu)
module(load="imudp")
input(type="imudp" port="514")
Restart:
Check logs:
tail -f /var/log/syslog
#!/bin/bash
echo "Checking all interfaces..."
ip -brief addr show | grep -v lo | while read line; do
echo $line
done
Save it as interfaces.sh:
chmod +x interfaces.sh
./interfaces.sh
Automate:
crontab -e
# Add:
0 7 * * * /home/user/scripts/interfaces.sh >> /home/user/logs/report.log
• Mastered Linux distributions and picked the right one for network and automation labs
• Gained fluency in navigation, file systems, and file permissions — the backbone of Linux
• Learned how to create, move, edit, and search through files like a sysadmin
• Understood how users, groups, and permissions work — critical for securing multi-user
environments
• Used real-world networking tools: tcpdump, nmap, iperf, rsyslog, and even wrote your first
bash script
• Practiced package management, process handling, and text editing with confidence
In today's world, networking is not just cables and routing protocols — it’s automation,
configuration management, cloud provisioning, container orchestration, and observability. And behind
all of that? Linux.
Whether you're: