Basic Linux Commands.

Basic Linux Commands.

Initial steps towards mastering Linux.

INTRODUCTION.

Linux is an open-source operating system. As it is open-source, it is special and different from other operating systems, which means that you can customize it by editing the source code. It provides programming as well as a graphical user interface. To know more about Linux please refer to the blog Intro to DevOps.

💻🐧WHAT ARE LINUX COMMANDS

Linux commands are instructions or text-based codes that you can enter into a command-line interface (CLI) to interact with the Linux operating system. These commands enable you to perform various tasks, manage files, manipulate data, administer system settings, and more.

🐧WHERE DO WE RUN LINUX COMMANDS

Linux commands are run in a command-line interface (CLI), also known as a terminal or shell. The terminal is a text-based interface where you can interact with the Linux operating system by typing commands and receiving text-based output. Here are a few common ways to access a terminal and run Linux commands:

  1. Terminal Emulator: Most Linux distributions come with a terminal emulator pre-installed. You can find it in your applications menu. Common terminal emulators include:

    • GNOME Terminal (used in GNOME desktop environments)

    • Konsole (used in KDE Plasma desktop environments)

    • Xfce Terminal (used in Xfce desktop environments)

    • Terminal (used in various lightweight desktop environments)

  2. Virtual Console: On Linux systems, you can switch to virtual consoles by pressing Ctrl + Alt + F1 through Ctrl + Alt + F6. These virtual consoles provide a text-based interface, and you can log in with your user credentials to run commands.

  3. SSH (Secure Shell): If you're working on a remote Linux server, you can use SSH to access the server's terminal remotely. You can use an SSH client (such as OpenSSH on Linux or PuTTY on Windows) to establish a secure connection to the server and run commands remotely.

  4. Integrated Development Environments (IDEs) and Editors: Some integrated development environments and text editors provide an integrated terminal or shell within the interface. For example, Visual Studio Code, a popular code editor, has an integrated terminal where you can run Linux commands.

  5. Command-Line Boot: If you're in a situation where your graphical interface is not working, you can access a command-line interface directly during boot, which is often referred to as "single-user mode" or "recovery mode."

To run a Linux command, you typically follow this pattern:

command_name [options] [arguments] ↩

After typing the command, press Enter to execute it. The command will then process the input and provide output or perform the requested action. Keep in mind that Linux commands are case-sensitive, so ensure that you type commands and options correctly.

Learning to use the command-line interface effectively can greatly enhance your ability to work with Linux systems, manage files, troubleshoot issues, and perform various tasks efficiently.

👨‍💻SOME BASIC LINUX COMMANDS TO START WITH

In this 1st session we will learn the basic Linux commands along with small examples to help you understand how they work:

📃Listing commands

ls option_flag arguments --> list the sub directories and files avaiable in the present directory

Examples:

  • ls -l--> List the files and directories in a long list format with extra information

  • ls -a --> List all including hidden files and directory

  • ls *.sh --> List all the files having .sh extension.

  • ls -i --> List the files and directories with index numbers inodes

  • ls -d */ --> list only directories.(we can also specify a pattern)

📑Directory commands

  • pwd --> Print work directory. Gives the present working directory.

  • cd path_to_directory --> Change the directory to the provided path

  • cd ~ or just cd --> Change directory to the home directory

  • cd - --> Go to the last working directory.

  • cd .. --> Change the directory to one step back.

  • cd ../.. --> Change directory to 2 levels back.

  • mkdir directoryName --> To make a directory in a specific location

  • mkdir .NewFolder --> Make a hidden directory

  • mkdir A B C D --> Make multiple directories at the same time

  • mkdir /home/user/Mydirectory --> Make a new folder in a specific location

  • mkdir -p A/B/C/D --> Make a nested directory.

📚TASKS

  1. Check your present working directory.

  2. List all the files or directories including hidden files.

  3. Create a nested directory A/B/C/D/E

Tasks Solutions:

#Solution 1:
pwd
#Solution 2:
ls -al
#Solution 3:
mkdir -p A/B/C/D/E

🙌CONCLUSION

Delving into the world of Linux commands unveils a universe of efficiency and control. By mastering these essential tools, you can step towards becoming a confident and capable Linux user. As you continue your Linux journey, remember that practice and exploration are your allies. Embrace the power of the command line, and watch as your proficiency grows, enabling you to tackle more complex tasks and challenges with the prowess that only Linux can offer. Happy command-line adventures!


✉ENDCARD

🎉 Thank you for joining me on this insightful journey into the world of DevOps!

❤ If you found this blog helpful and informative, don't forget to give it a like!

🔄 Share this valuable knowledge with your friends and colleagues, so they can also benefit from understanding the power of DevOps!

👉 Stay updated with my latest posts and never miss out on exciting content! Click that Follow button to join and stay in the loop!

👔 Follow me on Linkedin --> rupak1chakraborty

Stay tuned for Day 4...👋

#DevOps #SoftwareDevelopment #Technology #FollowUs #LikeAndShare #StayInformed #90daysofdevops #linux 📚🔍🌈