If we find new domains which we want to add to our list, we often do not know if some are allready in our existing list. We should try to avoid duplicated entries.
The following script takes a list with the new TLD's and compares it to an existing list. If a TLD does not already exist, it will be added to the delta.txt list.
#!/bin/bash
# read the new list
t=$(cat new_tld.txt)
for i in $t
do
# Check if the existing list allready cointains the string
cat existing_tld.txt | grep $i
if
# Test exit status from grep
[ $? -ne 0 ]
then
# exit status is one, so the string does not exist. Therefore it is added to a new file.
echo $i >> delta.tx
fi
done
Show dublicated entries
If we copy and past to our exisitng list of TLD's, it may be possible that there are duplicated items over time. The following script shows how often a TLD appears in the list.
# Test, if there are some dublicated TLD's in the list
list.txt | sort | uniq -c | sort
Current List
# TLD's from Hostpoint registration
# Reference: https://admin.hostpoint.ch/customer/Shop/Buy?domain=1&lang=de&name=test&tld=ch
ch
de
eu
li
me
online
site
space
store
tech
website
at
com
fr
it
dev
biz
info
net
org
rocks
co.uk
us
es
cn
asia
blog
app
cloud
fun
cc
be
io
tv
shop
pro
swiss
xxx
ag
---------------------------------------------------------------------------
# TLD's from countries
# Reference: https://www.worldstandards.eu/other/tlds/
af
ax
al
dz
as
ad
ao
ai
aq
ag
ar
am
aw
ac
au
at
az
bs
bh
bd
bb
eus
by
be
bz
bj
bm
bt
bo
bq
ba
bw
bv
br
io
vg
bn
bg
bf
mm
bi
kh
cm
ca
cv
cat
ky
cf
td
cl
cn
cx
cc
co
km
cd
cg
ck
cr
ci
hr
cu
cw
cy
cz
dk
dj
dm
do
tl
ec
eg
sv
gq
er
ee
et
eu
fk
fo
fm
fj
fi
fr
gf
pf
tf
ga
gal
gm
ps
ge
de
gh
gi
gr
gl
gd
gp
gu
gt
gg
gn
gw
gy
ht
hm
hn
hk
hu
is
in
id
ir
iq
ie
im
il
it
jm
jp
je
jo
kz
ke
ki
kw
kg
la
lv
lb
ls
lr
ly
li
lt
lu
mo
mk
mg
mw
my
mv
ml
mt
mh
mq
mr
mu
yt
mx
md
mc
mn
me
ms
ma
mz
mm
na
nr
np
nl
nc
nz
ni
ne
ng
nu
nf
nc
kp
mk
mp
no
om
pk
pw
ps
pa
pg
py
pe
ph
pn
pl
pt
pr
qa
ro
ru
rw
re
bq
bl
sh
kn
lc
mf
pm
vc
ws
sm
st
sa
sn
rs
sc
sl
sg
bq
sx
sk
si
sb
so
so
za
gs
kr
ss
es
lk
sd
sr
sj
sz
se
ch
sy
tw
tj
tz
th
tg
tk
to
tt
tn
tr
tm
tc
tv
ug
ua
ae
uk
us
vi
uy
uz
vu
va
ve
vn
wf
eh
ye
zm
zw
---------------------------------------------------------------------------
# More TLD's from OSINT
arpa
aero
coop
museum
jobs
mobi
travel
tel
kitchen
email
estate
xyz
codes
bargains
bid
expert
mil
edu
gov