Learn the Linux Fundamentals - Part 3

3 min read 4 months ago
Published on Aug 16, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial covers the fundamentals of Linux as presented in the TryHackMe video, "Learn the Linux Fundamentals - Part 3." It aims to provide a structured approach to deploying a Linux machine, utilizing terminal text editors, managing processes, and maintaining your system effectively. By following these steps, you will gain a better understanding of essential Linux operations and utilities.

Step 1: Introduction to Linux

  • Understand the purpose of Linux and its applications in various environments.
  • Familiarize yourself with basic Linux terminology to ease future learning.

Step 2: Deploy Your Linux Machine

  • Choose a platform or virtual machine (VM) to deploy your Linux environment.
  • Follow these steps to set up the VM:
    1. Download a Linux distribution (e.g., Ubuntu, CentOS).
    2. Use virtualization software (e.g., VirtualBox, VMware) to create a new VM.
    3. Allocate resources (CPU, RAM) as needed.
    4. Boot the VM and complete the installation prompts.

Step 3: Terminal Text Editors

  • Learn to navigate and use terminal text editors, which are essential for editing files in the Linux environment.
  • Common text editors include:
    • Nano: User-friendly and simple.
      • Open a file with nano filename.txt.
      • Use keyboard shortcuts like CTRL + O to save and CTRL + X to exit.
    • Vim: More advanced with a steeper learning curve.
      • Start with vim filename.txt.
      • Press i to enter insert mode, type your text, and press ESC to return to command mode.
      • Save changes with :w and exit with :q.

Step 4: General Useful Utilities

  • Familiarize yourself with useful command-line utilities that enhance productivity:
    • grep: Search for text in files.
      • Example: grep "search_term" filename.txt.
    • find: Locate files and directories.
      • Example: find /path/to/search -name "filename.txt".
    • tar: Archive files for easier handling.
      • Example: tar -cvf archive.tar /path/to/directory.

Step 5: Processes 101

  • Learn about managing processes in Linux:
    • Use the ps command to view running processes: ps aux.
    • To kill a process, use kill PID where PID is the process ID.
    • Monitor system performance with top or htop.

Step 6: Maintaining Your System Automation

  • Understand how to automate tasks to maintain your Linux system:
    • Utilize cron jobs for scheduled tasks:
      • Edit the cron table with crontab -e.
      • Add a job in the format: * * * * * command_to_execute, where the asterisks represent minute, hour, day, month, and day of the week.

Step 7: Package Management

  • Learn about package management systems to install and update software:
    • For Debian-based distributions (like Ubuntu), use APT:
      • Update package lists: sudo apt update.
      • Install a package: sudo apt install package_name.
    • For Red Hat-based distributions, use YUM or DNF:
      • Install a package: sudo dnf install package_name.

Step 8: System Logs

  • Understand the importance of system logs for troubleshooting:
    • Access logs in /var/log/ directory.
    • Use less or tail to view logs:
      • Example: tail -f /var/log/syslog to view the system log in real-time.

Conclusion

In this tutorial, you have learned the key fundamentals of Linux, including deploying a Linux machine, using terminal text editors, managing processes, and maintaining your system through automation and package management. As a next step, consider exploring more advanced topics or practicing these commands to build your proficiency in using Linux. For further learning, visit TryHackMe for additional resources and challenges.