Skip to content

Commit

Permalink
Update bash.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieparfet authored May 9, 2018
1 parent 9f4aacb commit 0c09d33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion misc/bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Remove duplicate lines inside a text file | `awk '!seen[$0]++' filename`
Find lines ONLY in file2 (sorted) | `comm -13 file1 file2`
Find lines ONLY in file2 (unsorted) | `comm -13 <(sort file1.txt) <(sort file2.txt)`
Ping each host once and only show replies (10.0.0.1/24)| `for i in {1..254}; do ping -c 1 -W 1 10.0.0.$i \| grep 'from'; done`
Perform DNS lookup on each hostname in file | `while read hostname; do host "$hostname"; done < hosts.txt`

### IP addresses
Function | Command
Expand All @@ -23,4 +24,4 @@ Function | Command
------------ | -------------
World-writable folders | `find / -writable -type d 2>/dev/null`
World-writable files | `find / -writable -type f 2>/dev/null`
Exclude /proc/ and /sys/ | `egrep -v "/proc/\|/sys/"`
Exclude /proc/ and /sys/ | `egrep -v "/proc/\|/sys/"`

0 comments on commit 0c09d33

Please # to comment.