Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Bamdeb Ghosh
24 articles
Finding the PID of the Process Using a Specific Port
In Linux systems, every running process is assigned a unique Process Identification Number (PID) that distinguishes it from other active processes. Similarly, network connections are associated with specific port numbers that identify communication endpoints. System administrators often need to identify which process is using a particular port for network troubleshooting, security auditing, or resource management purposes. This article explores various command-line tools and techniques to find the PID of processes utilizing specific ports in Linux systems. Prerequisites To view detailed process information including PIDs and port usage, you typically need root privileges. Switch to root user using: ...
Read MoreGuide to Linux jq Command for JSON Processing
JSON (JavaScript Object Notation) is a popular data format used for exchanging information between applications. It is lightweight and easy to understand. To process JSON data efficiently, Linux provides a command-line tool called jq. This powerful tool enables users to extract, manipulate, and transform JSON data with ease. With jq, users can quickly perform filtering, sorting, and selecting specific fields. Additionally, jq supports various output formats, making it easy to integrate with other command-line tools. Installation Before using jq, ensure it is installed on your system. jq can be installed using the Linux package manager. Ubuntu/Debian Installation ...
Read MoreGuide to the Linux read Command
The read command in Linux is a built-in shell command used to read input from the user, files, or other commands. It captures input and stores it in variables, making it essential for interactive scripts and automated data processing. The read command is commonly used in shell scripting to create user-friendly interfaces and process structured data. Basic Syntax and Usage The most basic use of the read command is to capture user input into a variable: read variable_name Simple Input Example $ read name Somdeb $ echo "Hello $name" ...
Read MoreGuide to Useful File Manipulation Commands
File manipulation commands are essential tools for navigating, managing, and manipulating files in Unix/Linux systems. Whether you're a software developer, system administrator, or regular user, mastering these commands will significantly improve your productivity and efficiency when working with files through the terminal. This guide covers the most commonly used file manipulation commands that every user should know. These commands form the foundation of file management in command-line environments and are crucial for effective system administration and daily computing tasks. Using ls to List Directory Contents The ls command displays the contents of a directory. By default, it ...
Read MoreHow do I Zip/Unzip on the Unix Command Line
Zipping and unzipping files is a fundamental practice in Unix/Linux systems for file compression and archiving. We compress files to save disk space and bundle multiple files into a single archive for easier transfer and storage. When working with compressed archives, understanding both compression and extraction commands is essential for effective file management in Unix environments. Installing zip and unzip Commands First, ensure that the zip and unzip utilities are installed on your system: sudo apt install zip unzip Basic zip and unzip Operations Let's start with creating some sample files to ...
Read MoreHow to Use Command Line Arguments in a Bash Script
In general, there are many ways to pass input to programming or scripting languages and sometimes there is a need to pass input from the command line instead of hardcoded values. Like any other programming or scripting language, bash scripting also supports command-line arguments. In this article, we will explore the syntax for command-line arguments, examine practical examples, and discuss the special variables used to handle these arguments effectively. Command-line Argument Syntax We already know how to run a bash script in Linux using either bash or sh command followed by the script filename. To pass command-line ...
Read MoreIntroduction to File Locking in Linux
File locking is a mechanism used to restrict access to a file to only one process or user at a time. It is essential in multi-user systems to avoid conflicts when multiple processes try to access the same file simultaneously. In Linux, file locking prevents other processes from accessing a file until the lock is released. This article explores file locking in Linux and how to implement it using C code. We will discuss the different types of file locks, how to create and release locks, and how to handle file lock monitoring. Types of File Locks ...
Read MoreIntroduction to File MIME Types on Linux
MIME types (Multipurpose Internet Mail Extensions) are a crucial aspect of Linux file management, as they enable the operating system to identify file formats and determine the appropriate program for opening each file. Understanding MIME types is beneficial when dealing with various file formats on Linux systems, enhancing productivity and improving the overall user experience. What are MIME Types? MIME types are standardized identifiers that describe the nature and format of files. They consist of a type and subtype separated by a slash, such as text/plain or image/jpeg. Linux uses these identifiers to associate files with appropriate applications ...
Read MorePipes and Redirection in Linux
Pipes and redirection are fundamental mechanisms in Linux that enable efficient command-line operations. The pipe operator (|) allows the output of one command to serve as input to another command, creating powerful command chains. Redirection operators (>, >>, >> Redirect output (overwrite) Redirect output (append) Redirect input (from file) Redirect errors (STDERR) Output Redirection ls > file.txt echo "text" >> file.txt ...
Read MoreViewing Files in Linux Using cat, more, and less
In Linux, we often need to view file contents without opening them in text editors like vi or vim. Three essential commands for file viewing are cat, more, and less. Each command serves different purposes depending on file size and viewing requirements. The cat command displays entire file content at once, while more and less provide paginated viewing for larger files. The cat Command The cat (concatenate) command is the most straightforward way to display file contents. It reads and displays the entire file content on the terminal screen. Basic File Viewing To display the complete ...
Read More