Unix Articles

Page 3 of 6

Get unix timestamp from string without setting default timezone in PHP

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 623 Views

In PHP, you can get a Unix timestamp from a string without setting a default timezone by specifying the timezone directly in the string or using DateTime objects. This allows you to work with different timezones without affecting your application's global timezone setting. Getting Default Timezone First, let's check what the default timezone is set to ? UTC Using strtotime() with Timezone in String You can include the timezone directly in the date string when using strtotime() ? Timestamp: 1577862000 Date: 2020-01-01 08:00:00 ...

Read More

Difference between Pipes and Message Queues

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 3K+ Views

Pipes and Message Queues are both Inter-Process Communication (IPC) mechanisms in Unix/Linux systems. Pipes provide a simple unidirectional byte stream between processes, while message queues provide a more flexible, bidirectional mechanism for exchanging discrete messages with optional priorities. Unix Pipes A pipe provides a unidirectional flow of data between processes. It is created using the pipe() function, which returns two file descriptors − one for reading and one for writing. Both the sender and receiver processes must be running simultaneously for a pipe to function. Message Queues A message queue allows a sender process to write ...

Read More

Show Asterisks While Typing Sudo Password in Linux

Ahmed Abdul-Monem
Ahmed Abdul-Monem
Updated on 26-Mar-2025 415 Views

Security is paramount in any GNU/Linux environment. One common concern is the visibility of passwords, especially when using sudo. By default, when you type your password for sudo, nothing is displayed on the screen. This "blank" input is a security measure, but some users prefer to see asterisks (*) or other characters as they type to confirm that something is being entered. This guide will explore how to configure your GNU/Linux system to display asterisks or other masking characters when typing your sudo password, along with important security considerations. But Why Mask Passwords? Actually, The primary reason for masking ...

Read More

Shell Initialization Files and User Profiles in Linux

Ahmed Abdul-Monem
Ahmed Abdul-Monem
Updated on 26-Mar-2025 519 Views

The power and flexibility of Linux is deeply intertwined in its shell environment. Understanding how shell initialization files and user profiles work is crucial for customizing your Linux experience and optimizing your work-flow. These files control everything from your command prompt appearance to the environment variables available to your shell sessions. In this tutorial, we will explore the intricacies of shell initialization files, explaining their purpose, differences, and how to effectively use them. What are Shell Initialization Files? Shell initialization files, often referred to as "dotfiles" because of their leading dot (making them hidden by default in file managers), are ...

Read More

Linux Boot Process - A Basic Guide

Ahmed Abdul-Monem
Ahmed Abdul-Monem
Updated on 26-Mar-2025 804 Views

The Linux boot process, while seemingly complex, is a well-defined sequence of events that brings your system from a powered-off state to a fully functional operating system. Understanding this process is crucial for troubleshooting boot issues, customizing your system, and gaining a deeper understanding of Linux internals. In this tutorial, we will provide a basic overview of the Linux boot process, explaining each stage in detail. The Stages of the Linux Boot Process The Linux boot process can be broadly divided into the following stages − BIOS / UEFI − Basic I/O System or Unified Extensible Firmware Interface. MBR ...

Read More

Custom Shell Functions and Libraries in Linux

Ahmed Abdul-Monem
Ahmed Abdul-Monem
Updated on 26-Mar-2025 277 Views

The Linux command line is a powerful environment for automating tasks and managing your system. While the built-in commands are highly versatile, creating custom shell functions and libraries can significantly enhance your work-flow, allowing you to encapsulate complex operations into reusable and easily accessible units. Read this tutorial to learn how to write, use, and manage custom shell functions and libraries in Linux. Why Use Custom Shell Functions and Libraries? Before we dive into the "how, " let's understand the "why." Custom shell functions and libraries offer several key advantages − Automation − Automate repetitive sequences of commands, saving ...

Read More

Bash Function in Linux

Ahmed Abdul-Monem
Ahmed Abdul-Monem
Updated on 26-Mar-2025 304 Views

Have you ever wondered how to accelerate your daily Linux system administration tasks in an efficient and simpler way? If yes, then you might probably heard that Bash (Your Daily Linux Shell) and as any interpreter out there has a lot which can be used to automate various Linux-related tasks. In this tutorial, we will explain how to use one of the built-ins in Bash (Functions) to get your task quickly done. Table of Contents What are Bash Functions? Benefits of using Bash Functions Getting started with ...

Read More

How to purge disk I/O caches on Linux?

Abhishek Nair
Abhishek Nair
Updated on 28-Jan-2025 540 Views

Most modern operating systems rely on disk I/O caching to improve system performance by storing frequently accessed data in memory. However, there are times when you might want to clear these caches, such as when benchmarking disk performance, troubleshooting, or ensuring that data is read from the disk rather than memory. This tutorial will guide you through the process of purging disk I/O caches on a Linux system but first let's dive into brief detail on what disk I/O caches are. Understanding Disk I/O Caches Linux uses a portion of system RAM to cache disk reads and writes, which speeds ...

Read More

How to Install WhatsApp on Linux?

Abhishek Nair
Abhishek Nair
Updated on 28-Jan-2025 4K+ Views

WhatsApp is one of the most popular messaging applications worldwide, known for its simplicity and robust features. It allows you to share pictures, videos, make audio and video calls, one-to-one or in groups, with your friends and family. Moreover, there are plenty of groups and channels in WhatsApp for everyone which you can explore and join as per your interests. While it is primarily designed for mobile devices running Android and iOS, many users wish to access it on their desktop systems, including those running Linux. For Windows and Mac systems, WhatsApp provides official binaries for installation on your desktop ...

Read More

How to Get the IP Address of a Machine From Bash?

Abhishek Nair
Abhishek Nair
Updated on 28-Jan-2025 545 Views

IP address stands for Internet Protocol address, which is a unique string of numbers assigned to each device connected to a computer network that uses the Internet Protocol for communication. A system needs an IP address for various networking tasks in Linux, like setting up network connections, configuring services like file sharing, SSH or FTP or troubleshooting network-related issues, etc. An IP address can be classified into two main categories, public and private. A public IP address usually can be accessed from the Internet, whereas private addresses are reserved for internal use within your private network without being directly exposed. ...

Read More
Showing 21–30 of 56 articles
Advertisements