From 0c09d33627d8afa2fd25263b65acd4a768c8d0d2 Mon Sep 17 00:00:00 2001 From: jamieparfet <9058983+jamieparfet@users.noreply.github.com> Date: Wed, 9 May 2018 14:22:50 -0400 Subject: [PATCH] Update bash.md --- misc/bash.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/bash.md b/misc/bash.md index 964f52d..369214c 100644 --- a/misc/bash.md +++ b/misc/bash.md @@ -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 @@ -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/"` \ No newline at end of file +Exclude /proc/ and /sys/ | `egrep -v "/proc/\|/sys/"`