Linux Workshop

Ayush BhosaleAyush Bhosale
5 min read

Hello guys..!!! I'm back here with my another blog.

Today I attend my 5th session on the Linux workshop, I'm very grateful to attend it. It was great session, conducted by Mr.Pranav Jambare. In this blog we are discussing the topics covered in Day 5 of workshop.

So, let's start with the contents.

Contents

  • Logs

  • Rsys Log / SysLog

  • YUM

  • RPM

  • APT

  • Commands

  • Cron

Logs :-

  • Linux logs provide a timeline of events for the Linux operating system, applications, and system and are a valuable troubleshooting tool when you encounter issues.

  • Linux has a special directory for storing logs called /var/log.

  • a log is a file that contains a record of system events, such as system startup and shutdown, user logins and logouts, system errors, and other important information.

  • . Logs are used to troubleshoot issues and monitor system performance.

  • Some common Linux logs include syslog, auth.log, kernel.log, and messages.log.

Syntax :-

$ sudo cat /var/log/<log_file>

Rsys Log

  • Rsyslog is a modern version of the traditional syslog system logging daemon.

  • rsyslog is a popular open-source program used to manage and process system logs in Linux.

  • It is a replacement for the older syslogd program and offers more advanced features such as filtering, message routing, and support for various log formats.

  • rsyslog can be configured to collect logs from multiple sources and store them in a central location for analysis and troubleshooting.

  • It is commonly used in enterprise environments to manage large volumes of system logs and maintain compliance with security and regulatory requirements.

What is Syslog ?

  • Syslog Daemon :- It is a daemon that listens for logs and writes them to a specific location. The location(s) is defined in the configuration file for the daemon. rsyslog is the Syslog daemon shipped with most of the distros.

  • Syslog Message Format :- It refers to the syntax of Syslog messages. The syntax is usually defined by a standard (for e.g., RFC5424).

  • Syslog Protocol :- It refers to the protocol used for remote logging. Modern Syslog daemons can use TCP and TLS in addition to UDP which is the legacy protocol for remote logging.

YUM

  • YUM stands for Yellowdog Updater Modified.

  • YUM is a package manager for Linux that automates the process of installing, updating, and removing software packages.

  • YUM is a top-level front-end package manager with advanced functionality.

  • YUM allows automatic upgrades to the latest available version.

  • YUM relies on an online repository for installing packages. The utility requires only the package name.

  • YUM relies on an online repository for installing packages. The utility requires only the package name.

  • YUM allows any changes to be rolled back.

YUM commands :-

  • yum install (packagename) –y

  • yum remark (packagename) -y

  • yum update (packagename)

  • yum list (packagename)

  • yum search (packagename)

  • yum info (packagename) )

  • yum update -y (packagename

RPM

  • RPM stands for Red Hat Package Manger.

  • RPM is a low-level package management tool that is used to install and manage individual software packages.

  • It is responsible for installing files, creating directories, setting permissions, and registering the package with the system.

  • RPM doesn’t support automatic upgrades.

  • RPM package management and handling gets complicated at times.

  • RPM doesn't support change rollback.

  • Does not resolve dependencies.

RPM Commands :-

  • rpm -ivh (packagename) -[install ]

  • rpm -gpr (packagename) -[package search]

  • rpm -ivh –nodeps (packagename)

  • rpm -q (packagename) -[search]

  • rpm -qa -last -[last install]

  • rpm -qa -[total list]

  • rpm -uvh (packagename) -[update]

  • rpm – evv (packagename) -[remove]

APT

  • APT stands for Advanced Package Tool.

  • APT, is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian, and Debian-based Linux distributions.

  • APT works through the use of repositories, or special directories that hold collections of software packages.

  • The Debian project maintains an official repository holding thousands of software packages which APT users can install via the apt command-line program and a network connection.

  • Users can also install packages from third-party repositories as well as locally-stored repositories.

APT Commands:-

  • apt -get update -y

  • apt -get check (packagename)

  • apt -get upgrade (packagename)

  • apt -get install (packagename)=(versionNo)

  • apt -get install (pkg1) (pkg2)

  • apt -get install – download -only(packagename)

Today's Commands :-

  • ssh -keygen ---------> For key generation.

  • cd /root/.sh ---------> for key is stored.

  • ssh -copy -id-i -id –[Filename] [user]@[ip] --------> For connection establish.

  • ssh [user]@[IP] ------> To use passwordless connection.

  • /etc/rsyslog.conf (used to control the output of the syslogd daemon log files)

  • tail -f[Filename]

    • * /var/log/filename

  • vim etc/logrotate/conf -------> It takes a backup in once week .

  • Systemctl restart rsyslog.service

Repo File

  • repo file is used not only to populate available packages using dnf install but also as the source of data for the dnf repolist command, which informs the system which repositories are enabled.
#syntax
cd /etc/yum.repos.d/
  • [local.repo] ----> header of the file.

  • Name = testrepo -----> name of the repo.

  • Baseurl [url] -----> location to pick the build.

  • Enabled = 1 -----> enabling URL (0) – disabling.

  • Gpgcheck = 0 –-----> no security check.

Cron

  • Cron is a shedular.

  • Cron is a daemon, which is an unattended program that runs continuously in the background and wakes up (executes) to handle periodic service requests when required.

  • The daemon runs when the system boots from /etc/init. d or /etc/rc. d/init. d scripts.

  • The crontab file contains simple instructions for the daemon that mean "run this command at this time on this date."

Syntax :-

#syntax
Min hr date Month day command

List command for Cron :-

Crontab -l

Edit command for Cron :-

Crontab -e

This is all about the Day 5 Topics. I hope you enjoy it and understand it.

Thank you....!!!!

20
Subscribe to my newsletter

Read articles from Ayush Bhosale directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ayush Bhosale
Ayush Bhosale

Student at Dr. Babasaheb Ambedkar University Lonere, in computer science