Bash

Useful bash commands

# for loop
root@box ~ $ for num in {1..4}; do echo "The number is: $num"; done
The number is: 1
The number is: 2
The number is: 3
The number is: 4
# for loop combining awk
root@box ~ $ for subd in $(awk '{print $1 ""}' subdomains.txt); do echo $subd; done
blog.techwithtyler.dev
braindump.techwithtyler.dev
techwithtyler.dev
www.techwithtyler.dev

# original file
root@box ~ $ cat subdomains.txt
blog.techwithtyler.dev 234234234
braindump.techwithtyler.dev 25346536
techwithtyler.dev 43564356743
www.techwithtyler.dev 45776568

Last updated