Day 2 : Basic Linux Commands

Day 2 : Basic Linux Commands

The Significance of Linux in DevOps.

ยท

3 min read

๐Ÿ’ป๐ŸงWhat is Linux?

Linux is an operating system, like Windows or macOS, that powers computers and devices. It's free, secure, and highly customizable. Think of it as the "brain" of your computer, managing everything and allowing you to run programs and use your device smoothly. Many smart gadgets, servers, and even smartphones use Linux behind the scenes.

๐ŸงWhy is Linux preferred in DevOps?

Linux's open nature, command-line efficiency, stability, cloud/container compatibility, security emphasis, community support, configuration management integration, and customization flexibility makes it a perfect choice for driving success in the DevOps domain. Its usage in DevOps empowers teams to build scalable, reliable, and efficient software delivery pipelines.

The above terms would be explained in a dedicated blog, so don't worry about that. For now, let's just focus on the basic commands as an introduction.


๐Ÿ‘จโ€๐Ÿ’ปSome basic commands to get you started:

In this blog, I will share some Listing and Directory Commands as an introduction so you can navigate through Linux.

๐Ÿ“ƒListing Commands:

๐Ÿ’  ls: List files and directories in the current directory.

ls #This will list all of the files in your current directory

๐Ÿ’  ls -l: List files and directories in long format, displaying detailed information like permissions, owner, size, and modification date.

ls -l #List files in long format

๐Ÿ’  ls *.sh: list all the files having .sh extension.

ls *.sh #list all the files having .sh extension.

๐Ÿ’  ls -d */: list only directories.(we can also specify a pattern)

 ls -d */ #list only directories.

๐Ÿ’  ls -t: List files and directories, sorted by modification time, with the newest files first.

ls -t #Newest files first

Remember, the options can be combined to get the desired output.

For example : ls -al will display all files and directories in a long format including hidden files.

๐Ÿ“‘Directory Commands:

๐Ÿ’  pwd: Print the current working directory, showing your present location in the file system.

pwd #Print Working Directory

๐Ÿ’  cd: Change the directory to the specified location. You can use relative or absolute paths.

cd /path/to/directory #Absolute Path
cd ../parent_directory # Relative Path
cd ~username # Switch according to Username

๐Ÿ’  mkdir: Create a new directory with the specified name.

mkdir directory_name

๐Ÿ’  rmdir: Remove an empty directory. Note that the directory must be empty for this command to work.

rmdir directory_name

๐Ÿ’  rm: Remove files or directories. (Use with caution, as it permanently deletes files and non-empty directories.)

rm file_name
rm -r directory_name

These commands provide essential functionality for working with directories in Linux, allowing you to navigate, create, delete, and manage directory structures making it easier to work with files and directories in the terminal.


Try to practice these commands hands-on, as it would be very beneficial rather than just reading through blogs. The #90daysofdevops also provides tasks to practice.

๐Ÿ“š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

โœ‰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 --> abdallah-qamar

Stay tuned for Day 3...๐Ÿ‘‹

#DevOps #SoftwareDevelopment #Technology #FollowUs #LikeAndShare #StayInformed #90daysofdevops #linux ๐Ÿ“š๐Ÿ”๐ŸŒˆ

ย