Found 2065 Articles for Operating System

Partitioning Disks in Linux

Pradeep Jhuriya
Updated on 12-Jan-2023 11:05:46

3K+ Views

Introduction In Linux, a disk partition is a logical division of a hard disk drive (HDD) or solid-state drive (SSD) that is used to manage data in a more organized manner. Partitions allow you to separate data by function, such as separating system files from user files, or to set up multiple operating systems on a single physical disk. There are several tools available for creating and managing disk partitions in Linux, including fdisk, parted, and gparted. In this article, we will focus on using fdisk and parted as they are widely available on most Linux distributions. Creating a Partition ... Read More

Delete Multiple Files at Once in Bash

Pradeep Jhuriya
Updated on 12-Jan-2023 10:56:15

6K+ Views

Introduction Bash is a Unix shell and command language that is commonly used on Linux systems. It allows users to perform a variety of tasks, including deleting files. In this article, we will look at how to delete multiple files at once in Bash on a Linux system. We will cover the basic syntax for deleting multiple files, as well as some advanced techniques for deleting specific types of files or forcing the deletion of write-protected files. Using rm Command in Linux The rm command is used to delete files in Bash. To delete a single file, you can use ... Read More

Creating a Temporary File in Linux

Pradeep Jhuriya
Updated on 12-Jan-2023 10:54:21

6K+ Views

Introduction In Linux, it is often necessary to create temporary files for various purposes, such as storing intermediate data during processing or storing configuration information for a script. Temporary files are usually created in the /tmp directory, which is a standard location for storing temporary files on most Linux systems. Creating a Temporary File in Linux There are several ways to create a temporary file in Linux. One of the most common methods is to use the mktemp command, which creates a unique temporary file and prints the file name to the console.SyntaxTo create a temporary file using mktemp,  use the ... Read More

Uses of Exec Command in Linux

Pradeep Jhuriya
Updated on 19-Jul-2023 15:32:52

2K+ Views

Introduction The exec command is a built-in command in the Unix and Linux shell that allows a user to execute a command or a script in place of the current shell. This means that the exec command is used to replace the current shell process with a new process, which can be a command or a script. The exec command is useful in shell scripts when you want to execute a command or a script and then exit the current shell. Syntax of exec command −Example $ exec: exec [-cl] [-a name] [command [argument ...]] [redirection ...] Why should ... Read More

Write a Bash Script that Answers Interactive Prompts

Pradeep Jhuriya
Updated on 05-Apr-2023 11:32:48

4K+ Views

Introduction Interactive prompts are a common feature in many Linux command-line tools and utilities. These prompts allow the user to provide input or make a selection in order to proceed with a task. While interactive prompts can be useful in some situations, they can also be a nuisance when running scripts or automating tasks. In these cases, it can be helpful to know how to automatically answer interactive prompts. Handling Interactive Prompts There are several ways to automatically answer interactive prompts in Linux. One method is to use the expect command, which is a scripting language specifically designed for automating ... Read More

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

Advertisements