Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 87ba3ceb4a9a6fb7af047fa8de72534150fb4bc0)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision a27e37003a1b4f38516c5fc6283fa8f84b824da4)
@@ -67,5 +67,7 @@
 static unsigned int ls_start(ls_job_t *);
 static void ls_print(struct dir_elem_t *);
-static int ls_cmp(const void *, const void *);
+static void ls_print_single_column(struct dir_elem_t *);
+static int ls_cmp_type_name(const void *, const void *);
+static int ls_cmp_name(const void *, const void *);
 static signed int ls_scan_dir(const char *, DIR *, struct dir_elem_t **);
 static unsigned int ls_recursive(const char *, DIR *);
@@ -79,5 +81,5 @@
 	ls->well_formatted = false;
 	ls->single_column = false;
-
+	ls->printer = ls_print;
 	return 1;
 }
@@ -96,5 +98,6 @@
 static void ls_print(struct dir_elem_t *de)
 {
-	if (!ls.single_column && de->s.is_file) {
+
+	if (de->s.is_file) {
 		if (ls.well_formatted) {
 			cap_spec_t cap;
@@ -114,5 +117,5 @@
 
 		printf("%-40s\t%llu\n", de->name, (long long) de->s.size);
-	} else if (!ls.single_column && de->s.is_directory)
+	} else if (de->s.is_directory)
 		printf("%-40s\t<dir>\n", de->name);
 	else
@@ -120,4 +123,13 @@
 }
 
+static void ls_print_single_column(struct dir_elem_t *de)
+{
+	if (de->s.is_file) {
+		printf("%s\n", de->name);
+	} else {
+		printf("%s/\n", de->name);
+	}
+}
+
 /** Compare 2 directory elements.
  *
@@ -131,5 +143,5 @@
  * @return		-1 if a < b, 1 otherwise.
  */
-static int ls_cmp(const void *a, const void *b)
+static int ls_cmp_type_name(const void *a, const void *b)
 {
 	struct dir_elem_t const *da = a;
@@ -142,4 +154,18 @@
 	else
 		return 1;
+}
+
+/** Compare directories/files per name
+ *
+ * This comparision ignores the type of
+ * the node. Sorted will strictly by name.
+ *
+ */
+static int ls_cmp_name(const void *a, const void *b)
+{
+	struct dir_elem_t const *da = a;
+	struct dir_elem_t const *db = b;
+
+	return str_cmp(da->name, db->name);
 }
 
@@ -214,9 +240,12 @@
 	}
 
-	if (ls.sort)
-		qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), ls_cmp);
+	if (ls.sort) {
+		int (*compar)(const void *, const void *);
+		compar = ls.single_column ? ls_cmp_name : ls_cmp_type_name;
+		qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), compar);
+	}
 
 	for (i = 0; i < nbdirs; i++)
-		ls_print(&tosort[i]);
+		ls.printer(&tosort[i]);
 
 	/* Populate the directory list. */
@@ -404,4 +433,5 @@
 		case '1':
 			ls.single_column = true;
+			ls.printer = ls_print_single_column;
 			break;
 		}
@@ -430,5 +460,5 @@
 	switch (scope) {
 	case LS_FILE:
-		ls_print(&de);
+		ls.printer(&de);
 		break;
 	case LS_DIR:
Index: uspace/app/bdsh/cmds/modules/ls/ls.h
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.h	(revision 87ba3ceb4a9a6fb7af047fa8de72534150fb4bc0)
+++ uspace/app/bdsh/cmds/modules/ls/ls.h	(revision a27e37003a1b4f38516c5fc6283fa8f84b824da4)
@@ -8,13 +8,4 @@
 #define LS_FILE  1
 #define LS_DIR   2
-
-typedef struct {
-	/* Options set at runtime. */
-	unsigned int recursive;
-	unsigned int sort;
-
-	bool single_column;
-	bool well_formatted;
-} ls_job_t;
 
 /** Structure to represent a directory entry.
@@ -28,3 +19,14 @@
 };
 
+typedef struct {
+	/* Options set at runtime. */
+	unsigned int recursive;
+	unsigned int sort;
+
+	bool single_column;
+	bool well_formatted;
+
+	void (*printer)(struct dir_elem_t *);
+} ls_job_t;
+
 #endif
