Mukul Latiyan has Published 474 Articles

How to grep string without filenames in Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:42:35

5K+ Views

We know that we can make use of the grep command to search for a particular pattern of characters in all the lines of a file or multiple files. The grep command performs a case-insensitive search for words in a file.Let’s see a simple example where we will grep a ... Read More

How to grep multiline search patterns in Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:41:10

2K+ Views

In order to be able to grep multiple lines of pattern present in a file, we will make use of the number of grep command that Linux provides us with. But first, we must understand what a grep command is and how to use it on Linux.The grep command in ... Read More

How to grep and replace a word in a file on Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:39:11

3K+ Views

While there are plenty of ways to print and make use of specific words from a particular file in a Linux directory, when we talk about grepping a particular word and then replacing it with some other word, then we will need to mix certain Linux utility commands.The two Linux ... Read More

How to grep a string in a directory and all its subdirectories in Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:38:12

4K+ Views

The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search.Normally, the pattern that we are trying to ... Read More

How to get the start time of a long running Linux Process?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:37:24

627 Views

Whenever we want to get an update about a specific process or different process we make use of the ps command which is short for “Process status” that tells us about the state of the current process and its characteristics and a whole lot more.When clubbed with several flags and ... Read More

How to get the last dirname/filename in a file path argument in Bash?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:35:15

877 Views

We make use of the bash files to store different variables that we normally refer to as the environment variables. We can later access these variables easily by just printing them with the help of the echo utility command tha linux provides us with.ExamplePrint the $PATH environment variable.Commandecho $PATHOutputimmukul@192 src ... Read More

How to get only the file name using find command on Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:32:17

1K+ Views

Linux find statement is one of the most widely used statements that allows us to walk a file hierarchy. It is used to mostly find a specific file or directories and we can also append different other Linux statements or flags along with it to enhance or do a complex ... Read More

How to get Linux console window width in Python?

Mukul Latiyan

Mukul Latiyan

Updated on 30-Jul-2021 08:31:23

316 Views

In order to get the width and height of the Linux console in Python, there are different modules available that we can make use of. Two of them are the os module and the subprocess module.In the case of the os module, we make use of the popen() method that ... Read More

How to free Inode usage on Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 29-Jul-2021 12:12:38

2K+ Views

The inode (also known as index node) is a data structure that is used to describe the file system object and is usually stored at the file system directory.We can check the size of the different inodes present on our local machine with the help of the following command −df ... Read More

How to find what group a given user has on Linux?

Mukul Latiyan

Mukul Latiyan

Updated on 29-Jul-2021 12:11:37

214 Views

We know that we can print all the users that are present on Linux with the help of the Linux utility command known as compgen.The compgen command is a Linux utility command that is used to list all the commands that can be executed in a Linux terminal, and when ... Read More

Advertisements