Wednesday 28 June 2017

Linux-1

Linux is Mulituser Operating system.
It is open-source, free, has a variety of options regarding distributions, and you can be in full control of how you use your computer’s memory; as well as your entire graphic interface, also known as X.
Linux is the best-known and most-used open source operating system. As an operating system, Linux is software that sits underneath all of the other software on a computer, receiving requests from those programs and relaying these requests to the computer’s hardware.

For the purposes of this page, we use the term “Linux” to refer to the Linux kernel, but also the set of programs, tools, and services that are typically bundled together with the Linux kernel to provide all of the necessary components of a fully functional operating system. Some people, particularly members of the Free Software Foundation, refer to this collection as GNU/Linux, because many of the tools included are GNU components. However, not all Linux installations use GNU components as a part of their operating system. Android, for example, uses a Linux kernel but relies very little on GNU tools.
Moreover, it is less vulnerable to viruses and cyber-attacks.
In many ways, Linux is similar to other operating systems you may have used before, such as Windows, OS X, or iOS. Like other operating systems, Linux has a graphical interface, and types of software you are accustomed to using on other operating systems, such as word processing applications, have Linux equivalents. In many cases, the software’s creator may have made a Linux version of the same program you use on other systems. If you can use a computer or other electronic device, you can use Linux.

But Linux also is different from other operating systems in many important ways. First, and perhaps most importantly, Linux is open source software. The code used to create Linux is free and available to the public to view, edit, and—for users with the appropriate skills—to contribute to.

Linux is also different in that, although the core pieces of the Linux operating system are generally common, there are many distributions of Linux, which include different software options. This means that Linux is incredibly customizable, because not just applications, such as word processors and web browsers, can be swapped out. Linux users also can choose core components, such as which system displays graphics, and other user-interface components.
Here you will found basic commands.Slowly we will move to advance  level to shell script  also.

Login using Vagrant Vm
login as: vagrant
vagrant@127.0.0.1's password:
Last login: Mon Jun 26 11:55:23 2017 from 10.0.2.2

[vagrant@server1 ~]$ sudo su

[root@server1 vagrant]# cd

àadding user with useradd command.Linux has a super user account by default it is root user with this account we can create users and install the packages and do all the things which an admin can do in normal windows system.
[root@server1 ~]# useradd dhoni
[root@server1 ~]# passwd dhoni
Changing password for user dhoni.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

àGiving Sudo permission using visudo file.Above i had created a user name dhoni i am giving sudo permissions so he can do some admin level work when require.

[root@server1 ~]# visudo

àNow i would like to change the user account as dhoni so i can do using su command.It is nothing but switch user account.

[root@server1 ~]# su dhoni

àchange directory command.This command is used to change the present directory to another directory or file
[dhoni@server1 root]$ cd

àDisplays a list of files.This command displays the all the files which were in that directory.
[dhoni@server1 ~]$ ls

àTo open a create a file with vi editor.Write some text.This is like notepad in our windows operating system.
[dhoni@server1 ~]$ vi cricket

[dhoni@server1 ~]$ ls
cricket

à To Rename file cricket to ckt.txt we use  mv command.

[dhoni@server1 ~]$ mv cricket ckt.txt

àNow check using ls command to know wheater the file changes or not.
[dhoni@server1 ~]$ ls
ckt.txt

#ls -la Shows hidden files
# The file starts with . Known as hidden file
# file starts with d known as directory
# file starts with - known as file

[dhoni@server1 ~]$ ls -la
total 24
drwx------. 2 dhoni dhoni 4096 Jun 27 10:35 .
drwxr-xr-x. 7 root  root  4096 Jun 27 10:11 ..
-rw-r--r--. 1 dhoni dhoni   18 Jul 23  2015 .bash_logout
-rw-r--r--. 1 dhoni dhoni  176 Jul 23  2015 .bash_profile
-rw-r--r--. 1 dhoni dhoni  124 Jul 23  2015 .bashrc
-rw-rw-r--. 1 dhoni dhoni  281 Jun 27 10:31 ckt.txt

àWho am i Tells the present user detailes logged in.
[dhoni@server1 ~]$ who am i
vagrant  pts/0        2017-06-27 08:25 (10.0.2.2)

àWho command tells the same as above.
[dhoni@server1 ~]$ who
vagrant  pts/0        2017-06-27 08:25 (10.0.2.2)

àmkdir used to make directory Here i am creating dir1.

[dhoni@server1 ~]$ mkdir dir1

[dhoni@server1 ~]$ ls
ckt.txt  dir1

[dhoni@server1 ~]$ cd dir1

[dhoni@server1 dir1]$ ls

[dhoni@server1 dir1]$ ls -la
total 8
drwxrwxr-x. 2 dhoni dhoni 4096 Jun 27 12:05 .
drwx------. 3 dhoni dhoni 4096 Jun 27 12:05 ..

[dhoni@server1 dir1]$ cd

[dhoni@server1 ~]$ ls -la
total 28
drwx------. 3 dhoni dhoni 4096 Jun 27 12:05 .
drwxr-xr-x. 7 root  root  4096 Jun 27 10:11 ..
-rw-r--r--. 1 dhoni dhoni   18 Jul 23  2015 .bash_logout
-rw-r--r--. 1 dhoni dhoni  176 Jul 23  2015 .bash_profile
-rw-r--r--. 1 dhoni dhoni  124 Jul 23  2015 .bashrc
-rw-rw-r--. 1 dhoni dhoni  281 Jun 27 10:31 ckt.txt
drwxrwxr-x. 2 dhoni dhoni 4096 Jun 27 12:05 dir1

àTo find out specific file detailes use following command.

[dhoni@server1 ~]$ ls -la ckt.txt
-rw-rw-r--. 1 dhoni dhoni 281 Jun 27 10:31 ckt.txt



If you face any problem while practicing feel free to comment it and Bookmark this blog for quick reference.We will try to help you.

If you like this share with your friends.Follow us by email for our new posts 

Thanks

Devops Desk Team

No comments:

Post a Comment