Best practices when running Node.js with port 80 (Ubuntu) in Linux

Mukul Latiyan
Updated on 17-Mar-2026 09:01:38

777 Views

Running Node.js applications on port 80 is a common requirement for web servers, but it presents security challenges on Linux systems. Port 80 is a privileged port that requires root access to bind to, creating potential security vulnerabilities when applications run with elevated privileges. The Root Privilege Problem Most Linux distributions require root privileges to bind to ports below 1024, including port 80. The naive approach is to run the application with superuser privileges: sudo node server.js While this solves the immediate problem, it creates significant security risks. If an attacker compromises your Node.js ... Read More

Difference Between Deadlock and Starvation in OS

Kiran Kumar Panigrahi
Updated on 17-Mar-2026 09:01:38

5K+ Views

In operating systems, both deadlock and starvation are unwanted situations that occur when processes requiring shared resources block each other's progress indefinitely. While both are undesirable conditions, deadlock and starvation have distinct characteristics and causes. What is Deadlock? A deadlock is a condition where no process can proceed for execution because each process is waiting for resources that have been acquired by other processes in the same deadlock set. In this situation, all involved processes become permanently blocked. Deadlock is also known as circular wait because processes wait for resources in a circular chain. For deadlock to ... Read More

Convert XLSX to CSV in Linux with Command Line in Linux

Mukul Latiyan
Updated on 17-Mar-2026 09:01:38

2K+ Views

XLSX files are the standard format for modern Microsoft Excel spreadsheets, containing structured data organized in rows and columns. CSV (Comma-Separated Values) files are plain text files where data records are separated by commas, making them more portable and easier to process programmatically. Converting XLSX to CSV in Linux can be accomplished using several command-line tools. This guide covers the two most effective methods: ssconvert from Gnumeric and libreoffice headless mode. Method 1: Using Gnumeric ssconvert The Gnumeric spreadsheet application includes a powerful command-line utility called ssconvert that handles various spreadsheet format conversions. Installation First, ... Read More

Jobs and Job Control in Linux

Pradeep Jhuriya
Updated on 17-Mar-2026 09:01:38

7K+ Views

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 feature enables users to manage multiple tasks efficiently and debug process-related issues. 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) also support job control features. ... Read More

Crontab day of the week syntax on Linux

Mukul Latiyan
Updated on 17-Mar-2026 09:01:38

6K+ Views

A crontab is a configuration file that contains a list of commands scheduled to run at specific times. It uses the cron daemon, a time-based job scheduler in Unix-like operating systems, to execute these commands automatically. Understanding Crontab Syntax To create or edit a crontab job, use the following command: crontab -e This opens the crontab editor where you can add scheduled jobs. Each crontab entry follows a specific format with five time fields followed by the command to execute: * * * * * command_to_execute Crontab Time Fields ... Read More

Write a Bash Script that Answers Interactive Prompts

Pradeep Jhuriya
Updated on 17-Mar-2026 09:01:38

7K+ Views

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. Methods for 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 ... Read More

Difference Between Semaphore and Monitor in OS

Kiran Kumar Panigrahi
Updated on 17-Mar-2026 09:01:38

11K+ Views

Both Semaphore and Monitor are types of process synchronization tools in operating systems. Semaphores and monitors allow different processes to utilize shared resources in mutual exclusion, however they differ in their implementation and approach. The basic difference between a semaphore and a monitor is that a semaphore is an integer variable, whereas a monitor is an abstract data type. What is Semaphore? A semaphore is a process synchronization tool that consists of an integer variable, denoted by "S". The initialization of this variable "S" is done by assigning a number equal to the number of resources present in ... Read More

Fastest way to tell if two files have the same contents in Unix/Linux

Mukul Latiyan
Updated on 17-Mar-2026 09:01:38

781 Views

Let's say that we have two files inside a directory called dir1, and at first both these files are different. Different in the sense that the text they contain isn't the same. The files in the folder − immukul@192 dir1 % ls -ltr total 16 -rw-r--r-- 1 immukul staff 7 Jul 7 10:37 2.txt -rw-r--r-- 1 immukul staff 8 Jul 8 19:05 3.txt The contents inside the first file (2.txt) looks something like this − immukul@192 dir1 % cat 2.txt orange The contents inside the second file (3.txt) looks something like ... Read More

Uses of Exec Command in Linux

Pradeep Jhuriya
Updated on 17-Mar-2026 09:01:38

4K+ Views

The exec command is a built-in command in Unix and Linux shells that replaces the current shell process with a new process. Unlike regular command execution that creates a child process, exec overlays the current process entirely, making it particularly useful for process management and resource optimization in shell scripts. The basic syntax of the exec command is: exec [-cl] [-a name] [command [arguments...]] [redirection...] How Exec Works When you execute a command normally, the shell creates a new child process while keeping the parent shell running. With exec, the new command completely replaces ... Read More

Linux – How to find the files existing in one directory but not in the other directory?

Mukul Latiyan
Updated on 17-Mar-2026 09:01:38

942 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 list out the names of those files that are present in one of these directories (say d1) and not present in the other directory (say d2). In order to do that we must be familiar with either the diff command or the comm command, as both these commands can be used to solve the above problem. Using the diff Command Let's first explore the diff command, ... Read More

Advertisements