Articles on Trending Technologies

Technical articles with clear explanations and examples

How to add a custom right-click menu to a webpage?

Abhishek
Abhishek
Updated on 15-Mar-2026 3K+ Views

A custom right-click menu allows you to replace the browser's default context menu with your own styled menu. This provides better control over user interactions and creates a more integrated user experience. The process involves preventing the default browser behavior and displaying your custom menu at the cursor position. Syntax /* Hide custom menu by default */ #custom-menu { display: none; position: absolute; } /* JavaScript events */ document.oncontextmenu = function(event) { event.preventDefault(); /* Show custom menu */ }; ...

Read More

Looping through the content of a file in Bash

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 7K+ Views

Reading file contents line by line is a common requirement in Bash scripting. There are several approaches to accomplish this task, each with its own advantages depending on your specific needs. Creating a Sample File First, let's create a sample file to work with ? # Create the file cat > a_file.txt

Read More

CSS units – %, em, rem, px, vh, vw

Abhishek
Abhishek
Updated on 15-Mar-2026 1K+ Views

CSS units determine how we measure and size elements on web pages. The most commonly used units include pixels (px), em, rem, percentages (%), and viewport units (vh, vw). Each unit has specific use cases and behaviors that affect responsive design and accessibility. Syntax selector { property: value unit; } Absolute Units Pixels (px) Pixels are fixed-size units representing the smallest display unit. While reliable for precise control, they don't scale with user preferences or viewport changes − .px-box ...

Read More

How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 2K+ Views

When transferring files between Windows and Unix systems, you'll often encounter issues with end-of-line characters. Windows uses CRLF (Carriage Return + Line Feed) while Unix uses LF (Line Feed) only. This guide shows three methods to convert Windows line endings to Unix format using Bash. Understanding the Problem Windows files use \r (CRLF) for line endings, while Unix systems use (LF). When viewing Windows files on Unix, you may see ^M characters at the end of each line. Method 1: Using dos2unix The dos2unix command is specifically designed for this conversion and comes pre-installed on ...

Read More

Linux WC Command Examples to Count Number of Lines, Words, Characters

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 537 Views

The wc command (word count) is a fundamental Linux utility for counting lines, words, characters, and bytes in files. It's commonly used with the -l option for line counting, but offers several other counting options through various arguments. Available Options Option Command Function 1 wc -c Display number of bytes 2 wc -m Display number of characters 3 wc -w Display number of words 4 wc -l Display number of lines 5 wc -L Display length of longest line ...

Read More

What are the different utility classes in Materialize CSS?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 411 Views

Materialize CSS is a popular front-end development framework that offers various features and utilities to create responsive and appealing web applications. One of the essential components of Materialize CSS is its utility classes, which provide an easy and efficient approach to adding styles to HTML elements without writing custom CSS. Utility classes are predefined CSS classes that can be applied to any HTML element to achieve specific styling effects quickly and consistently. Types of Utility Classes Color utility classes − for text and background colors Alignment utility classes − for text and element positioning Hiding/showing content ...

Read More

How to Search and Remove Directories Recursively on Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 562 Views

Removing directories is a regular process for anyone working on Unix systems. But sometimes we also need to find the directories first and then decide to delete them. One hurdle in deleting directories is doing recursive deletion because by default Unix systems do not allow deleting of a directory if it is not empty. In this article we will see how to find and remove directories recursively using two effective methods. Using find and exec The find command with -exec searches for directories and executes the removal command directly. This method is efficient for finding and deleting directories ...

Read More

Use of :even and :odd pseudo-classes with list items in CSS

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 6K+ Views

CSS :nth-child(odd) and :nth-child(even) pseudo-classes are used to select alternative child elements. These pseudo-classes work with list items to create alternate styling like text color and background, which improves readability and visual organization. Syntax /* Select odd-positioned elements */ selector:nth-child(odd) { property: value; } /* Select even-positioned elements */ selector:nth-child(even) { property: value; } CSS :nth-child(odd) Pseudo-Class The :nth-child(odd) pseudo-class selects elements that are at odd positions (1st, 3rd, 5th, etc.) within their parent container. Example In this example, we use :nth-child(odd) to ...

Read More

How to Re-run Last Executed Commands in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 351 Views

Re-running commands in the Linux terminal is a common task that saves time and effort. Linux provides several built-in methods to execute previously run commands without retyping them. Understanding these shortcuts improves productivity when working with the command line. Viewing Command History Before re-executing commands, you can view your command history using the history command. This displays all previously executed commands with line numbers ? history The output shows numbered commands from your session history ? 1 perl -v 2 sudo apt update 3 cal 4 ls -l 5 curl -s https://ipvigilante.com/122.175.62.177 ...

Read More

How to Force User to Change Password at Next Login in Linux?

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 699 Views

For security purposes, system administrators often need to force users to change their passwords at the next login. Linux provides several commands to manage password expiration and enforce password changes. This article demonstrates how to force a user to update their password on next login. List System Users First, let's view all users available in the system ? cut -d: -f1 /etc/passwd The output shows all system users ? mail news uucp proxy www-data backup list ... ubuntu uname1 Check Current Password Settings Before making changes, examine the current ...

Read More
Showing 1–10 of 61,285 articles
« Prev 1 2 3 4 5 6129 Next »
Advertisements