Found 2065 Articles for Operating System

How to Kill a Detached screen Session on Linux

Pradeep Jhuriya
Updated on 20-Jan-2023 14:48:43

3K+ Views

Introduction Separate screen sessions are an excellent way to perform background processes on a Linux machine. However, sometimes it may be necessary to kill a separate screen session that is no longer necessary. In this article, we will show you how to remove a separate screen session on Linux using the command line. When using the GNU screen tool, we can sometimes end up with separate sessions that need cleaning up. In this quick tutorial, we'll look at some options for deleting a disconnected screen session. List of Sessions Before we start discussing how to end existing sessions, let's first ... Read More

Filtering Files Copied When Using rsync on Linux

Pradeep Jhuriya
Updated on 20-Jan-2023 14:44:20

569 Views

Introduction The Linux command-line utility rsync is a powerful and flexible tool for synchronizing files and directories across different computers and locations. It is commonly used for a variety of tasks including backups, file transfers and data replication. One of the main features of rsync is its ability to filter files based on various criteria such as file type, size and modification time. In this article, we will explore in detail how to use rsync filters to selectively copy files during directory synchronization on a Linux system. Rsync Overview Rsync is a powerful and efficient file transfer tool that allows ... Read More

Calculate an MD5 Checksum of a Directory in Linux

Pradeep Jhuriya
Updated on 20-Jan-2023 14:26:11

3K+ Views

Introduction During our daily use of Linux, we may want to check if there are any changes to any of the files in a directory. Or we might want to confirm that the contents of one directory are the same as those of another directory on a different location, disk, or system. In this tutorial we will learn how to compute an MD5 checksum of an entire directory tree on Linux. We will compute a single hash value of all directory contents for comparison purposes. Get the list of all files in a directory tree To find out the collective ... Read More

Keeping SSH session alive on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:13:39

14K+ Views

Introduction Secure Shell (SSH) is a network protocol that allows secure remote connections between two systems. It is commonly used to access and manage Linux servers remotely. However, one of the problems with using SSH is that your session can be terminated due to downtime or network outages. This can be frustrating, especially if you're working on a long-running task that requires an uninterrupted connection. In this article, we will discuss various methods of keeping an SSH session alive on Linux. Using the ClientAlive Interval Option One way to prevent an SSH session from closing due to inactivity is to ... Read More

Writing Text to File Using Linux Cat Command

Pradeep Jhuriya
Updated on 17-Jan-2023 17:12:20

47K+ Views

Introduction The Linux cat command is a powerful utility that allows users to concatenate, view and create files. One of its useful features is the ability to write text to a file, either by appending it to the end of the file or by overwriting the existing content of the file. In this article, we'll explore how to use the cat command to write text to a file in Linux, covering the various options and flags that can be used to customize the behavior of the command. Introduction to the Linux Cat Command The cat command is a simple yet ... Read More

Implement a Counter in Bash Script on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:11:01

3K+ Views

Introduction As a Linux enthusiast, you may have come across situations where you needed to perform some repetitive tasks and wished if you had a counter that could keep track of the number of times you performed a certain task. Well, guess what? Bash scripting allows you to do just that! In this article, we will discuss how you can implement a counter in your Bash scripts and use it to keep track of the number of times a certain task is performed. But before we dive into the implementation details, let's first understand what a counter is and why ... Read More

Count Duplicate Lines in a Text File on Linux

Pradeep Jhuriya
Updated on 17-Jan-2023 17:07:45

12K+ Views

Introduction There are several reasons why you might want to count the number of duplicate lines in a text file on a Linux system. For example, you may want to find out if there are any errors in your data or you may want to optimize your file by removing duplicates. Whatever the reason, Linux provides several tools and commands you can use to do this. Preparation Before we dive into the commands, let's first create a text file with a few duplicate lines that we can use for testing. Open a terminal and create a new file using the ... Read More

Exclude Multiple Patterns With Grep on Linux

Pradeep Jhuriya
Updated on 22-Oct-2023 12:58:24

20K+ Views

Introduction Grep is a powerful command line utility on Linux that allows users to search for patterns in text files. It is widely used for tasks such as searching log files for specific strings or patterns, searching for specific lines in a configuration file, or extracting information from a large dataset. One of the useful features of grep is the ability to exclude multiple patterns from the search. This can be useful when you want to filter out irrelevant or unwanted results from your search. In this article, we will discuss how to exclude multiple patterns with grep on Linux. ... Read More

How to Use the Paste Command on Linux?

Pradeep Jhuriya
Updated on 17-Jan-2023 17:00:51

593 Views

Introduction The Paste command in Linux is a useful tool for merging multiple files or lines of text into a single file or output. It is commonly used in conjunction with the cut command, which allows users to cut specific lines or sections of text and paste them elsewhere. In this article, we'll explore the various options and usage scenarios for the paste command in Linux, as well as demonstrate how to use it with examples and output. What is the Paste Command? The Paste command is a utility on Unix and Linux operating systems that allows users to merge ... Read More

Measure CPU usage for a process on Linux?

Pradeep Jhuriya
Updated on 12-Jan-2023 11:10:17

6K+ Views

Introduction On modern multi-core CPUs, it is often useful to know the CPU usage of individual cores for a particular process. This can be helpful for identifying bottlenecks in the system, or for understanding the workload distribution across CPU cores. In this article, we will see how to measure separate CPU core usage for a process on Linux using various command line tools. Measure CPU Core Usage using top Command The top command is a commonly used tool for monitoring system resources, including CPU usage. By default, top displays the overall CPU usage for all cores, but it also provides ... Read More

Advertisements