Learn the Linux Fundamentals - Part 3
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:
- Download a Linux distribution (e.g., Ubuntu, CentOS).
- Use virtualization software (e.g., VirtualBox, VMware) to create a new VM.
- Allocate resources (CPU, RAM) as needed.
- 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 andCTRL + X
to exit.
- Open a file with
- Vim: More advanced with a steeper learning curve.
- Start with
vim filename.txt
. - Press
i
to enter insert mode, type your text, and pressESC
to return to command mode. - Save changes with
:w
and exit with:q
.
- Start with
- Nano: User-friendly and simple.
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
.
- Example:
- find: Locate files and directories.
- Example:
find /path/to/search -name "filename.txt"
.
- Example:
- tar: Archive files for easier handling.
- Example:
tar -cvf archive.tar /path/to/directory
.
- Example:
- grep: Search for text in files.
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
orhtop
.
- Use the
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.
- Edit the cron table with
- Utilize cron jobs for scheduled tasks:
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
.
- Update package lists:
- For Red Hat-based distributions, use YUM or DNF:
- Install a package:
sudo dnf install package_name
.
- Install a package:
- For Debian-based distributions (like Ubuntu), use APT:
Step 8: System Logs
- Understand the importance of system logs for troubleshooting:
- Access logs in
/var/log/
directory. - Use
less
ortail
to view logs:- Example:
tail -f /var/log/syslog
to view the system log in real-time.
- Example:
- Access logs in
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.