Become an Awe$ome Linux SysAdmin In Under 2 Hours
Table of Contents
Introduction
This tutorial is designed to help you become a proficient Linux System Administrator by guiding you through essential Linux commands and concepts. Whether you're a beginner or looking to enhance your skills, this step-by-step guide will equip you with the knowledge to navigate the Command Line Interface (CLI) effectively.
Step 1: Learn Basic Linux CLI Commands
Familiarize yourself with fundamental commands that are essential for navigating and managing a Linux system.
-
List Files and Directories
- Command:
ls
- Use: Displays files in the current directory.
- Command:
-
Change Directory
- Command:
cd [directory_name]
- Use: Moves you into the specified directory.
- Command:
-
Print Working Directory
- Command:
pwd
- Use: Shows the current directory path.
- Command:
-
Create a Directory
- Command:
mkdir [directory_name]
- Use: Creates a new directory.
- Command:
-
Remove a Directory
- Command:
rmdir [directory_name]
- Use: Deletes an empty directory.
- Command:
Step 2: Master System Navigation Commands
Understanding how to navigate your system efficiently is crucial for any sysadmin.
-
View File Content
- Command:
cat [file_name]
- Use: Displays the content of a file.
- Command:
-
Copy Files
- Command:
cp [source] [destination]
- Use: Copies files from one location to another.
- Command:
-
Move or Rename Files
- Command:
mv [source] [destination]
- Use: Moves or renames a file.
- Command:
-
Remove Files
- Command:
rm [file_name]
- Use: Deletes a specified file.
- Command:
Step 3: Perform System Operations
Learn commands that allow you to perform various system operations.
-
Check Disk Usage
- Command:
df -h
- Use: Displays disk space usage in a human-readable format.
- Command:
-
Monitor Resource Usage
- Command:
top
- Use: Shows real-time system resource usage.
- Command:
-
Shutdown the System
- Command:
sudo shutdown now
- Use: Immediately shuts down the system.
- Command:
Step 4: Finding and Searching for Files
Efficiently locating files on your system is key to efficient management.
-
Find Files by Name
- Command:
find /path/to/search -name [file_name]
- Use: Searches for files by name.
- Command:
-
Search Within Files
- Command:
grep [search_term] [file_name]
- Use: Searches for a specific term within a file.
- Command:
Step 5: Find Users and Files by User Permissions
Understanding and managing user permissions is vital for system security.
-
View User Permissions
- Command:
ls -l
- Use: Displays file permissions alongside the list of files.
- Command:
-
Check User Information
- Command:
id [username]
- Use: Displays user ID and group information.
- Command:
Step 6: Modifying Permissions
Learn how to modify file and directory permissions.
-
Change File Permissions
- Command:
chmod [permissions] [file_name]
- Use: Adjusts permissions for a file (e.g.,
chmod 755 script.sh
).
- Command:
-
Change File Ownership
- Command:
chown [user]:[group] [file_name]
- Use: Changes the owner and group of a file.
- Command:
Step 7: User Provisioning and Modification
Managing user accounts is essential for controlling access to your system.
-
Add a New User
- Command:
sudo adduser [username]
- Use: Creates a new user account.
- Command:
-
Modify an Existing User
- Command:
sudo usermod -aG [group] [username]
- Use: Adds a user to a specified group.
- Command:
-
Delete a User
- Command:
sudo deluser [username]
- Use: Removes a user account.
- Command:
Conclusion
By mastering these essential Linux commands and operations, you are well on your way to becoming a competent Linux System Administrator. Keep practicing these commands, and consider exploring advanced topics such as scripting and network management for further development. Your journey in Linux administration has just begun!