Skip to main content

Command Palette

Search for a command to run...

Basic Linux commands - II

Updated
2 min read
Basic Linux commands - II
R

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

  1. Cat
    The cat command is used to view what's written in a file.

  2. chmod

    The command name "chmod" stands for "change mode." It restricts the way a file can be accessed.
    To change the access permissions of files

  3. history

    The 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.

  4. To remove a directory/ Folder.

    • to remove the file rm<filename>

    • to remove the directory rmdir <directory_name>

  5. To create a fruits.txt file and to view the content.

    the vim text editor is used to create and edit files and the cat command is used to view the content of the file.

  6. Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

  7. Show only the top three fruits from the file.

    head -3 devops.txt is used to print down the first 3 lines from a file.

  8. Show only the bottom three fruits from the file.

    tail -3 devops.txt is used to print down the first 3 lines from a file including space.

  9. To create another file Colors.txt and to view the content.

    touch <filename> is used to create a new file.

  10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.

  11. To find the difference between fruits.txt and the Colors.txt files.

    diff command 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.

More from this blog

ritik gupta blogs

29 posts

Software Engineer Talks about Development, Cloud, and DevOps..