Linux Basics - Commands, File System, Users & Permissions
60 Days DevOps Challenge: Day 1
Table of contents
- Challenge 1: List all files (including hidden ones) in your home directory and sort them by modification time.
- Challenge 2: Create a directory named devops_challenge_Day1, navigate into it, and create an empty file named day1.txt.
- Challenge 3: Find the total disk usage of the /var/log directory in human-readable format.
- Challenge 4: Create a new user called devops_user and add them to the sudo group.
- Challenge 5: Create a group called devops_team and add devops_user to that group.
- Challenge 6: Change the permissions of day1.txt to allow only the owner to read and write, but no permissions for others.
- Challenge 7: Find all files in /etc that were modified in the last 7 days.
- Challenge 8: Write a one-liner command to find the most frequently used command in your shell history.
- Topics Covered Today
Challenge 1: List all files (including hidden ones) in your home directory and sort them by modification time.
Goal: Learn how to list files with detailed information and sort them by modification time.
Challenge 2: Create a directory named devops_challenge_Day1
, navigate into it, and create an empty file named day1.txt
.
Goal: Practice creating directories and files and navigating the filesystem.
Challenge 3: Find the total disk usage of the /var/log
directory in human-readable format.
Goal: Understand how to check disk usage of directories in a readable format.
Challenge 4: Create a new user called devops_user
and add them to the sudo
group.
Goal: Learn how to create users and grant them administrative privileges.
Challenge 5: Create a group called devops_team
and add devops_user
to that group.
Goal: Understand how to create groups and manage user group memberships.
Challenge 6: Change the permissions of day1.txt
to allow only the owner to read and write, but no permissions for others.
Goal: Learn how to modify file permissions to control access.
Challenge 7: Find all files in /etc
that were modified in the last 7 days.
Goal: Practice using the
find
command to locate files based on modification time.
Challenge 8: Write a one-liner command to find the most frequently used command in your shell history.
Goal: Learn how to analyze shell history to identify frequently used commands.
Topics Covered Today
Basic Shell Commands:
cd
,ls
,cat
Filesystem Hierarchy:
/etc
,/var
,/home
File Permissions:
chmod
,chown
,ls -l
Users & Groups: Creating users, managing groups, assigning permissions