Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Linux Articles
Page 110 of 134
Exclude Multiple Patterns With Grep on Linux
Grep is a powerful command-line utility on Linux that allows users to search for patterns in text files. It is widely used for tasks such as searching log files for specific strings, filtering configuration files, or extracting information from large datasets. One of the useful features of grep is the ability to exclude multiple patterns from the search results, which helps filter out irrelevant or unwanted lines. Excluding a Single Pattern with Grep The easiest way to exclude a pattern from a grep search is to use the -v option (invert match). This option tells grep to display ...
Read MoreRun a Script on Startup in Linux
There are several ways to run a script on startup in Linux, depending on your specific distribution and the type of script you are trying to run. Each method has its own advantages and is suitable for different use cases. Methods Overview Method Best For Linux Systems User Level systemd System services, daemons Modern distributions System-wide cron (@reboot) Simple scripts, scheduled tasks All distributions User or system rc.local Quick system scripts Traditional systems System-wide init.d Legacy system services Older distributions System-wide .bashrc/.bash_profile User-specific ...
Read MoreHow to Change the Default Home Directory of a User on Linux?
When you create a user on a Linux system, that user is given a default home directory. This home directory is a personal space where the user can store their files and settings. Sometimes it may be necessary to change a user's default home directory on a Linux system. This could be because you want to provide a different location for the user's files or because you want to change the user's name and update the home directory accordingly. Prerequisites Before you get started, there are some prerequisites you should be aware of − You must ...
Read MoreCount lines in a file using Linux bash
Counting lines in a file is a fundamental task in Linux system administration and text processing. Whether you're analyzing log files, processing data, or managing configuration files, knowing how to quickly determine the number of lines helps with file size estimation and data analysis. Linux provides several built-in commands to accomplish this task efficiently. Sample File Setup For demonstration, we'll use a text file called programming.txt containing popular programming languages: $ cat programming.txt JavaScript Java C Python C# PHP C++ Go R Ruby This file contains 10 lines. Let's explore different methods to count ...
Read MoreLinux tar Command
The tar command in Linux is one of the most essential commands for file management and archiving. Short for Tape Archive, it creates and extracts archive files — compressed files containing one or more files bundled together for easier storage, backup, and portability. This guide demonstrates how to create, list, extract, and modify tar archives with practical examples. Syntax The basic syntax of the tar command is − tar [options] [archive-file] [files or directories] Common Options Option Description -cCreate a new archive -xExtract files from archive -fSpecify ...
Read MoreThe traceroute Command in LINUX
The traceroute command is a network diagnostic tool that allows users to track the route that a packet takes from the source computer to the destination. This tool is widely used by network administrators and engineers to troubleshoot network issues such as high latency, packet loss, and connectivity problems. Traceroute works by sending packets with gradually increasing Time-To-Live (TTL) values to the destination. As each packet reaches a router, the router decrements the TTL value by 1 and discards the packet if the TTL value becomes zero. When a packet is discarded, the router sends back an ICMP "Time ...
Read MoreHow to setup sendmail in ubuntu?
Sendmail is a powerful and reliable mail transfer agent (MTA) that efficiently handles large volumes of email on Linux systems. It works by accepting email messages from local or remote mail clients and relaying them to destination mail servers using the Simple Mail Transfer Protocol (SMTP). This article provides a comprehensive guide on installing and configuring Sendmail on Ubuntu systems, covering everything from basic setup to advanced configuration options. Installing Sendmail on Ubuntu Begin by updating your package list and installing Sendmail using the following commands: sudo apt-get update sudo apt-get install sendmail ...
Read MoreHow to Install and Configure Ansible on CentOS 7
Ansible is an automation configuration management system that can control a large number of client machines with easy administration from a central location. Ansible communicates over SSH tunnels without requiring any software installation on client machines, making it agentless and lightweight. The Ansible configuration files use YAML data format due to its expressiveness and similarity to popular programming languages. Clients can be managed using command-line tools or playbooks for complex automation tasks. Prerequisites CentOS 7 system with root user access SSH keys configured for passwordless authentication Network connectivity between control node and managed hosts ...
Read MoreLinux Commands Comparison curl vs wget
Curl and wget are two essential command-line utilities in Linux for downloading files from the internet. While both serve similar purposes, they have distinct features, capabilities, and use cases. Understanding their differences helps you choose the right tool for your specific needs. Overview of curl and wget Both curl and wget are command-line tools designed to retrieve data from the internet, but they differ in their approach and capabilities. Curl is a versatile data transfer tool that supports numerous protocols including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, and many others. It's designed to handle various data formats ...
Read MoreTop 5 Best Linux Text Editors
A text editor is a program used for creating and modifying plain text files. Linux offers numerous text editors, from simple command-line tools to feature-rich graphical applications. This article explores the top 5 best Linux text editors that cater to different user needs and preferences. Vi/Vim Editor Vim (Vi IMproved) is an enhanced version of the classic Vi editor. It's a powerful, modal text editor that comes pre-installed on most Linux distributions. Vim is exceptionally valuable for editing programs and configuration files due to its extensive feature set and keyboard-driven interface. To open Vi editor, use the ...
Read More