Found 1354 Articles for Open Source

How to fix the Docker build requires exactly one argument?

Hemant Sharma
Updated on 11-Jan-2023 18:12:59

5K+ Views

Introduction Docker build is a container image builder command. The command helps you to create your container image with some extra tweakable functionalities. While building the image using the “docker build” command beginners face a very common and simple problem of arguments. In this article, we have discussed various ways of encountering that error and how to resolve the error. Different ways of executing the build are also mentioned in the article. Creation of Dockerfile First of all, we will create a dockerfile. This dockerfile will help us to create a docker container image of the “apache-web-server”. The index page ... Read More

How to fix Ctrl+C inside a Docker container?

Hemant Sharma
Updated on 11-Jan-2023 18:11:13

3K+ Views

Introduction The real problem statement for this article is that developer is not able to use the interrupt signals while running or creating a Docker container. This is not a bug in Docker but a Linux feature. The complete problem and methods to recreate the problem are explained with the solution. Process in Linux Currently running or executing a program is a process. This process can be foreground or in the background. To see these processes, we have some terminal commands like ps and top. The ps shows active processes and the top shows the real-time update of the processes. ... Read More

How can I copy a file from one folder to another folder within a container in Docker?

Hemant Sharma
Updated on 11-Jan-2023 18:09:47

2K+ Views

Introduction In this article, we are going to discuss “How to transfer files as well as directories from the host operating system to the Docker container environment.” The need for all these commands is that many times developer has to provide various types of files to the Docker container, these files are configuration files, security and authentication files, application files, and many more. So, this is a very simple and important task that needs to be performed while creating or after the creation of the Docker container on the Docker daemon. Some commands are also going to be used while ... Read More

What is the LD_PRELOAD Trick on Linux?

Pradeep Jhuriya
Updated on 04-Jan-2023 13:03:02

6K+ Views

Introduction LD_PRELOAD is a powerful and advanced feature in the Linux dynamic linker that allows users to preload shared object files into the address space of a process (before it starts executing). This can be used to override certain functions in the process with custom implementations or to inject additional code into the process at runtime. LD_PRELOAD is often used for debugging and testing purposes, but it can also be used for malicious purposes, such as injecting malware into processes. How LD_PRELOAD actually works? The LD_PRELOAD environment variable specifies a list of shared object files that the dynamic linker should ... Read More

Running Multiple Commands in the Background on Linux

Pradeep Jhuriya
Updated on 04-Jan-2023 12:28:11

2K+ Views

Introduction Executing multiple commands in the background is a useful feature in Linux that allows users to execute multiple tasks simultaneously. This can be particularly helpful when running long-running commands that may take a while to complete, as it allows the user to continue working on other tasks while the command is being executed in the background. There are several ways to run commands in the background on Linux, including using the "&" operator and the "nohup" command. In this article, we will explore these methods and provide examples of how to use them. Running Commands in Background Using "&" ... Read More

Here Document And Here String in Bash on Linux

Pradeep Jhuriya
Updated on 04-Jan-2023 12:18:17

2K+ Views

Introduction Bash is a Unix shell and command language that is commonly used in Linux and other Unix-based operating systems. It is a powerful tool for automating tasks, managing system configurations and performing various other operations on a Unix-based system. Bash provides several features that make it a powerful and flexible tool for users, including support for "here documents" and "here strings." What is a “Here Document”? A “here document”, also known as a "here doc", is a special type of input redirection that allows a user to specify multiple lines of input for a command. This is particularly useful ... Read More

Freeing up a TCP/IP Port on Linux

Pradeep Jhuriya
Updated on 04-Jan-2023 12:22:05

6K+ Views

Introduction TCP/IP ports are used to connect and communicate with different devices and applications on a network. In Linux, sometimes a specific port may be in use by a particular application or process, preventing other applications from using it. In such cases, it is necessary to free up the port by stopping the process or application using it. In this article, we will discuss how to free up a TCP/IP port on a Linux system. We will also discuss some common tools and commands that can be used to identify the process or application using a particular port and terminate ... Read More

Remove Line Endings From a File on Linux

Pradeep Jhuriya
Updated on 04-Jan-2023 12:00:35

5K+ Views

Introduction Line endings are special characters that mark the end of a line in a text file. On Unix-based systems like Linux, the line ending is represented by a single newline character (''). On Windows, the line ending is represented by a combination of a carriage return ('\r') and a newline character (''), which is referred to as a "carriage return-newline" or CRLF. Sometimes, you may need to remove line endings from a file for various reasons. For example, you may want to remove line endings from a file before using it as input to a command that expects a ... Read More

Limiting Process Resource Consumption in Unix

Pradeep Jhuriya
Updated on 04-Jan-2023 11:58:47

303 Views

Introduction In a Unix-based operating system, it is important to manage the resources consumed by processes to ensure that the system runs smoothly. If a process consumes too many resources, it can cause the system to become slow or unresponsive. In some cases, it can even cause the system to crash. Therefore, it is important to be able to limit the resources that a process can consume. There are several ways to limit the resource consumption of processes in Unix. One way is to use the ulimit command, which allows you to set limits on the resources that a process ... Read More

Run a Function in a Script from the Command Line on Linux

Pradeep Jhuriya
Updated on 04-Jan-2023 11:55:43

16K+ Views

Introduction BASH (Bourne Again SHell) is a Unix shell and command language that is used frequently in Linux and other Unix-like operating systems. One of the useful features of BASH is the ability to create and use functions within script files. Functions are blocks of code that complete a specific task and can be executed from within the script or from the command line. Prerequisites Before we begin, you will need − A Linux system with a command line interface (or SSH access). A script containing a function you want to run (your custom script). The required permissions to execute ... Read More

Advertisements