Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

Page 31 of 37

How to free Inode usage on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 3K+ 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 -The above command is known as df command which is a Linux utility command that is used to get the details of the space available on the disk.After running the above command, you can expect an output something like this −immukul@192 ~ % df -i Filesystem 512-blocks Used Available Capacity ...

Read More

How to find the most recent file in a directory on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 3K+ 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 operation.Let’s explore an example of a find statement to understand it better.In the linux code shown below I am trying to search for a file inside my Downloads folder, and for that I am making use of the find statement.find sample.shOutputsample.shNotice that if the find command is able to locate ...

Read More

How to find out which processes are using swap space in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 2K+ Views

Swap space is common in Linux, and it usually is used when the amount of the physical memory(RAM) is full. The idea behind the swap space is that if the operating system needs more memory resources and the RAM doesn’t have any space left, then the pages that are inactive will be moved to the swap space.It should also be noted that while swap space definitely helps out the RAM on a short basis, they should not be considered a replacement for more RAM.Now we know a bit about swap spaces, let’s talk about how we can detect which processes ...

Read More

How to find out which process was killed by Linux OOM killer?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 874 Views

In order to be able to find out which process was killed by linux OOM killer, we will make use of the grep command that Linux provides us with. But at first we need to understand what a grep command is and how to use it on Linux.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 search in the ...

Read More

How to find all files with names containing a string on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 4K+ Views

In order to be able to find all files with names containing a string in Linux command line, we will make use of the grep command, and at first we must understand what a grep command is and how to use it on Linux.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 search in the file is referred to ...

Read More

How to exit from a Linux terminal if a command failed?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

It is a common scenario that certain commands that we write might fail for some reason. The reasons can be many, it can either be because of the difference between the GNU and BSD version of the core utils, or simply because there’s something logically wrong. In such a case, if we want to terminate the process without having to make use of the explicit technique of CTRL + C then we have a couple of different options.Using bash exit command with ||Let’s say that we have a certain command my_command that is running perfectly on Ubuntu but on Mac ...

Read More

How to create a zip file and ignore directory structure in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

In order to be able to zip file and ignore directory structure that gets created with it, we first must understand what the zip command on Linux actually means and how we can make use of it.The zip command that Linux provides us with allows us to specify a compression level with a number prefixed with dash and that number is usually in between 0 and 9. In simple terms, it is used to reduce the size of files with the help of compression and sometimes also used as a file package facility.The compression of files actually involves one or ...

Read More

How to create a CPU spike with bash command on Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

If you have been programming, then you might have observed certain cases and scenarios where the program gets stuck or the process is running in an infinite loop which in turn puts pressure on the core of that thread which is handling that process.There are many such cases where this is quite a possibility.We usually make use of different techniques to avoid such cases, like handling them in code logic itself or using third party tools to deal with them.Linux also provides us with a command that we can use to keep track of the different parameters of the CPU ...

Read More

How to compare the files available in two directories using diff command in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 1K+ Views

Let’s consider a case where we have two directories, say, d1 and d2 and both these directories contain some files, which may be the same or different. Now we want to compare the files that are present in both these directories and by comparison we need to print out what files are different, what files are the same and in what directory.In order to do that we must be familiar with either the diff command as the diff commands can be used to solve the above problem.Let’s first explore the diff command, which is short for difference. This command is ...

Read More

How to check the syntax of a Bash script without running it in Linux?

Mukul Latiyan
Mukul Latiyan
Updated on 29-Jul-2021 453 Views

There are always chances that we will make some type of error whenever we are programming. Compilers and interpreters are always there to help us in these cases, but in order to use them we must run the program or some sort of an IDE that constantly checks for these errors and reminds us every time, so that we can correct them.What if we don’t want to write our code in a fancy IDE and also don’t want to run the program either, in that case we are left with very few options if any. In case you are writing ...

Read More
Showing 301–310 of 363 articles
« Prev 1 29 30 31 32 33 37 Next »
Advertisements