Linux Administration · Lesson 1 of 5
The filesystem and where things live
Know where to look before you need to.
Linux puts things in predictable places, and knowing them turns most problems into a short search.
Configuration lives in /etc. Web server settings, SSH settings, cron jobs, the list of users. When something is configured wrongly, this is where it is configured.
Variable data lives in /var. Logs in /var/log, web content often in /var/www, mail and spool files. When a disk fills up, /var is nearly always the reason, and usually a log file nobody rotated.
Programs live in /usr/bin and /usr/local/bin, the second being for things you installed yourself rather than through the package manager.
Home directories in /home, except root, which has /root.
Temporary files in /tmp, cleared on reboot, which is a property people forget when they leave something important there.
The process and system views, /proc and /sys, are not real files. They are the kernel exposing its state as if they were, which is how tools read memory and CPU information.
Two ideas underneath everything. Almost everything is a file, including devices and, through /proc, running processes. And configuration is plain text, which means you can read it, copy it, put it in version control and diff it against a working server.
Before you change any configuration file, copy it with the date in the name. When the service will not start at eleven at night, that copy is how you get back to a working state in ten seconds.
Find which directory is using the most space on a machine you have access to. If it is /var/log, find out which file and why.
کسی مشین پر معلوم کریں کہ کون سی ڈائریکٹری سب سے زیادہ جگہ لے رہی ہے۔ اگر /var/log ہے تو معلوم کریں کون سی فائل اور کیوں۔
Check what you learned
Create your free BvLogic ID to take the quiz and record your score.
Create your BvLogic ID