🎉 BLACK FRIDAY SALE! 40% OFF on Annual Premium+ Plan - Till 7th Dec! Code SUPERSALE40 Shop Now →
course
Lab Activity

Finding and Comparing Files

Learn how to search for files and compare their contents using the core LFCS file-discovery and comparison tools.

Overview

In this lab you'll work with the file discovery and comparison tools the LFCS exam expects you to know well. You'll practice searching for files by name, type, size, permissions and modification time, and you'll learn how to use commands like find, locate, which and whereis to track down files anywhere on the system. You'll also compare file contents using diff, cmp and comm so you can spot changes quickly. These skills show up constantly in real administration work and are a core part of LFCS performance tasks.

Learning Outcomes

By the end of this lab, you'll be able to:

  • Search for files using find with filters like name, type, size, permissions and timestamps.
  • Use locate for fast database-based searches.
  • Identify command paths using which, whereis and type.
  • Compare files line-by-line using diff and its common options.
  • Perform byte-level comparisons with cmp.
  • Use comm to compare sorted files and understand their differences.
  • Combine multiple search criteria to locate files efficiently.

Key Concepts

  • File Discovery Tools: find, locate, which, whereis and type help identify where files live and how the system uses them.
  • Find Filters: Options like -name, -type, -size, -perm, -mtime and -exec help narrow down results.
  • Locate Database: Fast searching that relies on an indexed filesystem list.
  • Path Resolution: Tools for identifying where executables and documentation are stored.
  • File Comparison: diff for line-based comparison, cmp for binary differences and comm for comparing sorted lists.
  • Practical Use: Tracking down config files, verifying file changes and identifying differences during troubleshooting.

Why It Matters

  • Direct LFCS objective: file search and comparison tasks appear frequently in the exam.
  • Essential for troubleshooting: finding misconfigured or changed files is a daily admin skill.
  • Helps with audits and automation: knowing where files live reduces errors in scripts and configurations.
  • Speeds up workflow: fast searching makes you more effective on large systems.
  • Builds command-line fluency: these tools form the backbone of navigation and verification in Linux environments.
© LINUXCERT GURU, Singapore