Basic Linux commands - II

Hi there! 👋 I'm Ritik Gupta, a passionate tech enthusiast and lifelong learner dedicated to exploring the vast world of technology. From untangling complex data structures and designing robust system architectures to navigating the dynamic landscape of DevOps, I aim to make challenging concepts easy to understand. With hands-on experience in building scalable solutions and optimizing workflows, I share insights from my journey through coding, problem-solving, and system design. Whether you're here for interview tips, tutorials, or my take on real-world tech challenges, you're in the right place! When I’m not blogging or coding, you can find me contributing to open-source projects, exploring new tools, or sipping on a good cup of coffee ☕. Let’s learn, grow, and innovate together!
What is the Linux command to
Cat
The cat command is used to view what's written in a file.
chmodThe command name "chmod" stands for "change mode." It restricts the way a file can be accessed.
To change the access permissions of files
historyThe history command in Linux is a built-in shell tool that displays a list of commands used in the terminal session. history allows users to reuse any listed command without retyping it.
To check which commands you have run till now.
To remove a directory/ Folder.
to remove the file
rm<filename>
to remove the directory
rmdir <directory_name>
To create a fruits.txt file and to view the content.
the
vimtext editor is used to create and edit files and thecatcommand is used to view the content of the file.
Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

Show only the top three fruits from the file.
head -3 devops.txtis used to print down the first 3 lines from a file.
Show only the bottom three fruits from the file.
tail -3 devops.txtis used to print down the first 3 lines from a file including space.
To create another file Colors.txt and to view the content.
touch <filename>is used to create a new file.
Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.

To find the difference between fruits.txt and the Colors.txt files.
diffcommand is used to list the difference between two files.
Thanks for reading! I hope you understood these concepts and learned something.
If you have any queries, feel free to reach out to me on LinkedIn.




