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
Open Source Articles
Page 36 of 123
ELK Stack Tutorial: Get Started with Elasticsearch, Logstash, Kibana, & Beats
The ELK Stack is a powerful collection of open-source tools for searching, analyzing, and visualizing log data in real time. Originally consisting of Elasticsearch, Logstash, and Kibana, the stack has evolved to include Beats, forming what's now called the Elastic Stack. This comprehensive solution enables organizations to centralize logging, monitor systems, and gain insights from massive datasets across healthcare, finance, IT, and other industries. Components of ELK Stack ELK Stack Architecture Beats (Data Shippers) Logstash (Processing) ...
Read MoreUse ./ (Dot Slash) to execute script file?
In Linux, ./ (dot slash) is used to execute script files located in the current directory. The dot (.) represents the current working directory, and the forward slash (/) is the path separator, so ./script.sh tells the shell to run the script from the current location. What Does Dot Slash Mean? The dot (.) in Linux represents the current working directory. When combined with the forward slash (/), it creates a relative path that points to files in your current location. For example: $ ls -l -rwxr-xr-x 1 user1 user1 156 Jun 12 19:09 script.sh -rw-r--r-- ...
Read MoreHow to Reverse a String using Unix Shell Programming?
Bash is a shell or command line interpreter that serves as a programming language for executing commands and scripts. It allows users of Unix-like systems and Windows (via Windows Subsystem for Linux) to control the operating system using text-based commands. In this article, we will solve the problem of reversing a string using Shell scripting. Given a string input, we need to print its reverse using Shell programming techniques. Input : str = "Hello" Output : "olleH" Explanation : Reverse order of string "Hello" is "olleH". Input : str = "yam" Output : "may" ...
Read MoreRedirect Output to location with Permission denied Error?
The Permission denied error when redirecting output to root-owned files is a common issue in Linux systems. When using sudo command > file, the redirection operator (>) runs under the regular user's privileges, not as root, causing permission failures even when the command itself runs with sudo. Understanding the Problem Consider a file that requires root permissions for writing: kent$ ls -l /opt/output.txt -rw-r--r-- 1 root root 0 May 8 10:43 /opt/output.txt When attempting to redirect output as a regular user: kent$ echo "Linux is awesome!" > /opt/output.txt bash: /opt/output.txt: Permission denied ...
Read MoreKill a process running on a specific port?
Killing a process running on a specific port is a common system administration task in Linux. When a service is running on a port you need to free up, or when a process becomes unresponsive, you need to identify and terminate it. This article covers various methods to find processes by port and terminate them safely. Identifying Processes Using Their Ports Before killing a process, you must first identify which process is using a specific port. The netstat command shows active network connections and listening ports: $ netstat -lntp | grep :80 tcp6 0 0 :::80 ...
Read MoreDisplay specific columns of a file in Linux?
In Linux system administration and data processing, displaying specific columns from text files is a fundamental task. Whether you're analyzing log files, processing CSV data, or extracting information from command outputs, knowing how to select and display specific columns efficiently is essential. This tutorial covers various methods to display columns using the awk and cut commands, two powerful text processing tools available in all Linux distributions. Display Single Column Let's start with a sample file containing the output of the ls -l command in long listing format: $ cat input.txt -rw-r--r-- 1 jarvis jarvis 200M ...
Read MoreCompare two directories in Linux?
Comparing directories in Linux is a common task when managing files, troubleshooting issues, or synchronizing data between locations. There are multiple approaches available, from command-line utilities to graphical tools, each offering different levels of detail and functionality. This guide explores various methods to compare two directories in Linux, ranging from basic command-line tools to advanced GUI applications with visual interfaces. Sample Directory Structure For demonstration purposes, let's create two sample directories with similar but not identical contents: Dir1 ...
Read MoreThe "Argument list too long" Error in Linux Commands
The "Argument list too long" error occurs when a Linux command receives more arguments than the system can handle. This happens when shell glob expansion (like *) expands to thousands of filenames, exceeding the kernel's argument buffer limit defined by ARG_MAX. What Causes the Error? When you use wildcards like *, the shell expands them into individual filenames before passing them to the command. If a directory contains many files, this expansion can exceed system limits. $ ls -lrt | wc -l 230086 $ ls -lrt events* | wc -l -bash: /usr/bin/ls: Argument list too ...
Read MoreRemove symbolic links file in Linux?
Symbolic links (also called soft links) are pointers to files or directories located elsewhere in the filesystem. They provide convenient shortcuts for accessing files without duplicating data. This tutorial demonstrates how to properly remove symbolic links in Linux without affecting the original files. Understanding the Setup Let's start with a directory containing files and their symbolic links. Here's our example structure − $ ls -l total 0 drwxr-xr-x 2 kent kent 40 Apr 26 23:48 aDir/ -rw-r--r-- 1 kent kent 0 Apr 26 23:46 aFile.txt lrwxrwxrwx 1 kent kent 4 Apr 26 23:48 dirLink ...
Read MoreRedirect output of process to a file and streams?
Output redirection allows us to send the output of processes to files and standard streams (stdout and stderr) simultaneously. This is essential for logging, debugging, and monitoring system activities in Unix-like operating systems. The tee Command The tee command is a fundamental Linux utility that reads from standard input and writes to both standard output and one or more files simultaneously. It acts like a T-junction in plumbing, splitting the data flow into multiple directions. Redirect stdout Here's a simple example redirecting the output of the ls command to both stdout and a file: ...
Read More