check if command is directory