LINUX Command
LINUX Command
Helping commands
Monitoring command
-----------------------------------------------------------------------------------
---------
19 DIR in linux
-----------------------------------------------------------------------------------
-----------------------
Creation of file
2- Creation of DIR
-- mkdir <Dir_name>
--------------------------------------------------------
Redirectors
---------------------------------------------------------------
-------- HARD LINK AND SOFT LINK --------------------------
SOFT LINK --- 1. Soft link work with both files and dir
Editors in linux
--------------------------------------------------------------------------------
* Types Of Users
1 - Loacl (Standard User ) [ UID - 1000-60,000+] [ Shell - /bin/bash ]
2 - system [ UID - 1-999 ] [ shell - /sbib/nologin ]
3 - root (Super User) [ UID - 0 ] [ shell - /bin/bash ]
1 - userdd user1
2 - passwd user1
3 - groupadd Group-1
1 - username
2 - encrypted
3 - user - id
4 - group - id
5 - comment
6 - home dir
7 - shell/mail/logs
1 - username
2 - encrypted password
3 - last pass change
4 - Min pass age (m)
5 - Max pass age (M)
6 - warning peroid (w)
7 - inactive (I)
8 - Expiary date (E)
9 - unused ( for feature )
-----------------------------------------------------------------------------------
-------------------------
----PERMISSION------
------System files-----
* Types of permission
1 - Read (r -- Octel no = 4 )
2 - Write (w -- Octel no = 2 )
3 - Execute (x -- Octel no = 1 )
-----------------------------------------------------------------------------------
----
-----TYPES OF SHELLS-------
-----------------------------------------------------------------------------------
---------------------------------------
* SPECIAL PERMISSION *
--> We have command Dmidecode which can run only through root user , if we are
applying SUID to that command it will also ececute by local user
command --- chmod u+s /sbin/dmidecode
--> If we assigned SGID to a particular Dir if file is created inside the that dir
by local or root user that file will get default group
ownership automatically
-----------------------------------------------------------------------------------
-----------------------------------------------------------
* We can manage package in different ways , mostly we use Redhat(linux) family and
Ubuntu family
# In Readhat family we have two tools to install and download packages and their
dependencies
--> Yum
1. Yum stands for Yellow dog manage
2. It is high level tool
3. It resolve and install packages as well as dependies
# Syntax and options for Yum . We are taking the example of tree package
--> Rpm
1. Rpm Stands for RedHat package Manager
2. It is low lovel tool
3. It Does not Resolve Dependies It only install packages
# Syntax and options for Rpm . We are taking the example of tree packa
# Ubuntu Family
--> In Ubunty family to manage packahges we use
1.apt-get
2.dpkg
mkdir /local_store
ls /
cd /local_store/
yumdownloader httpd
ls
createrepo /local_store/
ls
cd /etc/yum.repos.d/
ls
vim localrp.repo
ls
yum clean all
yum repolist all
yum install httpd
rpm -evf httpd
yum install httpd-------> it will install httpd package from your local rep
-----------------------------------------------------------------------------------
----------------------------------------------
* The most important work use for monitoring purpose it is used by Developer,System
Admin and Devops guy as well.
* It is also use for TroubleShooting
* Logs in linix that also stores various event activity of the System .
* In Simple words Every things than happen on our System its reacords and stores ,
Which will be more help for the users to know their system well.
# All the logs related to service are stored in
# Centralized log Managment -- The name itself indicat that we can store all the
system realated logs in Centralized Manner
That reduces human Effort and Time Managment
Also we get the advance security capablity for
monitoring System
-----------------------------------------------------------------------------------
---------------------------------------------------------
* Archiving is the process where we can combine multile files and Directories .---
( TO KEEP BACKUPS )
* We usually use archiving to keep the backup files .
* Compression is the process that reduce the file size or directory ---
( TO REDUCE SIZE )
# To Store large amount of data in single file we have command " tar "
# Mainly we can compress the file using three ways ( gzip , bzip2 , xz )
( ----- The main dependency for compression is tar file --------- Suppose we have
already created file with name "etc-backup.tar")
1. gzip -z(option) <file-name>.tar.gz(extension) ------( size reduce 30% )
-----------------------------------------------------------------------------------
---------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------