Demystify Linux & Unlock the true potential of a terminal

Vishnu Kalyan
5 min readSep 12, 2020

Crio.Do is a platform built to Build real products to learn tech hands-on with multiple micro experiences to work with. Crio helps in getting work-like software product development experience and learn the tech skills you need to excel in your career.

Linux started as a ‘personal hobby project’ by Linus Torvalds which is an operating system just like Windows, Mac OS X developed in 1991. Operating system is the interface between the software and the hardware which provides services for the applications and manages computer hardware.

I recently participated in Crio’s #IBelieveinDoing challenge (September Edition) organised by Crio.do where all the participants will get a chance to work on Linux Byte & Git Basics Bytes. So lets get into those bytes in detail…

Linux Byte 1

The main focus of this byte is on linux and this byte is to get rid of the fear of Linux terminal and Get familiar with the basic commands necessary to navigate a Linux box. 90% of public cloud computing services run Linux. A competent software developer must know how to use a Linux system comfortably.

This byte started explaining the navigation in a linux machine with some basic commands like:

  1. pwd — To print the working directory.
  2. ls — To list the content of a directory.
  3. cd — To change the working directory.
Linux directory structure Source: Crio.Do

/home is where user files are stored. Each user has a directory inside it. My username is crio-user and thus the directory is /home/crio-user. After getting a clear idea about the linux directory structure a detailed explanation about the file permissions

As you can see something like -rw-r- -r- — and drwxr-sr-x. These indicate the permissions given to those files.

chmod command lets us change the access mode of a file. To add executable permission, we use chmod +x <filename>

The last milestone in this byte is about the data analysis from the command line using Hadoop log Analysis, OpenSSH log Analysis, Apache log Analysis.

Good developers don’t like to do the same tasks repeatedly. Scripts and/or automation is their answer to these repetitive tasks.If we need to run this script every 5 mins, given that new logs are being generated, let’s see how to achieve this.We will use an in-built utility on Linux called cron to schedule execution of this script.

The Cron runs processes on your system at a scheduled time. Cron reads the crontab (cron tables) for predefined commands and scripts that need to be run.

Why Linux?

A majority of systems around the world run some form of Linux. These range from enterprise and desktop servers to smartphones.

  • 60 to 70% of all Web Servers in the world run some form of Linux/Unix and ~90% of all cloud computing happens on Linux based servers.
  • Most of the smartphones in the world run on Linux.
  • Mac is based on Unix and supports a terminal where these commands can be run.

Git Basics

The Primary goal of this byte is to make you understand how Git works and Learn the basic Git commands.

Ever been in a situation where

  • You badly needed your old code but it’s lost beyond the reach of Ctrl-Z
  • You need to integrate changes made to a project independently by your team members without losing any code
  • You need to keep track of metadata on a project worked on by multiple developers like — what/who/when/why for any changes made

Version control systems help in these situations. They help us keep track of changes to our files by taking snapshots of them. We can look at earlier snapshots and also restore our code to an earlier snapshot. This lets us work on our projects without worrying about introducing errors to partly/completely working versions and not being able to go back.

Git is one of them, probably the most popular one.Git projects are called Repositories and contain Git related files apart from the project files we add.

In this byte I learnt how to use SSH keys for setting up git and cloned a repo to gitpod(Linux machine can be used). After making a few changes to the files we should use git add command to mark our files for the next commit.

Git commits are like checkpoints for us to navigate back and forth. Best way is to add a message to our commit which helps us in tracking it better.Now that we’ve committed our changes. We can use git log to view all our commits

Pushing is the art of sending updates from your local repo to the remote repo, which in our case is the GitLab repo we initially cloned from. One or more commits form a push. Use git push -u origin master for that.

Next I learnt about the handling merge conflicts. A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. Git wouldn’t know which one to prioritise and needs our help to resolve this merge conflicts.

Current Change is what you had locally & Incoming Change is that from the remote. After choosing the one which we want to be in the file git commit must be used to complete the merge.

Basic workflow in git

Conclusion

Crio.Do is a platform which is perfectly designed for most of the IT individuals who loves to learn things by doing. It helps in exploring different ways like reading documentations, communicating in forums and many more to reach the goal. Thank You Crio.Do for this wonderful experience. I would love to participate in more such challenges.

--

--

Vishnu Kalyan

Tech-Enthusiast | 2x Microsoft Certified | One-side lover of Google