Skip to main content

Command Palette

Search for a command to run...

(Day-2) : Linux Fundamentals

Updated
โ€ข3 min read
(Day-2) : Linux Fundamentals
S

Motivated and goal-oriented aspiring DevOps engineer with a strong passion for optimizing software development and deployment processes

Welcome to the 2nd day of the 90-day-long DevOps Challenge, where we will be talking about the most trending and demanding operating systems of all time,

Drum Rolls ๐Ÿฅ๐Ÿฅ๐Ÿฅ
.
.
.
.


WELCOME TO LINUX ๐Ÿง

In this post, we'll be discussing :

  • What is Linux?

  • Basic Linux Commands

  • #90daysofdevops 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

What is Linux?๐Ÿง

  • Linux is an open-source operating system renowned for its stability, security, and flexibility. It is designed to cater to a wide range of computing environments, including desktop computers, servers, and embedded systems.

  • With a strong command-line interface, it appeals to advanced users and system administrators. Linux has gained significant popularity, powering devices ranging from smartphones to supercomputers. It has also played a vital role in revolutionizing containerization through technologies like Docker ๐Ÿณ

  • Linux plays a pivotal role in the realm of DevOps by providing a reliable and flexible operating system that is well-suited for various DevOps practices

Basic Linux Commands:

  1. ls: Lists files and directories in the current directory.

  2. cd: Changes the current directory.

  3. pwd: Prints the current working directory.

  4. mkdir: Creates a new directory.

  5. touch: Creates an empty file or updates the timestamp of an existing file.

  6. cp: Copies files and directories.

  7. mv: Moves or renames files and directories.

  8. rm: Removes files and directories.

  9. cat: Displays the contents of a file.

  10. head: Displays the first few lines of a file.

  11. tail: Displays the last few lines of a file.

  12. grep: Searches for a pattern in files.

  13. find: Searches for files and directories based on different criteria.

  14. chmod: Changes the permissions of a file or directory.

  15. chown: Changes the ownership of a file or directory.

  16. sudo: Executes a command with administrative privileges.

  17. man: Displays the manual pages for a command.

  18. history: Displays the list of previously used commands

  19. And the list goes on and on....

Using some of the above commands we will see some brief examples below by executing them on the terminal:

Note
We are going to use an Ubuntu๐Ÿง๐Ÿ–ฅ๏ธ๐ŸŒŒ server hosted on the AWS โ˜๏ธ using EC2 instance and will connect the machine using an "EC2 Instance Connect" option. (we can also connect using the ssh client and running the commands on our command prompt)

#90daysofdevops tasks

  • Check the present/ current working directory you are working on :

    See how the "pwd" command yields us the result : the current working directory/ path : /home/ubuntu

  • List all the files and directories including hidden files/directories

    (you can create hidden files by :- For files--> touch .filename
    for directories--> mkdir .foldername):
    ls -a

    In the above image, the hiddent file and directory are visible now. (.hidden.txt and .Hidden_Folder respectively)

  • Create a nested directory A/B/C/D/E :
    mkdir -p A/B/C/D/E ----> here -p instructs/ indicates to make 'A' the parent directory.

That's it for today, let us go ahead with our learning and meet at #Day3 where we will be dealing with more complex commands and see various examples. Thanks! Ciao!

More from this blog

Untitled Publication

8 posts