Fixed up command blocks
This commit is contained in:
parent
1962f697ec
commit
0d44c67874
@ -1,7 +1,8 @@
|
|||||||
# lsof examples
|
# lsof examples
|
||||||
|
|
||||||
`ben@jamyn ~/Documents/Projects/Python/mkdocs-pages master lsof docs/index.md`
|
`[ben@jamyn] ~/Documents/Projects/Python/mkdocs-pages$ lsof docs/index.md`
|
||||||
|
|
||||||
|
```bash
|
||||||
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
||||||
|
|
||||||
tail 17481 ben 3r REG 0,49 240 1220028 docs/index.md
|
tail 17481 ben 3r REG 0,49 240 1220028 docs/index.md
|
||||||
|
```
|
||||||
@ -6,7 +6,7 @@
|
|||||||
If we use this expression on the following using grep to search the file
|
If we use this expression on the following using grep to search the file
|
||||||
|
|
||||||
`grep -oP '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' log.txt'`
|
`grep -oP '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' log.txt'`
|
||||||
```
|
```bash
|
||||||
103.252.153.201
|
103.252.153.201
|
||||||
127.0.0.1 - - [30/Dec/2018 22:43:01] "GET / HTTP/1.0" 200 -
|
127.0.0.1 - - [30/Dec/2018 22:43:01] "GET / HTTP/1.0" 200 -
|
||||||
210.49.93.254, 66.102.6.169
|
210.49.93.254, 66.102.6.169
|
||||||
@ -31,7 +31,7 @@ If we use this expression on the following using grep to search the file
|
|||||||
|
|
||||||
The output will be a list of IP addresses in the file that looks like
|
The output will be a list of IP addresses in the file that looks like
|
||||||
|
|
||||||
```
|
```bash
|
||||||
103.252.153.201
|
103.252.153.201
|
||||||
127.0.0.1
|
127.0.0.1
|
||||||
210.49.93.254
|
210.49.93.254
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Take the following DNS zone as an example, say we needed to update the IP address from 110.232.142.185 to 45.65.88.152, you could modify the file using a text editor (see [editors](/commands#editors))
|
Take the following DNS zone as an example, say we needed to update the IP address from 110.232.142.185 to 45.65.88.152, you could modify the file using a text editor (see [editors](/commands#editors))
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$TTL 86400
|
$TTL 86400
|
||||||
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
||||||
2018043009 ;Serial
|
2018043009 ;Serial
|
||||||
@ -26,7 +26,7 @@ ftp IN CNAME memes.sh.
|
|||||||
In this case we can just use `sed -i s/110.232.142.185/45.65.88.152/g filename`
|
In this case we can just use `sed -i s/110.232.142.185/45.65.88.152/g filename`
|
||||||
|
|
||||||
The file gets changed to
|
The file gets changed to
|
||||||
```
|
```bash
|
||||||
$TTL 86400
|
$TTL 86400
|
||||||
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
||||||
2018043009 ;Serial
|
2018043009 ;Serial
|
||||||
@ -51,7 +51,7 @@ You can also use sed to update things like the serial number using some regex (w
|
|||||||
|
|
||||||
The command will look like `sed -i s/.*Serial/" 2019010308 ;Serial"/g filename` (The quotes are to escape the ; character) and when run against the DNS zone it will update will look like
|
The command will look like `sed -i s/.*Serial/" 2019010308 ;Serial"/g filename` (The quotes are to escape the ; character) and when run against the DNS zone it will update will look like
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$TTL 86400
|
$TTL 86400
|
||||||
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
@ IN SOA ns1.benjamyn.love. servers.benjamyn.love. (
|
||||||
2019010308 ;Serial <--
|
2019010308 ;Serial <--
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user