Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

Page 8 of 37

How to check if a particular service is running on Ubuntu?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 4K+ Views

We know that we can make use of the top command to print all the processes that are running in the background. Though the top command is used to print the list of processes or threads that are currently managed by the Linux kernel, it is still not a convenient way to check if a particular service is running in the background or not. In order to understand how to check whether a particular service is running or not, we first must understand what a service actually means in Linux. A service is basically a process or group of ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 509 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 ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

The diff command in Linux is a powerful tool for comparing files and directories. When working with two directories containing multiple files, diff helps identify which files are unique to each directory, which files are common, and what differences exist between files with the same name. Understanding the diff Command The diff command (short for difference) compares files line by line and can also compare entire directories. When comparing directories, it identifies files that exist in one directory but not the other, as well as files that differ in content. Example Setup Let's work with two ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 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 ...

Read More

How to create a symbolic link to a directory in Ubuntu?

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 35K+ Views

Symbolic links (symlinks) in Linux are advanced shortcuts that point to another file or directory on your system. A symbolic link appears to be the same as the original file or directory it references, even though it's simply a pointer. This powerful feature allows you to create references to files and directories located elsewhere in the filesystem. What are Symbolic Links? Symbolic links are essentially file system objects that contain a path to another file or directory. When you access a symbolic link, the operating system automatically redirects you to the target location. This is particularly useful for ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

In order to be able to zip files and ignore directory structure that gets created with them, 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 allows us to specify a compression level with a number prefixed with dash, typically between 0 and 9. It is used to reduce file size through compression and serves as a file packaging facility. The compression process involves taking one or more files and compressing them into a single zip archive, along with metadata about those ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 1K+ Views

It is a common scenario that certain commands might fail for various reasons − differences between GNU and BSD versions of core utilities, logical errors, or missing dependencies. When commands fail, you may want to terminate the process or exit the terminal without manually pressing CTRL + C. Here are several methods to handle command failures gracefully. Using bash exit command with || The logical OR operator (||) allows you to execute a command only if the previous command fails. This is useful when you want to exit the terminal immediately upon command failure. my_command || ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 4K+ Views

In Linux command line, finding all files with names containing a specific string is accomplished using the grep command. The grep command is a powerful text processing utility that searches for patterns within files and displays matching lines. The grep command filters searches in files for particular patterns of characters. It is one of the most frequently used Linux utilities for displaying lines that contain the pattern you are searching for. The pattern being searched is typically referred to as a regular expression. Syntax grep [options] pattern [files] Common grep Options -c ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 919 Views

The Out of Memory (OOM) killer is a Linux kernel mechanism that terminates processes when the system runs out of available memory. When a process is killed by the OOM killer, the system logs this information to help administrators identify which processes were terminated and why. To find out which process was killed by the Linux OOM killer, we use the grep command to search through system log files. The grep command filters searches in files for specific patterns and is essential for analyzing log data. Basic grep Command Syntax grep [options] pattern [files] ...

Read More

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

Mukul Latiyan
Mukul Latiyan
Updated on 17-Mar-2026 2K+ Views

Swap space is a storage area on disk used by Linux when the physical memory (RAM) is full. When the operating system needs more memory resources and RAM has no space left, inactive pages are moved to swap space. While swap space helps extend available memory, it should not be considered a replacement for more RAM due to slower disk access speeds. There are several methods to identify which processes are using swap space in Linux. The most straightforward approaches include using system utilities like smem, the top command, or custom shell scripts. Using the Top Command ...

Read More
Showing 71–80 of 363 articles
« Prev 1 6 7 8 9 10 37 Next »
Advertisements