Decoding Linux Shell Configurations: .bashrc, .bash_profile, and .profile

Linux shell configuration files—.bashrc, .bash_profile, and .profile—control how your command line environment behaves. Each file serves a distinct purpose based on shell type and session mode. Understanding these differences helps you set up aliases, environment variables, and startup commands correctly. .bashrc: Interactive Non‑Login Shell Co ...

Posted on Sat, 27 Jun 2026 17:05:12 +0000 by itsmeArry

Automating MySQL Operations with Shell Scripts

MariaDB Installation yum install mariadb mariadb-server mariadb-libs -y systemctl start mariadb netstat -tnlp | grep :3306 MariaDB runs without a default password, allowing direct access via the mysql command. Database Setup CREATE DATABASE school DEFAULT CHARACTER SET utf8; Table Definitions CREATE TABLE student ( s_id VARCHAR(20), s ...

Posted on Tue, 23 Jun 2026 17:47:34 +0000 by IAK

Linux - Utilizing Input and Output Redirection

Introduction to Redirection There are situations where saving the output of a program to a file is necessary for later analysis. For instance, if you have a compiled program named myprog, you can disassemble it and store the result in a file called output using the following command: objdump -d myprog > output The > symbol is used for re ...

Posted on Sun, 07 Jun 2026 18:06:23 +0000 by MarCn

Automated Service Monitoring and Management Strategies in Shell

Effective system administration relies on robust monitoring scripts. This guide explores best practices for implementing service health checks and automated recovery using Bash conditional logic. 1. System Resource Monitoring To monitor system memory and alert administartors, we can leverage the free utility. The following script checks if avai ...

Posted on Wed, 27 May 2026 21:41:09 +0000 by webdes03

Bash Conditional Expressions and Operators

Conditional Expression Syntax Bash supports four syntax forms for condition testing: Syntax Description test expression Uses the test command [ expression ] Single brackets, functionally identical to test [[ expression ]] Double brackets, enhanced version of the above ((expression)) Double parentheses, typically used with if statem ...

Posted on Mon, 25 May 2026 19:41:41 +0000 by True`Logic

Building a Minimal Linux Shell Implementation

Project Overview This project involves creating a minimal shell implementation in Linux that supports basic file and directory operations. The shell should provide an interactive command-line interface and execute common system commands. Core Functionality Requirements Display command prompt with current directory Process user input commands P ...

Posted on Mon, 25 May 2026 18:46:02 +0000 by anothersystem

Bash Test Operators Reference

Logical Operators && - Logical AND || - Logical OR ! - Logical NOT Integer Comparisons Traditional numeric comparison operators: -eq - Equal -ne - Not equal -gt - Greater than -ge - Greater than or equal -lt - Less than -le - Less than or equal Alternative syntax using double parentheses: (("5" < "10")) ((&qu ...

Posted on Mon, 18 May 2026 03:45:47 +0000 by jshowe

5 Methods to Clear File Contents in Linux

Using Standard Redirection The most straightforward way to empty a file is by using the shell redirection operator > without a preceding command. This truncates the file to zero length immediately. > server.log Using the Colon or True Command The : (colon) is a shell built-in command that does nothing and returns a success status ...

Posted on Sun, 17 May 2026 19:53:20 +0000 by TheMoose

Essential sed Commands for Text Processing

# Print the last line of a file sed -n '$p' ok.txt # Output total number of lines sed -n '$=' ok.txt # Count blank lines sed -n '/^$/=' ok.txt Line Selection and Printing # Print odd-numbered lines (1st, 3rd, 5th, ...) seq 10 | sed -n '1~2p' # Print even-numbered lines (2nd, 4th, 6th, ...) seq 10 | sed -n '2~2p' Inserting Content sed '5 a ...

Posted on Fri, 15 May 2026 06:49:01 +0000 by ghostrider1

Essential Linux Command Reference

Vim Process inspection: ps -ef | grep PID Delete text: Ctrl+U: Remove all characters before cursor Ctrl+K: Remove all characters after cursor Batch replacement in Vim: :%s/old/new/g Example: :%s/docker\.io/registry.cn-hangzhou.aliyuncs.com\/acs-sample/g Paste formatted code: :set paste Show line numbers: :set nu Delete all content: :%d ...

Posted on Mon, 11 May 2026 05:08:17 +0000 by Todd88