xargs: Build and Execute Command Lines from Standard Input
August 12th, 2024 12:44 PM Mr. Q Categories: Command
The xargs command is used to build and execute command lines from standard input. It reads items from standard input, separated by spaces, newlines, or other delimiters, and executes a specified command with those items as arguments. Command: Examples Sample Input: Sample Output: Sample Input: Sample Output: Sample Input: Sample […] Read more »
join: Join lines of two files on a common field
August 12th, 2024 12:43 PM Mr. Q Categories: Command
The join command is used to merge lines of two files based on a common field. It is commonly used for combining data from two files with a shared key or column. Command: Examples Sample File (file1.txt): Sample File (file2.txt): Sample Output: Sample File (file1.csv): Sample File (file2.csv): Sample Output: […] Read more »
awk: Pattern scanning and processing language
August 12th, 2024 12:36 PM Mr. Q Categories: Command
The tr command is used to translate or delete characters from input data. It’s commonly used for tasks such as changing character case, replacing specific characters, or deleting unwanted characters. Basic Syntax Options Examples 1. Convert Lowercase to Uppercase Command: Sample Input: Sample Output: Explanation: 2. Delete Specific Characters Command: […] Read more »
cut: Extract sections from each line of input
August 12th, 2024 12:28 PM Mr. Q Categories: Command
The cut command is used to extract sections from each line of input files or streams. It operates on text files or input streams and allows you to select specific columns or fields based on delimiters. Basic Syntax Options Examples 1. Extract Specific Fields from a CSV File Command: Sample […] Read more »
awk: A Versatile Text Processing Tool
August 12th, 2024 12:15 PM Mr. Q Categories: Command
awk: Pattern Scanning and Processing Language Description: awk is a powerful text-processing language used for pattern scanning and reporting. It is particularly useful for handling data in text files and performing complex text manipulations and report generation. Common Arguments: Sample Code and Usage: Command: Sample File (file.csv): Execution: Explanation: Pre […] Read more »
which: Locate executable
August 12th, 2024 10:44 AM Mr. Q Categories: Command
The which command in Linux is used to locate the executable file associated with a given command in your system’s PATH. It returns the path of the executable that would have been executed if the command had been entered at the command line. Syntax Example Usage Output: Output: Output: Options […] Read more »
logrotate: Log Rotation in Linux
August 12th, 2024 10:41 AM Mr. Q Categories: Command
Overview Log rotation is the process of automatically managing the growth of log files. In Linux, the logrotate utility is commonly used to handle log rotation. It helps to compress, rename, delete, and manage log files, ensuring that they don’t consume excessive disk space and that the system maintains a […] Read more »
Learning Linux: Mastering the Essentials
August 12th, 2024 10:28 AM Mr. Q Categories: Command, Learning
My son has recently developed an interest in learning Linux, which inspired me to delve deeper into the system myself. Linux offers a rich environment for understanding the foundations of computing, from basic commands to advanced scripting. This collection of articles serves as a guide for anyone looking to master […] Read more »
Bash Shell Scripting: A Comprehensive Guide
August 12th, 2024 10:26 AM Mr. Q Categories: Command
Bash (Bourne Again SHell) is a popular Unix shell and command language. Writing shell scripts allows you to automate tasks and manage system processes efficiently. This guide covers basic concepts, common commands, and provides sample scripts to get you started. 1. Introduction to Bash Scripts A Bash script is a […] Read more »
Important environment variables commonly used in Linux
August 12th, 2024 10:14 AM Mr. Q Categories: Command
Variable Description HOME Path to the current user’s home directory. PATH List of directories that the shell searches for executable files. USER Username of the currently logged-in user. SHELL Path to the current user’s default shell. PWD Current working directory. OLDPWD Previous working directory, before the last directory change. LANG […] Read more »