Posts

Boot Process

Understanding how a computer boots up is fundamental, as it’s the sequence that happens each time you power on your computer, allowing it to go from "off" to a fully operational state. Let's go through the boot process in both Windows and Linux operating systems, with some common steps across both. 1. Power-On and BIOS/UEFI Stage When you press the power button, the system's BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) takes control. This low-level firmware is stored on the motherboard. BIOS/UEFI's role : It checks all the hardware components, like the CPU, memory, and disk drives, ensuring they’re functioning. This process is called POST (Power-On Self-Test). After passing the POST, BIOS/UEFI looks for a bootable device (usually your hard drive or SSD), and loads a small program called the bootloader from it. 2. The Bootloader The bootloader is a tiny program that directs the system to load the operating system (OS). In...

Setting up a computer in LAN

Understand the Basics A LAN connects devices in a small area for resource sharing and communication. On a Linux system, you configure the LAN by setting up: Network Interfaces: Ethernet (wired) or Wi-Fi (wireless). IP Addressing: Dynamic (via DHCP) or Static (manual assignment). Sharing Resources: Using protocols like Samba or NFS for file sharing and CUPS for printers. Goal: Enable a network interface Get an IP address (Dynamic or Static) Configure DNS Test the network Step 1: Check Network Interfaces To list all available network interfaces:      ip a     or     ifconfig Look for interfaces like eth0 , enp3s0 (Ethernet), or wlan0 (Wi-Fi). lo is the loopback interface (internal to the machine). Step 2: Enable the Network Interface If the interface is down, bring it up:           sudo ip link set eth0 up                    or         ...

Shell Variables in Linux

  Shell Variables in Linux Shell variables are placeholders for data, used to store and manage values dynamically during the execution of a shell session or script. Variables allow you to make your scripts more flexible and powerful. Rules for Defining Shell Variables Variable Names: Can contain letters, numbers, and underscores ( _ ). Must start with a letter or an underscore. Cannot start with a number. Variable names are case-sensitive ( VAR is different from var ). No Spaces Around = : Do not add spaces before or after the = symbol. Correct: name="Alice" Incorrect: name = "Alice" Special Characters: Avoid special characters in variable names. Use only letters, numbers, and underscores. Quotes: Enclose values in double quotes ( " ) or single quotes ( ' ) if they contain spaces or special characters. Double quotes allow variable interpolation, while single quotes treat the content literally. "Hello $name" : Expands $name . 'Hello $name...

Networking Commands in Linux

ifconfig - Interface Configuration ifconfig command, which is one of the most commonly used tools for managing and configuring network interfaces in Linux. What is ifconfig ? ifconfig stands for interface configuration . It is used to: View and configure the network interfaces (like Ethernet, Wi-Fi, or loopback). Bring interfaces up or down. Assign IP addresses and subnet masks. Troubleshoot network issues. Syntax ifconfig [INTERFACE] [OPTIONS] INTERFACE : The network interface you want to configure or inspect, like eth0 , wlan0 , or lo . OPTIONS : Parameters that control how the interface behaves. How to Use ifconfig -  Examples 1. Display All Network Interfaces      ifconfig      Shows all active network interfaces and their details, including: IP Address ( inet ) Subnet Mask ( netmask ) Broadcast Address ( broadcast ) MAC Address ( ether ) RX/TX Data Statistics 2.Display a Specific Interface      ifconfig eth0      Thi...

Filter commands - wc, grep , head , tail , sort , awk

wc command - word count wc command is used to  count words, lines, characters, or bytes in a file or input. What is the wc Command? wc stands for "word count." It is used to count the number of lines , words , characters , or bytes in files or standard input. The wc command is part of the family of filter commands in Linux, meaning it processes and filters data. Syntax of wc The basic syntax of the wc command is:      wc [OPTION]... [FILE]... Key Points: If you provide a file , wc will analyze it. If you don’t provide a file, wc will work with standard input (text you type or pipe into the command). Basic Usage Let’s start with some examples to understand how wc works: Counting Lines, Words, and Characters in a File           wc example.txt           10   50  300 example.txt This means: 10 : Number of lines in the file. 50 : Number of words in the file. 300 : Number of characters in t...