Day 3 of the 90DaysOfDevOps Challenge: Exploring Essential Linux Commands

Introduction:
Welcome back to my 90DaysOfDevOps Challenge journey! With each passing day, our knowledge of DevOps and Linux grows stronger. On Day 3, we're diving deeper into the world of Linux by exploring a set of fundamental commands. These commands are the building blocks of Linux proficiency and will prove invaluable in our DevOps quest.
Day 3 Task: Basic Linux Commands
Today's goal is to familiarize ourselves with Linux commands that DevOps enthusiasts should be familiar with. let's get started.
Viewing the Contents of a File
To view the contents of a file, we can use the cat command. Simply open your terminal and type:
# View contents of a file in a terminal
cat filename.txt
Replace filename.txt with the name of the file you want to view.

Changing File Permissions:
File permissions can be adjusted using the chmod command. Here's an example of changing permissions on a file:

Each file in Linux has its own permission owner and group
Permission: Determines who can read, write, or execute the file.
Owner: The user who owns the file and can modify its permissions.
Group: A user group assigned to the file, with its own set of permissions.

| Octal | String Representation | Binary | Permissions |
| 7 | rwx | 111 | Read+Write+Execute |
| 6 | rw- | 110 | Read+ Write |
| 5 | r-x | 101 | Read+ Execute |
| 4 | r-- | 100 | Read |
| 3 | -wx | 011 | Write + Execute |
| 2 | -w- | 110 | Write |
| 1 | --x | 001 | Execute |
| 0 | --- | 000 | No Permission |
# Changes Permission
chmod 644 devops.txt
owner(user) is granted read(4) and write(2) permissions, which together is 6.groupthat owns the file is granted read (4) permission.Others(everyone else) are also granted read (4) permission.

Viewing Command History:
To review the commands you've executed so far, history command is used. Just type:
# Lists all the commands executed so far
history

Removing a Directory/Folder:
To delete a directory, use the rmdir command. For example:
# Removes the directory
rmdir directoryname

learn directory is deleted
Creating and Viewing Files:
You can create and view file contents using the touch and cat commands. For instance, to create and view the content of a fruits.txt file:
# Create a file name fruits.txt
touch fruits.txt
# View the contents in fruits.txt
cat fruits.txt

Displaying Top and Bottom Entries:
You can use the head and tail commands to display the top and bottom entries of a file. For instance:
# Displays the top three entries
head -3 fruits.txt
# Displays the bottom three entries
tail -3 fruits.txt

Comparing Files:
diff file1.txt file2.txt

Conclusion:
Day 3 of the 90DaysOfDevOps Challenge has been all about gaining proficiency in essential Linux commands. These commands are the foundation of Linux skills and will greatly benefit us on our DevOps journey.
Stay tuned for Day 4, where we'll continue to expand our Linux knowledge and explore more practical applications. If you have any questions or topics you'd like me to cover during this challenge, feel free to leave a comment or reach out on social media. Together, we'll learn and grow in the world of DevOps!
#trainwithshubham #90DaysDevOps #DAY03-90DaysDevOps


