DEV Community

Olatunde salami
Olatunde salami

Posted on

# Day 3 of My 30-Day Linux Challenge: Mastering Files and Directories

As part of my 30-day Linux Challenge to prepare for the RHCSA certification, Day 3 was all about learning how to manage files and directories in Linux. This is a core skill for any Linux administrator, and I’m excited to share what I’ve learned and how I’ll apply it on my certification journey.

What I Learned

On Day 3, I explored essential Linux commands for creating, managing, and deleting files and directories. Here’s a quick overview in simple terms:

  1. Creating Directories with mkdir:

    • Use mkdir <directory_name> to create a single folder.
    • Create multiple folders at once with mkdir <dir1> <dir2> <dir3>.
    • Make nested folders (a folder inside another) using mkdir -p <path/to/directory>.
  2. Creating Empty Files with touch:

    • The touch <file_name> command creates an empty file.
    • I can create multiple files at once, like touch file1.txt file2.txt.
  3. Working with Files Using cat:

    • The cat command helps create, read, or append text to files.
    • To create or write to a file: cat > file.txt, type text, and press Ctrl+D to save.
    • To read a file: cat file.txt.
    • To append text: cat >> file.txt.
  4. Copying Files and Directories with cp:

    • Use cp <source> <destination> to copy files or folders.
    • For example, cp -r folder1 folder2 copies a folder and its contents recursively.
  5. Deleting Files and Directories with rm:

    • The rm <file_name> command deletes a file.
    • To delete a folder and its contents: rm -r <directory>.
  6. Moving or Renaming with mv:

    • Move a file or folder with mv <source> <destination>.
    • Rename a file or folder using mv <old_name> <new_name>.

How I’ll Apply This for RHCSA

These commands are building blocks for managing Linux systems, which is a big part of the RHCSA exam. Here’s how I plan to use them in my journey:

  • Practice Daily: I’ll create a practice folder and experiment with creating, copying, moving, and deleting files and directories to build confidence.
  • Organize My Study Notes: I’ll use mkdir to create folders for each RHCSA topic and touch to make empty files for notes, keeping my study materials organized.
  • Simulate Real Tasks: The RHCSA exam includes practical tasks. I’ll practice scenarios like copying configuration files (cp), renaming them (mv), or cleaning up unused files (rm).
  • Understand File Management: Commands like cat will help me view and modify configuration files, which is crucial for system administration tasks on the exam.

Summary

Learning to manage files and directories is like learning to organize a digital workspace. It’s a foundational skill that makes me more efficient and prepares me for advanced topics like permissions and scripting. By mastering these commands, I’m one step closer to confidently tackling the RHCSA certification.

Day 3 has shown me how powerful Linux commands are for managing systems. I’m excited to keep practicing and building on these skills as I continue my 30-day challenge!

Top comments (0)