Documente Academic
Documente Profesional
Documente Cultură
Chapters No.
Chapter : 1 : Accessing the Command line
1.
Chapter : 2 : Managing files from the command
line 5.
Chapter : 3 : Getting Help in Redhat Enterprise
Linux 7.
Chapter : 4 : Creating, Viewing and Editing Text
file 8.
Chapter : 5 : Managing Local Linux users and
groups 10.
Chapter : 6 : Controlling Access to files with Linux
file system Permissions 15.
Chapter : 7 : Monitoring and Managing Linux
Processes 18.
Chapter : 8 : Controlling Services and Daemons
21.
Chapter : 9 : Configuring and Securing OpenSSH
Service 22.
Chapter : 10 : Analyzing and Storing Logs
22.
Chapter : 11 : Managing Redhat enterprise Linux
Networking 23.
Chapter : 12 : Archiving and copying files between
Systems 25.
Chapter : 13 : Installing and Updating Software
Packages 29.
Redhat Enterprise Linux Index SA - 2
Chapters No.
Chapter : 2 : Using regular expressions with GREP
32.
Chapter : 3 : Creating and Editing Text Files with
vim : (SA-1's Forth Chapter) 33.
Chapter : 4 : Scheduling Future Linux Tasks
33.
Chapter : 5 : Managing Priority of Linux Processes
34.
Chapter : 6 : Controlling Access to Files with
Access Control Lists (ACLs) 35.
Chapter : 7 : Managing SELinux Security
36.
Chapter : 8 : LDAP : (Light weight Directory Access
Protocol) 37.
Chapter : 9 : Adding Disks, Partitions, and File
Systems to a Linux System 39.
Chapter : 10 : Managing Logical Volume
Management (LVM) Storage 44.
Chapter : 11 : Find Command
48.
Chapter : 12 : Autoldap Command
48.
Chapter : 13 : Controlling and Troubleshooting
the RedHat Enterprise Linux Boot Process 27.
1.
Command: 1 :- rht-vmctl__fullreset__server__-q
Command: 2 :- rht-vmctl__start__server
Command: 3 :- rht-vmctl__view__server
Date Command : The date command displays the current date and
time. It can also be used to display or calculate a date in a format you
specify. The super-user (root) can use it to set the system clock.
Command: 1: date
Command: 4: date__+%R
Command: 5: date__-s__arguments
Command: 6: cat
Use: Make a File, Editing in File, Show in File content, Replace the File
content
Command: 7: head
Command: 8: tail
Chapter:-2
Managing files from the command line:
Main Commands in Chapter : 2
PWD Command : pwd command in Linux with Examples. pwd
stands for Print Working Directory. It prints the path of the working
directory, starting from the root. pwd is shell built-in command(pwd)
or an actual binary(/bin/pwd).
Command: 1: pwd
Command: 2: touch
Command: 3: mkdir
Command: 5: cp
Command: 6: cp__-r
Command: 7: mv
Command: 8: ls
Command: 9: ls__-l
Command: 12: rm
Chapter:-3
Getting Help in Redhat Enterprise Linux
Main Commands in Chapter : 3
MAN Command : The man Command. The man command is used to
format and display the man pages. The man pages are a user manual
that is by default built into most Linux distributions (i.e., versions) and
most other Unix-like operating systems during installation.
Command: 1: man
Command: 2: pinfo
Command: 3: gedit
Chapter:-4
Creating, Viewing, and Editing Text Files
Main Command : vim__File name
Vim Command : Vim is a powerful text editor used in CLI (command
line interface). Linux uses a lot of configuration files, you'll often need
to edit them and vim is a great tool to do so. Vim has a particular
working method, there are two main modes: the command mode and
the other modes.
i : - insert
9.
a : - append
4) Replace word
( : Colon )
: wq ! / shift + zz
Note : In Edit Mode, Replace and save the vim file for press the
escape button and run the command.
10.
Chapter:-5
Managing Local Linux Users and Groups
Main Commands in User
Usermod : User-mode Linux enables multiple virtual Linux
kernel-based operating systems to run as an application within a
normal Linux system.
1) Create a User
Syntax : useradd__username
2) Change Username
Example : usermod__-l__hmt__red
3) Change Userid
Example : usermod__-u__1023__hmt
4) Delete User
Syntax : userdel__username
Example : userdel__hmt
1) Create a Group
Syntax : groupadd__groupname
Example : groupadd__redhat
2) Change Groupname
Example : groupmod__-n__hmt__red
3) Change Group id
Example : groupmod__-g__3453__red
4) Delete Group
Example : groupdel__redhat
Example : usermod__-G__red__hmt
Example : usermod__-aG__redhat__hmt
Example : gpasswd__-d__hmt__sysgrp
Example : userdel__-rf__redhat
Example : hmt (1) : x (2) : 1001 (3) : 1001 (4) :: (5) / home (6) / red: /
bin / bash (7)
(3) User id
(4) Group id
(7) Shell
There are two types of Shell : 1) bin / bash 2) sbin / nologin etc /
shadow : In the Linux operating system, a shadow password file is a
system file in which encryption user password are stored so that they
aren't available to people who try to break into the system. Ordinarily,
user information, including passwords, is kept in a system file called
/etc/passwd .
Example : hmt (1) : !! (2) 1795 : (3) 0 : (4) 99999 : (5) 7 :::: (6)
1) User name
2) Show password
14.
6) Warning
3) chage__user name
SU : The Unix command su, which stands for substitute user is used
by a computer user to execute commands with the privileges of
another user account. When executed it invokes a shell without
changing the current working directory or the user environment.
1) Group name
15.
2) Set passwd
3) Group id
Note : Use tab - key in terminal for show the complete command.
Chapter:-6
Controlling Access to Files with Linux File System
Permissions
Chmod : In Unix and Unix-like operating systems, chmod is the
command and system call which is used to change the access
permissions of file system objects. It is also used to change special
mode flags. The request is filtered by the umask. The name is an
abbreviation of change mode.
1) Chmod :
Use : Change permission of files or directories.
2) Chown :
Use : Change ownership of files or directories. ( user & group )
sets of access permissions, one set for the owner, one set for the
group and one set for others.
3) Chgrp :
Use : Change ownership of files or directories. ( only for group )
1) Chmod
There are two methods in Chmod Symbolic Method & Numeric
Method : One is Symbolic method and Numeric method. Here you can
read about symbolic method examples. The chmod (change mode)
command will useful to change your file permissions. Here others
means Everybody (users) can able to view the files or ability to change
the file contents if you give permissions.
1) Symbolic Method
WHO :
u : - user
g : - group
o : - other
a : - all
WHAT :
+ : - add permission
17.
- : - remove permission
= : - replace permission
WHICH :
r : - read
w : - write
x : - execute
2) Numeric Method
read : - 4 (1) user
3) Chgrp
Chapter:-7
Monitoring and Managing Linux Processes
PS : In most Unix-like operating systems, the ps program displays the
currently-running processes. A related Unix utility named top provides
a real-time view of the running processes. In Windows PowerShell, ps
is a predefined command alias for the Get-Process cmdlet, which
essentially serves the same purpose.
1) Command : ps
2) Command : bg
3) Command : kill
4) Command : fg
19.
5) Command : jobs
6) Command : ps__aux
After Press the -- > Control + z and save the cat file
After show the background process and after show the Running
process.
[ root@localhost Desktop ] # ps
[ root@localhost Desktop ] # bg
[ root@localhost Desktop ] # bg
[ root@localhost Desktop ] # ps
Chapter:-8
Controlling Services and Daemons
Managing Services and Daemons
Services : A Linux service is an application (or set of applications) that
runs in the background waiting to be used, or carrying out essential
tasks. I've already mentioned a couple of typical ones (Apache and
MySQL). You will generally be unaware of services until you need
them. This is the most common Linux init system.
Chapter:-9
Configuring and Securing OpenSSH Service
only for one command in chapter : 9
SSH : SSH Command in Linux. The ssh command provides a secure
encrypted connection between two hosts over an insecure network.
This connection can also be used for terminal access, file transfers, and
for tunneling other applications. Graphical X11 applications can also
be run securely over SSH from a remote location.
Chapter:-10
Analyzing and Storing Logs
Set a NTP ( Network Time Protocol )
NTP : The Network Time Protocol (NTP) is a protocol used to
synchronize computer system clock automatically over a networks.
The most common method to sync system time over a network in
Linux desktops or servers is by executing the ntpdate command which
can set your system time from an NTP time server.
: - > Change the time and synchronization with main system time
Network Time Protocol.
After #### four time hash in server vim and attach the server id for
example : server classroom.example.com iburst
23.
After
systemctl__restart__chronyd
systemctl__enable__chronyd
After
Chapter:-11
Managing Red Hat Enterprise Linux Networking
Network Setup with NMTUI ( Network Management
Text User Information )
NMTUI : nmlci is a wonderful command to configure the network
profiles on Redhat Enterprise Linux 7. nmcli also supports the
command completion function by pressing tab key but still you need
to use the quotes properly. nmtui is an alternative command for nmcli
which is based on Text User Interface.
Name Domain (BIND) is the most commonly used DNS server on the
Internet, especially on Unix-like systems.
Command : nmtui
Add a Connection
Profile name______________________
IP________________________
Gateway____________________
DNS___________________
After
Chapter:-12
Archiving and copying Files between Systems
TAR : The tar command used to rip a collection of files and directories
into highly compressed archive file commonly called tarball or tar, gzip
and bzip in Linux. The tar is most widely used command to create
compressed archive files and that can be moved easily from one disk
to another disk or machine to machine.
1) Tar Command :
c : - Create a tar file
f : - file name
v : - verbosity
Normal tar command : tar -cvf hmt . tar / etc ( / etc destination file
name )
2) scp command :
SCP : Scp (Secure Copy) is a command line tool to copy or transfer files
across hosts. It uses the same kind of security mechanism like the ssh
program. Infact it uses an ssh connection in the background to
perform the file transfer.
3) SFTP Command
sftp > _______ ( get file name ) ( get : > download file )
sftp > ________ ( put file name ) ( put : > upload file ) ( put -r directory
name : for directorie )
a : archive mode Note : This switch puts rsync into archive mode,
which preserves time stamps, performs a recursive copy, keeps all file
and directory permissions, preserves owner and group information,
and copies any symbolic links. Archive mode gets a lot of use when
you wish to make backups as opposed to just syncing files in a
directory.
Chapter:-13 ( SA : 2 )
Controlling and Troubleshooting the Red Hat
Enterprise Linux Boot Process
Note : This is SA - 2 Chapter, because Repo and Kernel Command isn't
complete to this chapter.
Note : This is only for RHCSA Examination ( Don't try normal user )
28.
First of all full reset the server and after run the Desktop's script
After Login to Server and press the Alt + control + Delete ( view
server )
After
After
Note : Adding rd.break to the end of the line with kernel parameters
in Grub stops the start up process before the regular root filesystem is
mounted (hence the necessity to chroot into sysroot). Emergency
mode, on the other hand, does mount
Command : passwd
After
After
After enter the exam paper with exec bash : Command : exec bash
Chapter:13 ( SA - 1 )
Installing and Updating Software Packages
Set a REPO & KERNEL
Repo : A Linux repository is a storage location from which your system
retrieves and installs OS updates and applications. Each repository is a
collection of software hosted on a remote server and intended to be
used for installing and updating software packages on Linux systems.
Repositories contain thousands of programs.
After You are enter in vim, after press the i - key and enter the insert
mode.
[ ] ( id name )
gpgcheck = 0
enabled = 1
After Press the V - key and open the visual mode and copy this full
information ( id to enabled )
gpgcheck = 0
enabled = 1
Command : yum__clean__all
Command : yum__Repolist
Command : yum__install__kernel__-y
After Kernel's Process will be run and install and after Reboot the
system
SA : 1 Short Notes
1) > append ( single append )
10) For files and directories hidden command : mkdir . file name /
directorie name
Grep Command
Grep Definition : grep is a command-line utility that is used for
searching text from standard input or a file for specific expressions,
returning the lines where matches occur. A common use for grep is to
locate and print out certain lines from log files or program output.
Use : Look for the words from the front in the capital & to see the
small words. ( This indicates the limitations )
Chapter:-3
Creating and Editing Text Files with vim : ( SA-1's Forth
Chapter )
Chapter:-4
Scheduling Future Linux Tasks
Future Tasks
Crontab Definition : The crontab (short for "cron table") is a list of
commands that are scheduled to run at regular time intervals on your
computer system. The crontab command opens the crontab for editing,
and lets you add, remove, or modify scheduled tasks.
: -> Afterwards, the Insert - Mode will be open and the footer must
run Tasks.
Command : systemctl__restart__crond
Command : systemctl__enable__crond
Other Commands :
Command : crontab__-ru__root
34.
Command : crontab__-ln__root
Chapter:-5
Managing Priority of Linux Processes
Nice & Renice Defination : Linux nice and renice commands. While
the nice command lets you execute a program/process with modified
scheduling priority, the renice command allows you to change the
scheduling priority of an already running process. Renice alters the
scheduling priority of one or more running processes.
Renice : Highest
ps aux -17
Chapter:-6
Controlling Access to Files with Access Control Lists
(ACLs)
ACL : Access Control Lists
ACL Definition : Access Control Lists(ACL) in Linux. Access control list
(ACL) provides an additional, more flexible permission mechanism for
file systems. It is designed to assist with UNIX file permissions.
: ---- > The First thing to do this paste a directory in / var / tmp called
fstab.
Chapter:-7
Managing SELinux Security
Selinux Types
Selinux Defination : SELinux is a set of security policies/modules
which are going to apply on the machine to improve the overall
security of the machine. These are the Linux security modules(LSM)
which are loaded in to kernel to improve security on accessing
services/files which improve security.
2) permissive :
3) disable :
Chapter:-8
LDAP : ( Light weight Directory Access Protocol )
38.
Note : If the LDAP are not complete without repo and kernel, So
please repo and kernel the complete first.
Command : systemctl__restart__sshd
Command : systemctl__enable__sshd
: For Verification
Chapter:-9
Adding Disks, Partitions, and File Systems to a Linux
System
Simple Partition
Partition Defination : fdisk command in Linux with examples. fdisk
also known as format disk is a dialog-driven command in Linux used
for creating and manipulating disk partition table. It is used for the
view, create, delete, change, resize, copy and move partitions on a
hard drive using the dialog-driven interface.
Two Partition :
1) sda - b : In main system to do Partition.
NOTES
2) Extended Partition
After Then : Press the Enter ( Three time Enter ( Default Partition size ,
no. ) )
Note : The standard partitions scheme for most home Linux installs is
as follows: A 12-20 GB partition for the OS, which gets mounted as /
(called root) A smaller partition used to augment your RAM, mounted
and referred to as swap. A larger partition for personal use, mounted
as /home.
Note : The mkfs Command. The mkfs (i.e., make filesystem) command
is used to create a filesystem (i.e., a system for organizing a hierarchy
of directories, subdirectories and files) on a formatted storage device
or media, usually a partition on a hard disk drive (HDD), A partition is a
logically independent section of a HDD.
After Then : vim terminal open, In vim terminal write this information.
/ dev / vdb5__/ t1__ext3__defaults__0__0
Swap Partition
Note : Hex codes system id. Hex codes system id is a unique id for file
system type including Windows, Unix and Linux file system.
Note : Swapon : Enable devices and files for paging and swapping.
After Then : vim__/ etc / fstab
After Then : open the vim terminal and after write this information : /
dev / vdb5__swap__swap__defaults__0__0
44.
Chapter:-10
Managing Logical Volume Management (LVM) Storage
LVM Partition
What is lvcreate ?
Ans. : Logical volume management (LVM) is a widely-used technique
and extremely flexible disk management scheme. It basically contain
three basic command : a. Creates the physical volumes using pvcreate
b. Create the volume group and add partition into volume group using
vgcreate c. Create a new logical volume using lvcreate
lvm-diagram1
LVM Commands
fdisk__/ dev / vdb
What is umount ?
Ans. : The umount command is used to
manually unmount filesystems on Linux and other Unix-like operating
systems. Mounting refers to logically attaching a filesystem to a
specified location on the currently accessible (and thus already
mounted) filesystem(s) on a computer system so that its
contents can be accessed by users.
What is LVresize ?
Ans. : lvresize allows you to resize a logical volume. Resizing snapshot
logical volumes (see lvcreate) for information about creating
snapshots) is supported as well.
What is Resize2fs ?
Ans. : The resize2fs program will resize ext2, ext3, or ext4 file systems.
It can be used to enlarge or shrink an unmounted file system located
on device. If the filesystem is mounted, it can be used to expand the
size of the mounted filesystem, assuming the kernel supports on-line
resizing.
48.
Find Command :
Find__ /__ -user__ susan__ -exec__ cp__ -rpf__ {}__ /home
/student__ \;
After : systemctl__restart__autofs
After : systemctl__enable__autofs