Posts

A little knowledge about Linux #1

Updated: Apr 29

Hello there!

This is Jon from Beyond GTA. Today I will introduce Linux to you in a human language without technical terms.


In order to understand Linux itself, you need to be able to picture it. How?

Think of Linux as a tree with an upside-down shape. As root plays an important role in the life form of a tree, so as to root in Linux system.



When you are setting up your Windows or macOS, you need to create a user to use it.

That user in Linux is root and whether you like it or not it is default and comes with administrative control. Of course, you can create as many users as you want but it is better less for your security measurements. I will give you some examples of how it works.


Let's say you build a server in the cloud by using any cloud server providers such as AWS, GCP, Azure or Oracle and etc. Below is my test server which I created by using AWS. You probably heard that AWS gives you a default user name [ec2-user] when you newly created a server but as I mentioned to you earlier you have a right to become a root user.


[ec2-user@ip-172-31-45-23 ~]$
⇓
[ec2-user@ip-172-31-45-23 ~]$ sudo su -[root@ip-172-31-45-23 ~]# whoami
root

By using [sudo su - ] command you will become a root user and [whoami] is how you define yourself. As you go down from root on a tree you will encounter with different branches that are connected to bough and it is the same in Linux since those branches mean directories such as :

/bin - Binaries and other executable programs

/etc - System configuration files

/home - Home directories for users

/tmp - Keeps temporary files and will be empty after reboot

/opt - Stores third party software

/var - Variable data mostly log files and etc.

As branches connected to bough so do directories with [/] as you can see from examples above. In order to move between different directories you need to use [/], otherwise, you will be warned by the system that there is no such file or directory as shown below.

[root@ip-172-31-45-23 ~]# pwd
/root
[root@ip-172-31-45-23 ~]# cd etc
-bash: cd: etc: No such file or directory
[root@ip-172-31-45-23 ~]# cd /etc
[root@ip-172-31-45-23 etc]# pwd
/etc
[root@ip-172-31-45-23 etc]#

By the way, [pwd] means present working directory which helps to find out where you are right now. This will be the end for now because once J.R.R. Tolkien said:

Little by little, one travels far.

Next time I will be showing more commands and tricks. Stay tuned!!!











36 views