Linux Articles

Page 60 of 134

When to Use an Alias vs Script vs a New Function in Bash

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 496 Views

When working with Bash, it's important to understand the differences between using an alias, a script, and a function. Each has its own unique use case and can be used to accomplish different tasks efficiently. Aliases An alias is a way to create a shortcut for a command or series of commands. They are defined using the alias keyword followed by the desired shortcut and the command it should reference. For example, the following creates an alias for the ls -la command − alias ll='ls -la' This allows the user to type ll instead ...

Read More

Using sed With a Literal String Instead of an Input File

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 1K+ Views

The sed (Stream Editor) command is a powerful text processing tool that typically operates on files. However, it can also process literal strings directly without requiring input files. This capability is particularly useful for quick text transformations, scripting, and pipeline operations where you need to manipulate text data on-the-fly. Using the Echo Command with Pipes The most common method to use sed with a literal string is by piping the output of the echo command to sed. This approach allows you to process text directly from the command line. echo "This is an old string" | ...

Read More

Checking Host's Network Availability in Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 4K+ Views

When working with Linux systems, it is essential to verify network connectivity to specific hosts. This capability is crucial for troubleshooting connectivity issues, monitoring network performance, and checking the status of servers or devices. Linux provides several powerful command-line tools for network diagnostics. Ping Command The ping command is the most fundamental tool for checking network availability. It sends Internet Control Message Protocol (ICMP) echo request packets to a target host and waits for echo reply packets. Basic Ping Usage ping [hostname or IP address] Examples: ping www.example.com ping 192.168.1.1 ...

Read More

How to Create a crontab Through a Script on Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 486 Views

Creating a crontab through a script on Linux is a simple and efficient way to automate repetitive tasks and schedule them to run at specific intervals. This article explores how to create and manage crontab entries through scripts, including practical examples and troubleshooting tips. What is a Crontab? A crontab (cron table) is a configuration file that specifies shell commands to run periodically on a given schedule. The cron daemon reads these files and executes commands at the specified times. Each user can have their own crontab file, making it useful for tasks such as running backups, sending ...

Read More

Why Should We Disable Root-login over SSH on Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 2K+ Views

Root-login over SSH is a common method for gaining access to a Linux server, but it poses significant security risks. In this article, we will explore the reasons why disabling root-login over SSH is a critical security practice, and provide step-by-step examples of how to implement this safeguard. What is Root-Login Over SSH? When a Linux server is set up, the root user is created by default. The root user is the most powerful user on the system, with unrestricted privileges to perform any task, including making changes to system configuration, installing software, creating users, and accessing all ...

Read More

Redirecting the Output of an Already Running Process on Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 2K+ Views

Redirecting the output of an already running process on Linux is a powerful technique that allows you to capture or reroute the stdout and stderr streams of processes that are currently executing. This capability is essential for system administrators and developers who need to monitor, debug, or analyze process output without interrupting the running application. Using /proc File System for Direct Redirection The most direct method involves manipulating file descriptors through the /proc filesystem. Every running process has file descriptors accessible via /proc/PID/fd/. Redirecting stdout to a File # Find the process ID ps aux ...

Read More

Remove the First Line of a Text File in Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 30K+ Views

There are several ways to remove the first line of a text file in Linux. In this article, we will explore four different methods that can be used to accomplish this task, each with its own advantages and syntax. Method 1: Using the head Command The head command displays the first few lines of a text file. To remove the first line, we use the -n option with a negative value. The -n -1 option tells head to display all lines except the last one, which effectively removes the first line when we want all but the first. ...

Read More

The netcat Command in Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 23K+ Views

The netcat command in Linux is a powerful network utility for communication and troubleshooting. It allows users to read and write data to network connections using TCP or UDP protocols. Often called the nc command, netcat serves as a versatile tool for establishing connections, transferring files, port scanning, and network debugging. What is the netcat command? The netcat command, also known as nc, is a command-line utility that enables reading and writing data over network connections. It can establish connections to servers and clients, send and receive data, and perform various network-related tasks. Network administrators commonly use it ...

Read More

Find and tar Files on Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 2K+ Views

One of the most powerful features of the Linux operating system is the ability to find and manipulate files quickly and easily from the command line. This can be especially useful when working with large numbers of files or when you need to automate certain tasks. In this article, we will explore two essential command-line tools for finding and compressing files on Linux: the find command and the tar command. Finding Files with the find Command The find command is a powerful tool that allows you to search for files on your Linux system based on various criteria ...

Read More

Preserve Bash History in Multiple Terminal Windows on Linux

Satish Kumar
Satish Kumar
Updated on 17-Mar-2026 634 Views

Bash history is a powerful tool that can help you keep track of all the commands you've executed in your terminal. It can be especially useful when you're working with multiple terminal windows, as it allows you to easily switch between them and pick up where you left off. In this article, we'll show you how to preserve bash history in multiple terminal windows on Linux, and explain why it's so important. Why Preserve Bash History? Preserving bash history is important because it allows users to easily recall commands they have previously executed in the terminal. This can ...

Read More
Showing 591–600 of 1,338 articles
« Prev 1 58 59 60 61 62 134 Next »
Advertisements