CIS126RH | RHEL System Administration 1
Mesa Community College
Learn the purpose of major directories in the hierarchy
Use absolute and relative paths effectively
Use pwd, cd, ls, and tree to explore the filesystem
Know where to find configs, logs, binaries, and data
The Filesystem Hierarchy Standard (FHS) defines the directory structure and contents in Unix-like operating systems. It provides predictability — administrators know where to find files regardless of which Linux distribution they use.
/) hierarchy/) is different from the root user's home directory (/root).
| Directory | Purpose | Examples |
|---|---|---|
| /bin | Essential user commands | ls, cp, mv, cat, bash |
| /sbin | Essential system binaries | fdisk, fsck, init, ip |
| /boot | Boot loader and kernel | vmlinuz, initramfs, grub2 |
| /dev | Device files | sda, tty, null, random |
| /etc | System configuration | passwd, fstab, ssh/sshd_config |
| /lib, /lib64 | Essential shared libraries | libc.so, ld-linux.so |
| Directory | Purpose | Examples |
|---|---|---|
| /home | User home directories | /home/student, /home/admin |
| /root | Root user's home directory | .bashrc, .ssh/ |
| /tmp | Temporary files (cleared on boot) | Session data, downloads |
| /var | Variable data | logs, mail, databases |
| /proc | Process and kernel information (virtual) | cpuinfo, meminfo, [pid]/ |
| /sys | Device and kernel information (virtual) | block/, class/, devices/ |
/usr (Unix System Resources) contains the majority of user applications, libraries, and documentation. It is often the largest directory on a system.
System and application log files
Application state data (databases, package info)
Queued data (print jobs, mail, cron)
Application cache data (dnf, man-db)
User account information
Filesystem mount configuration
SSH server and client configuration
Systemd unit file overrides
cp file file.bakVirtual filesystem. /proc/cpuinfo, /proc/meminfo, /proc/[pid]/ — queries kernel in real time
Virtual filesystem for device and driver information. Used for hardware configuration.
Runtime data since boot. PID files, sockets, tmpfs mounted. Cleared on reboot.
Temporary mount point for manual mounts. Convention for admin-mounted filesystems.
Mount point for removable media. USB drives, DVDs auto-mount here.
Optional software packages. Third-party applications often install here.
Starts from root (/)
Complete path to file
Works from anywhere
/home/student/documents/report.txt
Starts from current directory
Shorter to type
Context-dependent
documents/report.txt
# Absolute path — starts with /
cat /etc/passwd
cd /var/log
# Relative path — from current directory
[student@server ~]$ cd documents
[student@server documents]$ cat report.txt
# Special relative references
. # Current directory
.. # Parent directory
~ # Home directory
# Starting position: /home/student
[student@server ~]$ pwd
/home/student
# Relative navigation
[student@server ~]$ cd documents # → /home/student/documents
[student@server documents]$ cd .. # → /home/student
[student@server ~]$ cd ../admin # → /home/admin
[student@server admin]$ cd ~ # → /home/student
# Absolute navigation
[student@server ~]$ cd /var/log # → /var/log
[student@server log]$ cd /etc/ssh # → /etc/ssh
# Return to previous directory
[student@server ssh]$ cd - # → /var/log
/var/log
# pwd — Print Working Directory
pwd
/home/student
# cd — Change Directory
cd /var/log # Go to absolute path
cd log # Go to subdirectory (relative)
cd .. # Go to parent directory
cd ../.. # Go up two levels
cd # Go to home directory
cd ~ # Go to home directory (explicit)
cd ~username # Go to another user's home
cd - # Go to previous directory
cd /home/My Documents → ERROR (two arguments)cd "/home/My Documents" → Correct (quoted)cd /home/My\ Documents → Correct (escaped space)
# Basic listing
ls # List current directory
ls /etc # List specific directory
# Common options
ls -l # Long format (permissions, size, date)
ls -a # Show hidden files (starting with .)
ls -la # Long format + hidden files
ls -lh # Human-readable sizes (K, M, G)
ls -lt # Sort by modification time
ls -ltr # Sort by time, reversed (oldest first)
ls -R # Recursive listing
ls -d */ # List only directories
# Output example
ls -lh /etc/passwd
-rw-r--r--. 1 root root 2.3K Dec 1 10:30 /etc/passwd
-rw-r--r--. 1 root root 2.3K Dec 1 10:30 /etc/passwd
| Field | Example | Meaning |
|---|---|---|
| File type + permissions | -rw-r--r-- | Regular file; owner rw, others r |
| Link count | 1 | Number of hard links |
| Owner | root | User who owns the file |
| Group | root | Group that owns the file |
| Size | 2.3K | File size (with -h flag) |
| Modified | Dec 1 10:30 | Last modification date/time |
# Install tree if not present
sudo dnf install tree
# Basic tree view
tree /etc/ssh
/etc/ssh
├── moduli
├── ssh_config
├── ssh_config.d
│ └── 50-redhat.conf
├── sshd_config
└── sshd_config.d
└── 50-redhat.conf
# Useful options
tree -L 2 # Limit depth to 2 levels
tree -d # Directories only
tree -a # Show hidden files
tree -h # Show file sizes
tree -p # Show permissions
tree --dirsfirst # Directories before files
# Where am I?
pwd
# What's here?
ls -la
# Where is a command located?
which python
/usr/bin/python
whereis bash
bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz
# Find a file (fast — uses database)
locate passwd
# Find a file (thorough — searches live filesystem)
find /etc -name "passwd"
# What type of content is this?
file /etc/passwd
/etc/passwd: ASCII text
Tab completion automatically completes commands, paths, and filenames when you press the Tab key — saving time and preventing typos.
# Type partial path, press Tab to complete
cd /etc/sys[TAB]
cd /etc/sysconfig/ # Completed!
# Multiple matches? Press Tab twice to list
cd /etc/sys[TAB][TAB]
sysconfig/ sysctl.conf sysctl.d/ systemd/
# Works with commands too
syste[TAB]
systemctl # Completed!
# And with options (with bash-completion)
systemctl st[TAB][TAB]
start status stop
The FHS provides a consistent directory structure across Linux systems
Absolute paths start with /, relative paths start from the current directory
Key commands: pwd cd ls tree
Know where to find: /etc (config), /var/log (logs), /home (users), /usr (programs)