Comprehensive file system management is pivotal in Linux system administration to organize, control, and maintain data efficiently and securely. This involves understanding the hierarchy, navigating directories, managing files and permissions, monitoring disk usage, and maintaining file system health.
Linux File System Hierarchy
The Linux file system is structured as a single rooted tree starting from the root directory /.
Key directories include:
1. /bin: Essential user binaries.
2. /etc: Configuration files.
3. /home: User home directories.
4. /var: Variable files like logs.
5. /usr: User system resources and software.
6. /tmp: Temporary files.
This hierarchy supports modular management and access control.
Navigating the File System
The following commands are used for browsing and managing directories in Linux. They form the foundation of file system navigation.
1. pwd: Prints current working directory.
2. cd: Changes directory. Example: cd /home/user.
3. ls: Lists directory contents.
Options:
-l: Long format with permissions and file details.
-a: Includes hidden files.
-h: Human-readable sizes.
File and Directory Management
The following are essential commands used to manage files and directories in Linux. They help users create, move, copy, and remove data efficiently.
1. Creating:
2. Moving/Renaming: mv old_name new_name
3. Copying: cp source destination
4. Removing:
5. Finding Files: find /path -name filename
6. Symbolic and Hard Links: ln -s target linkname (symbolic link)
File Permissions and Ownership
Permissions define read, write, and execute rights for owner, group, and others.
Commands:
Use ls -l to display permissions and ownerships.
Disk Usage and Monitoring
Below are the core tools for viewing and managing disk space. They support proactive monitoring of file system capacity and health.
1. df: Shows disk space usage by file system.
2. du: Shows disk usage of files and directories.
3. Options for human-readable formats include -h.
4. Monitor file system health with commands like fsck.
File System Maintenance
The following commands are used to check, repair, and manage file systems. They support safe and consistent access to stored data.
1. Checking and repairing: Use fsck on unmounted partitions to check and repair errors.
2. Mounting and unmounting:
We have a sales campaign on our promoted courses and products. You can purchase 1 products at a discounted price up to 15% discount.