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
Operating System Articles
Page 89 of 171
Linux – How to resolve the error "can't connect to Docker daemon
The "can't connect to Docker daemon" error is one of the most common issues that new Docker users encounter when trying to start Docker services. This error typically appears when attempting to run Docker commands like docker-compose build or other Docker operations. The docker-compose command is a tool used for defining and running multi-container Docker applications. When the Docker daemon is not properly running or accessible, you'll see an error message like this: Cannot connect to the Docker daemon. Is the docker daemon running on this host? Common Causes This error occurs due to ...
Read MoreUnderstanding .a , .so and .la library files in Linux
In order to understand what the libraries of files with the extensions .a, .so and .la actually mean, we first must be aware of the concept of libraries in Linux. A library in its very simple terms is a collection of pre-compiled pieces of code which are known as functions. Libraries are very useful as they provide reusable functions, classes and data structures. Some examples of libraries in Linux are glibc (GNU version of standard C library), libc (the C standard library). In total we can divide the libraries in Linux into two categories. These categories are − ...
Read MoreUnderstanding stdin, stderr and stdout in Linux
There is a decent chance that if you have used Linux operating systems then you might have encountered the three famous data streams known as stdin, stderr and stdout. All these are different in their functions and have their own uses but one thing common between all three of them is that they are data streams that the shell creates. Let's understand more about what data streams actually mean and how they are beneficial. In terms of computing, a data stream is something that gives us the ability to transfer data from a source to an outflow and vice ...
Read MoreWhat does opening a file actually do on Linux?
When we talk about opening a file in Linux, the process varies depending on the programming language and API being used. However, most high-level languages eventually call either the C library functions or directly invoke the Linux open() system call. This article focuses on what happens at the kernel level when a file is opened in C on a Linux system. The sys_open() System Call At the heart of file opening is the sys_open() system call. When you call open() in C, it eventually triggers this kernel function found in fs/open.c: int sys_open(const char *filename, int ...
Read MoreWhat is fopen() and open() in Linux?
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 MoreWhat is the Linux Equivalent to DOS Pause?
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 MoreWhat languages have been used to write Windows, Mac OS and Linux OS?
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 MoreWhat Linux utility for sorting processes by network usage?
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 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 MoreWhere can I set environment variables that crontab will use?
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