linux homework: implementation of command ls