Use `ls -1' instead of `ls -x'

`ls -x' wouldn't work as described in man, at least not both in mac and linux(tested in arch)