Sed Grep Cmds 2
Sed Grep Cmds 2
[:alnum:]
[:alpha:]
[:digit:]
[:blank:]
[:lower:]
[:upper:]
[:punct:]
[:space:]
45.find and replace the string case senstive -----------------sed 's/senstive/SS/i' file_name
46.find and replace the string in file by taking backup of original file ---------sed -i.back 's/sensitive/sjkj/g'
Grep ccommand:
Certainly! The grep command in Linux is used to search for specific patterns or strings within files or directories.
Here's an overview of how to use grep:
Basic Syntax:
css
Copy code
grep [options] pattern [file...]
Commonly Used Options:
Case-Insensitive Search:
Search for lines that match multiple patterns using AND logic:
Search for lines that match a pattern and display the surrounding context:
Search for lines that match a pattern and display line numbers:
Search for lines that start with a specific pattern and redirect the output to a file:
These examples demonstrate some additional use cases for the grep command. You can explore the grep manual
page (man grep) for more information on its various options and advanced features.