Admin hints: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
m (Text replacement - "</source" to "</syntaxhighlight")
No edit summary
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
==DNS==
==DNS==
===Get your IP address===
===Get your IP address===
<source lang=shell-session>
<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>