linux custom command 1

linux custom command

alias grabip="grep -oE '\b([0-9]{1,3}\.){3}([0-9]{1,3})\b'"

Here is what the above code is Doing:
1. It’s creating a function called grabip
2. It’s using grep to search for IP addresses
3. It’s using the -o flag to only print the matching part of the line
4. It’s using the -E flag to use extended regular expressions
5. It’s using the \b flag to match word boundaries
6. It’s using the ([0-9]{1,3}\.){3}([0-9]{1,3})\b regular expression to match IP addresses

Similar Posts