Foundation for DevOps Engineers
Day 3: Shell, Files, and Scripting
Free, customizable, and community-driven
Reliable for servers and production systems
Powerful scripting and command-line tools
Powers most cloud infrastructure
ls -la - List files with details
cd /path/to/dir - Change directory
pwd - Print working directory
cat file.txt - Display file contents
grep "pattern" file - Search in files
chmod 755 script.sh - Change permissions
chown user:group file - Change ownership
ps aux - List all processes
top - Real-time process monitor
kill PID - Terminate process
systemctl status nginx - Check service status
systemctl restart nginx - Restart service
#!/bin/bash
# Variables
NAME="DevOps"
echo "Hello, $NAME"
# Conditionals
if [ -f "file.txt" ]; then
echo "File exists"
fi
# Loops
for i in {1..5}; do
echo "Number: $i"
done