Filter Logs with Grep : linux Command Grep

grep linux command

Filter Logs with Grep : linux Command Grep Let’s understand the use of grep is to extract useful information from system logs: grep -Eoc “^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.* 200” /srv/www/example.com/logs/access.log   In this command, grep filters an Apache access log for all lines that begin with an IP address, followed by a number of characters, a space and then the … Read more

Vi – Linux file editor

vi-editor

Vi – Linux file editor If you find that vi is hard to use, there is some good news: RHEL uses a user-friendly version of vi called vim, for “vi improved.” To start vim, just use the vi command. In this section, I will provide you with the bare essentials that are needed to work … Read more

Setup SFTP Server on linux

Linux yum

Setup SFTP Server on linux CentOS 7 or any Linux server distribution is a very powerful server that performs above and beyond what your business might need. Whatever task you throw at the server, it will be ready. And, if it isn’t ready out of the box, you can make it so. A complete and simple … Read more

SELinux : Introduction to SELinux

understanding selinux

SELinux : Introduction to SELinux SELinux, or Security-Enhanced Linux, is a part of the Linux security kernel that acts as a protective agent on servers. In the Linux kernel, SELinux relies on mandatory access controls (MAC) that restrict users to rules and policies set by the system administrator. MAC is a higher level of access … Read more

Runing Asterisk command from bash script -shell script

bash: #!/bin/sh asterisk -rx ‘command’ if you want to see the result of a command in a file: asterisk -rx ‘command’ > /some_dir/some_file.txt Perl: #!/usr/bin/perl system qq(asterisk -rx ‘command’)

Installing LAMP on RHEL or Centos 7

lamp installation

Installing LAMP on RHEL or Centos 7  Install httpd services – Web service # yum install httpd Restart httpd resvices # systemctl restart httpd Check status of httpd services # systemctl status httpd Stop httpd services # systemctl stop httpd Start httpd services  # systemctl start httpd Install php # yum install php php-mysql php-pdo … Read more