Linux Articles

Page 57 of 134

What is fopen() and open() in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 6K+ Views

The key difference between fopen() and open() in Linux is that open() is a low-level system call that returns a file descriptor (integer), while fopen() is a higher-level C library function that internally calls open() and returns a FILE pointer with additional buffering capabilities. Understanding open() System Call When you call open(), it invokes the kernel's sys_open() function, which performs several operations to establish the file connection. Here's the simplified implementation: int sys_open(const char *filename, int flags, int mode) { char *tmp = getname(filename); int fd = get_unused_fd(); ...

Read More

What is the Linux Equivalent to DOS Pause?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 332 Views

The Pause command in DOS is used to suspend execution of batch files and displays the message − Strike a key when ready ... Some versions of DOS also allow a comment to be entered on the same line as PAUSE. DOS Pause Example We can use the Pause command to suspend execution of a batch file and display a custom message like "Insert Code" − pause Insert Code Linux doesn't provide a built-in pause command utility by default. However, there are different approaches to achieve the same behavior as ...

Read More

What languages have been used to write Windows, Mac OS and Linux OS?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 7K+ Views

An operating system serves as the backbone of any computing system, managing hardware resources and providing essential services. The three most widely used operating systems — Windows, macOS, and Linux — share fundamental concepts while implementing them using different programming languages and architectural approaches. These operating systems differ not only in their user interfaces and file management systems but also in the programming languages and technology stacks used for their development. Understanding the languages behind these systems provides insight into their design philosophy and performance characteristics. Linux Operating System Linus Torvalds, the creator of Linux, explained his ...

Read More

What Linux utility for sorting processes by network usage?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 437 Views

Linux provides the famous top command utility that displays information about running processes, including their time, process IDs, CPU usage, and much more. However, the top command does not sort processes by network usage, and the display order changes frequently based on CPU consumption. When you need to monitor which processes are consuming the most network bandwidth, you need a specialized tool. NetHogs is the ideal Linux utility for sorting and monitoring processes by their network usage in real-time. What is NetHogs? NetHogs is a command-line network monitoring tool that displays real-time network traffic bandwidth usage for ...

Read More

What's the difference between nohup and ampersand (&) on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 522 Views

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 More

Where can I set environment variables that crontab will use?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

Environment variables are typically set in shell configuration files like .bash_profile, .bashrc (Ubuntu), or .zshrc (macOS). However, crontab runs in a minimal environment and doesn't automatically load these shell configuration files, making environment variables unavailable to cron jobs. Understanding the Problem Let's examine a typical shell configuration file with environment variables − immukul@192 dir1 % cat ~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$PATH:/usr/local/node/bin export GOROOT=/usr/local/go export GOPATH=/Users/immukul/go_projects These variables work perfectly in a normal terminal session − echo $GOROOT /usr/local/go However, when you create a cron job, these variables ...

Read More

Resetting a Root Password in Linux without External Media

Prateek Jangid
Prateek Jangid
Updated on 17-Mar-2026 598 Views

Resetting a root password in Linux is a critical system recovery technique that allows administrators to regain access to their system without external media. This method works by temporarily modifying the boot process to gain direct root shell access. We'll demonstrate this using CentOS 8.2, but these procedures work with most Linux distributions, though some Debian-based systems may require slight modifications. Prerequisites Physical access to the Linux server (cannot be performed remotely over a network) Basic familiarity with the Linux command line environment Ability to work quickly during the boot process Step-by-Step Password Recovery Process ...

Read More

Explain JMeter installation in macOS

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 17-Mar-2026 7K+ Views

Apache JMeter is a popular open-source tool for performance testing and load testing of web applications. Installing JMeter on macOS is straightforward and can be accomplished by downloading the binary distribution and running it from the command line. Prerequisites Before installing JMeter, ensure that Java 8 or later is installed on your macOS system. You can verify your Java installation by running the following command in Terminal: java -version Step-by-Step Installation Step 1 − Download JMeter Navigate to the official Apache JMeter download page: https://jmeter.apache.org/download_jmeter.cgi Step 2 − ...

Read More

Array Operations in Linux bash

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 927 Views

Bash scripts are one of the most convenient approaches for automating command line processes. They help us perform multiple operations in a simpler and more understandable manner, allowing us to accomplish tasks similar to other programming languages. Arrays in bash provide a powerful way to store and manipulate collections of data elements. The syntax of bash can be tricky at first, but this tutorial will explain the essential array operations step by step. We'll explore how to create, access, and manipulate arrays using practical examples that you can run directly in your terminal. How to Create and Execute ...

Read More

How to Run a Command Multiple Times in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 9K+ Views

There are scenarios where you would want to run a particular command for N number of times. In normal programming, this can be done with the help of loop constructs available in that programming language. In Linux bash, we have loops and other methods to repeat commands N number of times efficiently. In this tutorial, we will explore different bash techniques that allow us to run a certain command multiple times using loops, functions, and command-line utilities. Creating and Running Bash Scripts Before exploring the methods, let's understand how to create and execute bash scripts. On Linux ...

Read More
Showing 561–570 of 1,338 articles
« Prev 1 55 56 57 58 59 134 Next »
Advertisements