Learn how to filter logs by one or more given date ranges via Bash.
Baeldung Author
Jimmy Azar
Here's what I've written (so far):
Baeldung on Linux
- All
- Scripting (27)
- Administration (7)
- Files (4)
- File Editing (4)
- File Viewing (2)
- Search (1)
- Processes (1)
- Networking (1)
- File Searching (1)
- File Permissions (1)
Defining a Hash Table in Bash
Filed under Scripting
Learn how to use the hash table equivalent available in recent versions of Bash.
How to Export Variables From a File
Learn how to get variable declarations from a file and export them to the shell environment.
Check if a Number Is a Prime in Bash
Filed under Scripting
Learn how to check whether a given number is prime with Bash and the coreutils package.
How to Assign Default Value to a Variable Using Bash
Filed under Scripting
Learn how to assign a default value to a variable based on its current value in Bash.
How to Extract the Last n Characters of a String in Bash
Filed under Scripting
Learn how to extract a given number of a characters from the end of a string via shell tools in Linux.
Check if the find Command Returns a Match
Learn ways to verify the find command actually returns results.
How to Call Python From a Bash Script
Filed under Scripting
Learn several ways to call and run Python code via the Linux shell.
How to Compare Time in Shell
Filed under Scripting
Learn several ways to compare times in the shell.
How to Verify the Length of a Variable in Bash
Filed under Scripting
Learn ways to check and verify the length of a shell variable.
Checking the Validity of an IP Address in Linux
Filed under Networking, Scripting
Learn how to use the shell for verifying whether an IP version 4 or version 6 address is valid.
Importing Multiple SQL Dump Files Into MySQL From the Command Line
Filed under Administration, Files
Learn how to import SQL dumps separately and simultaneously into a MySQL database.
How to Use Bash Script to Insert Values in MySQL DB
Filed under Scripting
Learn ways to run queries and insert data into a database from the shell.
How to List Files by Type With ls
Filed under Administration
Learn ways to filter the output of ls by file type and find out how to extract only filenames.
Bash One-Liners to Remove Characters From a Variable
Filed under Scripting
Learn how to remove given characters from a Bash variable using different tools.
How to Toggle Comments in a File From the CLI
Filed under File Editing, Scripting
Learn how to comment and uncomment specific lines of a file using the command line interface.
Changing Command-Line Arguments in Bash
Filed under Scripting
Learn ways to dynamically modify command-line arguments within an existing environment or script.
How to Print a Given Number in Reverse Order
Filed under Scripting
Learn how to reverse a signed or unsigned integer or floating-point number in the shell.
Returning a Regular Expression (Regex) Match in the Shell
Filed under Scripting
Learn many ways to apply a regular expression to a string and return the matches.
How to Cut a Field From Text Line Counting From the End
Filed under File Editing, Scripting
Learn different methods to extract file line fields relative to the last one.
Checking the Scheduled Time of a Delayed Shutdown in Linux
Filed under Administration
Learn how to find the exact time at which a Linux system is expected to shut down.
How to Output Comma-Separated Strings Using Bash Brace Expansion
Filed under Scripting
Learn multiple ways to convert a Bash brace expansion value to a comma-separated list.
How to Carry Out Multiple Substitutions in a File Using a Single sed Command
Filed under File Editing
Learn how to perform several substitutions within the same file at once in a single sed command.
Matching Uppercase and Lowercase Letters With Regex in Shell
Filed under Scripting
Learn how to match uppercase and lowercase strings, as well as ignore the case when using regular expressions in the shell.
How to Replace a Character in a Matched Line In-Place
Filed under File Editing, Scripting
Learn how to change characters in a specific line of a file based on patterns.
How to Use chmod Without /usr/bin/chmod
Filed under Administration, File Permissions
Learn many ways to change file permissions without using /usr/bin/chmod.
How to Delete Text Before a Delimiter From the Command Line
Filed under Scripting
Learn several ways to remove the start or end of a line based on delimiters.
Run Arbitrarily Complex Commands Using sudo Over SSH
Filed under Administration
Learn about easily running complex sudo commands through interactive and non-interactive SSH sessions.
How to Use the Ternary Conditional Operator in Bash
Filed under Scripting
Learn about ternary expressions using the Bash conditional operator.
Showing the Definition of a Function in Bash
Filed under Scripting
Learn ways to get the location and definition of a given Bash function.
How to Run a Command in the Background With a Delay
Filed under Scripting
Learn ways to run commands in the background with a delay.
Matching Multiple Conditions in One case Statement in Shell
Filed under Scripting
Learn how to match more than one condition with a single Bash case statement.
How to Find the “n” Most Frequent Words in a File
Filed under File Searching, File Viewing
Learn how to find the n most frequent words in a file in Linux using a combination of command-line tools such as tr, sort, uniq, and head.
Transposing a File From the Command Line
Filed under File Viewing
Learn how to transpose the rows and columns of a file from the command line on Linux.
How to Extract “n” Characters Before and After a Match in Shell
Filed under Scripting
Learn how to extract a pattern and the n characters preceding and following it in Bash.
Finding Unique Text Between Two Files
Filed under Files
Learn how to find unique text between two files in Linux using a variety of methods, including command line tools like comm, diff, grep, and awk.
Get PID of a Just-Started Process
Filed under Administration, Processes
Learn about ways to know the PID of a process that just started.
Reversing the List of Words in a Bash String
Filed under Scripting
Learn ways to reverse the order of words within a Bash string.