Wednesday, 29 July 2015

DAY 2

Hello! Its DAY 2

I left with permissions last night.

I opened the terminal. In ubuntu when i open the terminal it always open it as normal user not super user. i tried many times to open it as Super user with the  su command but it never worked may be later i will find a solution for it.
But in search for that i found an alternative its sudo -i command.

type this command then enter your password and it will login to super user.


sumit@sumit-HCL-Notebook:~$ sudo -i
[sudo] password for sumit:



Why do i need to log in as a super user ??

The simplest answer is the super user can do anything it has all the privileges.
A normal user can't to everything
eg. normal user can not add more users or change permissions of users and group .


Now coming back to the point.

PERMISSIONS :

there are four permissions in Linux or almost in any OS

  1. Read
  2. Write
  3. Execute
  4. no permissions

we already know how to check permissions of a given file or of all the files in a given directory by using ls -l command.

root@sumit-HCL-Notebook:~# cd /home/sumit/Desktop/linux_journey/
root@sumit-HCL-Notebook:/home/sumit/Desktop/linux_journey# ls -l
total 0
-rw-rw-r-- 1 sumit sumit 0 Jul 29 04:37 Day1.txt  


Here, I first changed my directory and came to the directory which i created for the practice and then checked the permissions of the files in folder.

This Image will help you understand what is all this -rw-rw-r-- 


There is one more thing you should know about it and which is very very Important to know that how we give this permission and the concept of this.
  
 these are the values associated with r w x & -

r  = 2^2   = 4
w =2^1   = 2
x  =2^0   = 1
-   =0        = 0

How to use it ?

as you can see there are four parts in permissions list.
first - indicates file type.
second --- permissions for owner.
third --- permissions for group.
fourth --- permissions for others.


before we go further first understand what is owner, group & others.

Owner : is the super user
Group : is the group of some users. so if we apply any permission on the      group        it    will automatically apply on the users of that group.
Others : these are the users which are not in any group or you can say are individual not related to anyone.


Giving permission

while giving permission we don't have to care about file type now.

the command is

chmod 754 <file name>

here chmod is the command used for applying permission

now 754 is going to tell us that what are the permissions on different users and group.

7 as you can see it is the sum of 4+2+1 which is r+w+x  and it is for owner.
so the owner now have full permission on the given file.
5 = 4+1 which is r+x and it is for group.
so the group can only read and execute the file.
4 = 4 only . which is r and it is for others
so others can only read the file.

you can set any permission as you want you just have to take care of the numbers associated with permissions.

Now, lets see our file which we have created yesterday

root@sumit-HCL-Notebook:/home/sumit/Desktop/linux_journey# ls -l
total 0
-rw-rw-r-- 1 sumit sumit 0 Jul 29 04:37 Day1.txt


it is having read and write for both owner and group . only read for others.

now i want to give full permissions to all of them .

root@sumit-HCL-Notebook:/home/sumit/Desktop/linux_journey# chmod 777 Day1.txt
root@sumit-HCL-Notebook:/home/sumit/Desktop/linux_journey# ls -l
total 0
-rwxrwxrwx 1 sumit sumit 0 Jul 29 04:37 Day1.txt







and its done. Now everyone is having full permission on this file.


 its time to go ..  BYE ;)

 


 

Tuesday, 28 July 2015

DAY 1.5

Now I logged in Ubuntu.

Click the Ubuntu logo in upper left corner of the screen.
In search bar type TERMINAL. select the icon of Terminal and a new window will open.

You can do almost everything from here.

Today I learned
  • how to create any file or directory  
  • applying permissions on them
  • remove file or directory 
  • move, copy, rename etc..

First we should know where we are i mean in which directory
to know this use pwd command. It will tell you your present working directory.

sumit@sumit-HCL-Notebook:~$ pwd
/home/sumit


 so i am in /home/sumit

now i want to check the contents for this directory. For that we will use the ls command.

sumit@sumit-HCL-Notebook:~$ ls
Desktop  Documents  Downloads  examples.desktop  Music  Pictures  Public  Templates  Videos



Lets change the directory by cd command

sumit@sumit-HCL-Notebook:~$ cd Desktop/
sumit@sumit-HCL-Notebook:~/Desktop$


now we are in Desktop. i am going to create a folder here and from  now on i will try to do all my learning experiment in this folder.

creating a directory

mkdir <name >

sumit@sumit-HCL-Notebook:~/Desktop$ mkdir linux_journey
sumit@sumit-HCL-Notebook:~/Desktop$ ls
12  hi  linux_journey
sumit@sumit-HCL-Notebook:~/Desktop$  



we can see there are already two folders i made it earlier and the third one i just created. linux_journey

entering in this directory now

sumit@sumit-HCL-Notebook:~/Desktop$ cd linux_journey/
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$
 

now we know how to make a directory

and now i am going to create a .txt file in it with touch <name> command.

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ touch Day1.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day1.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$


lets create some more files with the same command but this time i am going to give more names then i will use rm command to remove some of them .


 sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ touch Day11.txt Day22.txt Day33.txt Day44.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day11.txt  Day1.txt  Day22.txt  Day33.txt  Day44.txt


now i have 5 .txt files here and i want to keep only one file here that is Day1.txt

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ rm Day11.txt Day22.txt Day33.txt Day44.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day1.txt


lets see what are the permissions on this file and then i will change the permissions.

command used ls -l

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls -l
total 0
-rw-rw-r-- 1 sumit sumit 0 Jul 29 04:37 Day1.txt

 

i am feeling sleepy now tomorrow we will look at the permissions thing like what is this
-rw-rw-r-- and all

good night :)
 

DAY 1

DAY 1 might not be that interesting for you... but If you already have Linux in your system you can skip to the next page.. and please leave comments so i can know how i am doing.

I was always curious about LINUX and heard a lot about it.
So finally i begin my journey.

Everyone is so habitual to WINDOWS that they never want to use LINUX
because it looks so monotonous .
WINDOWS have cool graphics and is very easy to use.

On the other hand LINUX don't look that interesting to people.
In LINUX you have a lot of work on CLI( command line interface ).

And in WINDOWS just few Clicks.


I should start telling you about my journey now. Hope it will be fun ....

And if you want you can join me . . .

________________________________________________________________________________


where to begin..

  • First need to install LINUX on my laptop.  
  • OK so how we install LINUX ???
  • Is it same as WINDOWS?
  • But i want to use my WINDOWS too
  • So can i have both LINUX and WINDOWS together?

lets discuss about the above points

There are many versions of LINUX available but if you are new like me i think you should try UBUNTU . So from where you can get UBUNTU .

http://www.ubuntu.com you can click on this link then click the download link you will find few options for downloading it. I choose UBUNTU DESKTOP

It is very easy just go to the link i am sure you will easily figure it out .

now that you have downloaded the UBUNTU image how are you going install it on you PC.

There are two options for you :
  1. Install using DVD
  2. Install using USB
To install by DVD you just have to burn the image on DVD make sure it is DVD not CD .
There are many softwares available for burning DVDs Like Nero, ImgBurn etc..
chose any or use what you have.

To install by USB you have to make your USB bootable. To make your USB bootable and have UBUNTU in it. Again you have two options First, use command prompt or use LINUX's software it will help you.
I am giving you the link just go through it. BOOTABLE USB .

Now you have LINUX in your hand.

Its time to install it . . .

I would advice you to install in on separate DISK.

please install it using youtube or using ubuntu's site .

______________________________*end*_____________________________