hi peeps, does anyone know how to extract the first 3 character in a text using shell?

I have something like

for x in `grep "$" dir.txt`
	set -x
	echo $x
	awk '{print substr('$x', 1,3)}'
which obviously doesnt work because I dont know how to reference a variable inside awk, is this possible? Basivally what I am trying to do is extract the first 3 character of directory names inside dir.txt

Btw is it possible to list just directories but not files using ls -al ?