Mukul Latiyan

Mukul Latiyan

363 Articles Published

Articles by Mukul Latiyan

363 articles

How to add a new entry to the PATH variable in ZSH on Mac OS in Linux

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

The PATH variable in ZSH determines where the shell looks for executable commands. By default, macOS Catalina and later versions don't include a .zshrc file, so we need to create one to customize our shell environment. This file contains configuration settings and environment variables that are loaded every time a new ZSH session starts. Creating the .zshrc File To create the .zshrc file, follow these steps − Open Terminal Type touch ~/.zshrc to create the file Press Return You can open and edit the .zshrc file from any directory using − vi ...

Read More

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

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

Convert XLSX to CSV in Linux with Command Line in Linux

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

Crontab day of the week syntax on Linux

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

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

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

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

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

How to find the files in Linux that have been changed in the last 24 hours?

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

One thing that is constant about working with Linux is that we will make changes to one file or another with time. There are some files that stay unchanged, for example the files inside the /usr/local/ directory while there are some files that are just temporary and get deleted automatically, like the files or folders you insert in the /tmp directory. Since we know that change is imminent to files and folders, Linux also provides us with different ways to keep track of the files or folders that we change or have changed. The most common way to check ...

Read More

Generating a SHA-256 hash from the Linux command line

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

There are plenty of ways to generate a hash on any operating system, but when we talk about generating an almost-unique and fixed size bit hash, then nothing can replace the SHA algorithm. Before making use of the Linux command to generate a SHA-256 hash, we must know what SHA actually is and what it is good for. What is SHA-256? SHA-256 in very simple terms is a cryptographic hash function that has a digest length of 256 bits. It is an algorithm that generates an almost-unique and fixed size 256-bit (32-byte) hash. This algorithm was developed ...

Read More

Getting root permissions on a file inside of vi on Linux

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

There are many scenarios where we think that we have opened a file to make changes using the root user, but when we actually try saving the changes, we realize that the file was opened with a normal user or with a user that doesn't have the specific permission to edit the file. In such cases, we usually have only one option and that is to close the file with the command shown below − :q! And then, open the file again with the command shown below − sudo su vi file.txt ...

Read More

How to find all the distinct file extensions in a folder hierarchy (Linux)?

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

Finding all distinct file extensions in a folder hierarchy is a common task in Linux system administration and file management. This operation requires combining several powerful Linux utilities to recursively traverse directories and extract unique file extensions. Required Linux Commands The two essential Linux utility commands for this task are − find − Locates files and directories recursively based on specified criteria sed − Stream editor used for text manipulation, searching, and pattern replacement Finding Extensions in a Single Directory For a single directory, you can iterate through files without using the find ...

Read More
Showing 1–10 of 363 articles
« Prev 1 2 3 4 5 37 Next »
Advertisements