Admin hints: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
No edit summary
 
Line 7: Line 7:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
$ dig +short +time=2 +tries=1 myip.opendns.com @resolver1.opendns.com
$ dig +short +time=2 +tries=1 myip.opendns.com @resolver1.opendns.com
</syntaxhighlight>
==Remove empty and comment lines==
<syntaxhighlight lang=bash>
$ grep -Ev "^(\s*|(//|[;#]).*)$" <file>
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 09:34, 12 July 2024


Cheat sheets

DNS

Get your IP address

$ dig +short +time=2 +tries=1 myip.opendns.com @resolver1.opendns.com

Remove empty and comment lines

$ grep -Ev "^(\s*|(//|[;#]).*)$" <file>