Skip to main content

Command Palette

Search for a command to run...

Basic concepts of linux

Published
5 min read
Basic concepts of linux

Day 5

Hello everyone welcome back !!!

Myself Swanik Santosh Gudekar and I am back with my blog. This is the fifth blog of Linux series. Today I attended the fifth session conducted by Master Pranav Jambare at Dr. Babasaheb Ambedkar technology

Points Covered In This Session :

  • Logs

  • YUM and RPM

  • 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.

  • When issues arise, analyzing log files is the first thing an administrator needs to do.

  • Linux log files are stored in plain text and can be found in the /var/log directory and subdirectory.

  • Logs are used to track the processes running in the background.

Rsys Log :

  • rsyslog recives the log and segregates them.

  • It is used in linux system as a default syslog daemon.

  • rsys is the advanced version of syslog.

  • rsyslog supports log storage in various formats, including plain text files and databases.

Types of log files in Linux :

  • kern: Contains kern related information.

  • Boot: contains booting related information.

  • cups: contains printer related information.

  • dmesg: Contains device related information

  • yum: Contains package installation related information.

  • fail: Contains device related information which is failed to login.

  • wtmp: Contains login/logout related information.

  • mail: Contains mailing related information.

  • cron: Contains job scheduling related information.

  • secure : Contains device security related information.

  • message : All the logs are 85-90% messages. This log falls under this category.

  • xorg : Contains graphical interface related information.

Logs are created on two basis :

  • Facility :

    Facility levels are used to specify the type of program or process that generated the log in short facility defines the types. The facility represents the subsystem or application generating the log message. Facilities are usually represented by a predefined set of names or codes.

  • Some facilities are given below :

    1. kern: Kernel messages

    2. user: User-level messages

    3. mail: Mail system

    4. auth: Security and authorization messages.

  • Priority :

    It signifies the importance or urgency of a log message. It indicates the severity of the event being logged. Levels are defined within syslog as guidelines, from debugging information to critical events.

  • Some Priorities are given below :

    1. DEBUG: Detailed debug information

    2. INFO: Informational messages

    3. NOTICE: Normal but significant events

    4. WARNING: Warning conditions

    5. ERROR: Error conditions

    6. CRITICAL: Critical conditions

Yum :

  • YUM stands for Yellowdog Updater, Modified.

  • It is a package management utility used primarily in RPM-based Linux

    distributions.

  • It is a command-line tool that allows users to install, update, remove, and manage software packages on their systems.

  • YUM simplifies the process of handling software packages by resolving dependencies automatically.

Some Yum commands are given below :

  • yum install <package>: Installs a specified package and its dependencies.

  • yum update <package>: Updates a specific package.

  • yum remove <package>: Removes a package from the system.

  • yum search <package>: Searches for packages.

  • yum list <package> : Lists all installed packages.

  • yum upgrade: Upgrades all installed packages.

  • yum info <package>: Displays detailed information about a specific package.

RPM :

  • RPM stands for Red Hat Package Manager.

  • It is a package management system primarily used in RPM-based distributions such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and openSUSE.

  • The RPM file format is a compressed archive that contains the software package files, metadata, and instructions for installation, upgrade, or removal.

  • RPM packages typically have a .rpm file extension.

Some RPM commands are given below :

  • rpm -ivh <package> : Installs an RPM package.

  • rpm -qpr <package>: Query the files contained within an RPM package without installing it.

  • rpm -ivh --nodeps <package>: Used to forcibly install an RPM package, ignoring

    any dependency checks.

  • rpm -q <package>: Queries the system to check if a package is installed.

  • rpm -qa: Lists all installed packages on the system.

  • rpm -qa -last <pacakge>: It lists the last installed package.

  • rpm -uvh <package>: Used to upgrade an RPM package.

  • rpm -evv <file>: To remove an installed RPM package.

APT :

Some APT commands are given below :

  • apt -get update -y: Updates the local package to ensure you have the latest package information from the repositories.

  • apt -get upgrade: Upgrades all installed packages.

  • apt -get install <package> =: Installs a specific version of package.

  • apt -get install <package><package>: Installing one or more packages.

  • apt -get install -download-only <package>: Download the given package.

  • apt -get check <package>: It checks whether the package dependencies are correct or not.

Repo Files:

  • Linux saves repository configuration files in the /etc/yum.repos.d/ directory.

  • A repository is a centralized storage location that contains packages, metadata, and information about dependencies.

  • repo files are important to pick up data from the file.

  • The repository is the directory.

CRON :

  • Linux is a time-based job scheduler in Linux and Unix-like operating systems.

  • It allows users to schedule commands or scripts to run automatically at specific intervals of time.

  • Cron is used in system backups, log rotation and time to time software updation.

  • Cron is controlled by a configuration file named crontab, it contains a job to be done and intervale at which it is to be done.

  • To define crontab there are six fields :

    <minute> <hours> <date> <month> <day> <commands>

  • Some uses of crontab :

    1. crontab -e : Opens the crontab file for editing. It allows you to add, modify, or remove cron jobs for the current user.

    2. crontab -l : Lists the current user's crontab entries

    3. crontab -r : Removes the current user's crontab entries.

These were the topics covered by Master Pranav Jambare in the fifth session of Linux. Thankyou for reading my blog !!