Enhancing Skills

Author Archives: Mr. Q

diff: Compare Files Line by Line

Description:The diff command compares two files line by line and outputs the differences between them. It is useful for identifying changes between files, often used in version control systems. Command: Sample Input file1.txt: file2.txt: Sample Output: Explanation: Options: Example with -u Option: To show the differences in unified format: Sample […] Read more »

comm: Compare Two Sorted Files

Description:The comm command compares two sorted files line by line and outputs three columns: Command: Sample Input file1.txt: file2.txt: Sample Output: Explanation: Options: Example with Options To display only lines that are common to both files: Sample Output with -12: This command is useful for comparing files, finding unique or […] Read more »

perl: Practical Extraction and Report Language

The perl command is a powerful programming language used for text processing, system administration, web development, and more. It provides extensive capabilities for string manipulation, file handling, and regular expressions. Command: Examples Description: Executes a Perl script that prints “Hello, World!” to the console. Sample Output: Description: Replaces all occurrences […] Read more »

sed: Stream Editor for Filtering and Transforming Text

The sed command is a stream editor used for filtering and transforming text. It processes text line by line and can perform various editing tasks, such as substitutions, deletions, and insertions. Command: Examples Description: Replaces the first occurrence of “old” with “new” in each line of filename.txt. Sample File (filename.txt): […] Read more »

xargs: Build and Execute Command Lines from Standard Input

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

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

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

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

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

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 »