Found 1436 Articles for Linux

Jobs and Job Control in Linux

Pradeep Jhuriya
Updated on 05-Apr-2023 11:31:37

3K+ Views

Introduction In the Linux operating system, jobs refer to processes that are running in the background or foreground. Job control refers to the ability to manipulate these processes, including suspending, resuming, and terminating them. This can be useful for managing multiple tasks or for debugging problems with a process. Job control is made possible by the shell, which is a command-line interface that allows users to interact with the operating system. The most common shell in Linux is the Bourne Again Shell (BASH), but other shells such as the Z Shell (ZSH) and the Korn Shell (KSH) are also available. ... Read More

What is the LD_PRELOAD Trick on Linux?

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

4K+ 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

1K+ 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

4K+ 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

4K+ 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

180 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

12K+ 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

Detach Screen From Another SSH Session

Pradeep Jhuriya
Updated on 04-Jan-2023 11:45:18

401 Views

Introduction In Linux systems, it is possible to open multiple terminal sessions over SSH (Secure SHell). This can be very useful when working on a remote server and you want to keep multiple terminal shell windows open at the same time. However, there may be situations where you need to force detach/remove a screen session that is running in another SSH session. This can happen if you accidentally leave a screen session running on a remote server and then close your terminal window, or if you want to end a screen session that someone else on your team has left ... Read More

Insert a Line at Specific Line Number

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

13K+ Views

Introduction Inserting a line at a specific line number in a file can be a useful task when you want to add new information to an existing file, or when you want to reorganize the contents of the file. In Linux, there are several ways to achieve this, but in this article, we will focus on using the sed command to insert a line at a specific line number. What is the sed command? sed stands for "stream editor" and it is a command line utility in Linux that allows you to modify the contents of a file or stream ... Read More

Advertisements