Monday, January 30, 2017

Basic Linux Commands Part2

Hi guys! In previous article, I described you about some basic commands and editors of Linux. If you are new to this series you can read that from below link-
Most of us are well familiar with windows OS. Linux is also good platform. If you will start working on it, you will realize it.
Note : Most of the issues in Big Data came from Linux security section. I will try to cover it too. Today we will learn new topics under Linux basics. Be careful, Linux is case sensitive.
echo command:
                This is used to print some statements.
                Eg. user@machine:~$echo “This is sample statement by vimal”

We have few concepts for defining and saving standard input, output and error.
0 – for standard input
1 – for standard output
2 – for standard error
Please look into below image to understand it - 

Mail command:
To send a mail, we will use mail command.
user@machine:~$ mail –s”This is subject” user<messagebody.txt

grep command:
                grep is searching finding filtering tool. It can do things like pattern matching  & mapping
                eg. user@machine:~$ grep sometext file.txt
                       user@machine:~$ grep sometext ./*
                       user@machine:~$ grep sometext ./* | unique | cut –d: -f1

Pipes & Directional operators:
è user@machine:~$Program1 | Program2
§  This means output of program1 works as input for program2
§  Eg.
§  user@machine:~$ ps aux                             (to check processes)
§  user@machine:~$ ps aux | less | uniq | sort
è user@machine:~$Program1 && Program2
§  This means when program1 true then program2 execute
§  Eg.
§  user@machine:~$ ls filenotexist.txt && echo “Unsuccessful”

Package management with apt-get:
                apt-get mainly used for installation of softwares, packages
§  user@machine:~$ apt-get update
o   It may prompt permission denied. To avoid this we will use-
§  user@machine:~$ sudo apt-get update
§  user@machine:~$ sudo apt-get upgrade
§  user@machine:~$ sudo apt-get install  <applicationname>
o   To install any software or application
§  user@machine:~$ apt-cache search editor
o   To find editor
§  user@machine:~$ sudo apt-get remove  <applicationname>
o   To remove software or application

No comments:

Post a Comment