cut the present working directory

how to traverse through each directory

I don't get you, but don't use `ls` to feed a for loop.

maybe with little input sample, actual output, and desired output, it'll be clearer