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 on Trending Technologies
Technical articles with clear explanations and examples
How to implement thread in user space?
A thread is a lightweight process that consists of a program counter, a stack, and a set of registers. It represents the basic unit of CPU utilization and allows multiple execution paths within a single process. Single-Threaded Process Structure Process Control Block Program Counter Stack Pointer Registers Thread Implementation in User Space User-space threads are implemented entirely within the application program without kernel involvement. The complete thread package resides in user ...
Read MoreHow to download a Tarball from GitHub on Linux?
GitHub is an online source code repository and hosting service for open-source projects that provides version control, collaboration, and project management features. Downloading tarballs (compressed archive files) from GitHub allows you to get the source code without cloning the entire repository history. There are several methods to download a tarball from GitHub on Linux systems. The most common approaches use command-line tools like wget and curl to fetch repository archives directly from GitHub's servers. Using wget Command wget is a dedicated non-interactive network download tool that supports HTTP and HTTPS protocols. It's perfect for downloading repository archives ...
Read MoreCount lines in a file using Linux bash
Counting lines in a file is a fundamental task in Linux system administration and text processing. Whether you're analyzing log files, processing data, or managing configuration files, knowing how to quickly determine the number of lines helps with file size estimation and data analysis. Linux provides several built-in commands to accomplish this task efficiently. Sample File Setup For demonstration, we'll use a text file called programming.txt containing popular programming languages: $ cat programming.txt JavaScript Java C Python C# PHP C++ Go R Ruby This file contains 10 lines. Let's explore different methods to count ...
Read MoreTransfer Files Between Linux Machines Over SSH
Transferring files between Linux machines over SSH is a common task for system administrators and developers. SSH (Secure Shell) is a protocol that allows you to securely transfer files between machines, as well as remotely access and manage them. SSH creates an encrypted tunnel between machines, protecting your data from eavesdropping and tampering. Setting Up SSH Before transferring files, SSH must be installed and running on both machines. You can check if SSH is installed by running − ssh -v If the command returns version information, SSH is installed. Otherwise, install it using your ...
Read MoreBest Tools to Monitor Network Bandwidth on a Linux Server
As businesses rely more on digital technology, the need to monitor network bandwidth on a Linux server becomes increasingly important. Keeping an eye on network usage allows administrators to ensure the network is running smoothly and that all users have the bandwidth they need. This article explores the best tools for monitoring network bandwidth on a Linux server. nload nload is a simple yet effective command-line tool for monitoring network bandwidth in real-time. It displays incoming and outgoing traffic separately, along with the total amount of data transferred. This lightweight tool doesn't consume many system resources, making it ...
Read MoreHow to Use the dmesg Linux Command?
The dmesg command is a powerful tool in the Linux command-line arsenal. It stands for "diagnostic message" and is used to read and write data from/to the kernel ring buffer, a data structure that holds messages about the system's hardware, kernel, or driver messages. This article will guide you through the usage of the dmesg command, complete with examples and their outputs. Basic Usage The most basic usage of the dmesg command is to simply type dmesg into your terminal and hit enter. This will display all the kernel messages in your terminal. $ dmesg ...
Read MoreWhat's the difference between nohup and ampersand (&) on Linux?
nohup and the ampersand (&) are both used to run processes in the background on Linux, but they serve different purposes and behave differently when the terminal session ends. The Ampersand (&) Operator The & operator runs a command in the background, allowing you to continue using the terminal while the process executes. However, the process is still attached to the terminal session. command & Example sleep 100 & [1] 12345 The output shows the job number [1] and process ID 12345. The process runs in the ...
Read MoreHow to implement thread in kernel space?
Kernel-level threads are threads that are created and managed directly by the operating system kernel. Unlike user-level threads, which are managed by thread libraries in user space, kernel threads are scheduled by the kernel's thread scheduler and have direct access to system resources. Functions of Kernel The kernel performs several critical functions in the operating system − Memory management − Allocating and deallocating memory for processes and threads Process and thread scheduling − Determining which processes/threads get CPU time File system management − Managing file operations and storage Interrupt handling − Processing hardware and software interrupts ...
Read MoreHow to replace string in a large one line, text file in Linux?
Some software reads an entire input file into memory before processing it. If the input file contains a very long single-line string, the software may crash due to insufficient memory to hold the entire string. We'll examine methods to replace strings in very large one-line files in Linux. Since some applications cannot handle extremely large single-line files efficiently, we need specialized approaches that don't load the entire file into memory at once. Target File Modern JavaScript frameworks often compress all code into a single line. Consider a one-line JavaScript file called original.js with an error — it ...
Read MoreHow to Clear Linux terminal screen?
The Linux terminal is an essential tool for system administration and daily tasks. During extended terminal sessions, the screen can become cluttered with output from various commands, making it difficult to focus on current work. Clearing the terminal screen helps maintain a clean workspace and improves productivity. Linux provides several methods to clear the terminal screen, each with different behaviors and use cases. Let's explore the most effective approaches. Using the clear Command The clear command is the most common method to clear the terminal screen. It removes all visible text and positions the cursor at the ...
Read More