Tools: Day -2 : Essential Linux File System Knowledge for DevOps Engineers. - Expert Insights
⚙️ Best Practices for DevOps Work As a DevOps engineer, understanding the Linux file system is non‑negotiable. It’s the foundation of where you store code, configure services, check logs, and deploy applications. In this post, I’ll walk you through the most important directories, their purposes, and how you should use them in daily DevOps work. 🏠 User Workspaces vs System Areas 📂 Key Directories Every DevOps Engineer Must Know
/home/Purpose: User’s personal workspaceDevOps Usage: Store project code, scripts, configsExample Commands:cd ~cd /home/ubuntu /rootPurpose: Root user’s home directoryDevOps Usage: Reserved for admin tasks, not codingExample Commands:sudo su -cd /root /etcPurpose: System configuration filesDevOps Usage: Manage service configs (Nginx, SSH, systemd)Example Commands:cd /etc/nginxnano /etc/ssh/sshd_config /var/logPurpose: System and application logsDevOps Usage: Debug services, monitor errorsExample Commands:tail -f /var/log/syslogless /var/log/nginx/error.log /var/wwwPurpose: Web server filesDevOps Usage: Deploy websites and applicationsExample Commands:cd /var/www/htmlgit clone /usr/binPurpose: User binaries (commands available to all users)DevOps Usage: Run system commands like ls, grep, etc.Example Commands:ls /usr/bin /binPurpose: Essential binaries for boot and recoveryDevOps Usage: Core commands like cat, cp, mvExample Commands:ls /bin /sbinPurpose: System binaries for admin tasksDevOps Usage: Commands like shutdown, mountExample Commands:ls /sbinshutdown -h now /optPurpose: Optional software packagesDevOps Usage: Install custom tools or third‑party appsExample Commands:cd /opt /tmpPurpose: Temporary files (cleared on reboot)DevOps Usage: Scratch space for testing or temporary storageExample Commands:cd /tmp /devPurpose: Device filesDevOps Usage: Interfaces to hardware (disks, terminals)Example Commands:ls /dev/sdals /dev/tty /procPurpose: Virtual filesystem with process and kernel infoDevOps Usage: Check CPU, memory, and process detailsExample Commands:cat /proc/cpuinfocat /proc/meminfo /mnt and /mediaPurpose: Mount points for external drivesDevOps Usage: Access USBs, external disksExample Commands:cd /mntls /media/ubuntu One‑liners for each directory (quick reference)./home → user workspace/root → root’s home/etc → configs/var/log → logs/var/www → web apps/usr/bin → user binaries/bin → essential binaries/sbin → admin binaries/opt → optional software/tmp → temporary files/dev → devices/proc → process info/mnt,/media → mount points Workspace: Keep your project repos inside /home/ubuntu. Example: mkdir myproject && cd myproject && git initSystem Configs: Edit service configs in /etc using sudo. Example: sudo nano /etc/nginx/nginx.confLogs: Monitor logs in /var/log for debugging. Example: tail -f /var/log/syslogDeployments: Place production code in /var/www. Example: sudo git clone <repo> /var/www/htmlInstallations: Use sudo apt install … — packages go into /usr/bin, /usr/lib, etc. Scratch Work: Use /tmp for temporary files. 📝 ConclusionFor a DevOps engineer, knowing the Linux file system is like knowing the map of a city. You need to know where to live (/home), where the government offices are (/etc), where the logs are kept (/var/log), and where the factories produce tools (/usr/bin). Once you master this structure, you’ll navigate servers confidently, troubleshoot faster, and deploy with precision. Templates let you quickly answer FAQs or store snippets for re-use. as well , this person and/or - User workspace (/home/): This is where you should keep your project code, scripts, and personal files. For example, if your username is ubuntu, your workspace is /home/ubuntu.- System areas (/etc, /var, /usr, etc.): These directories are reserved for configurations, logs, binaries, and deployments. You’ll often need sudo to work here because they affect the whole system.