Index: uspace/app/bdsh/input.c
===================================================================
--- uspace/app/bdsh/input.c	(revision 025759cdc4055ca51d57f936b27dc11c8f46f1b3)
+++ uspace/app/bdsh/input.c	(revision da2bd08494c34132677cb4d768c8c263e26a0bff)
@@ -38,4 +38,5 @@
 #include <vfs/vfs.h>
 #include <errno.h>
+#include <assert.h>
 #include <bool.h>
 
@@ -47,4 +48,6 @@
 #include "exec.h"
 
+#define HISTORY_LEN 10
+
 typedef struct {
 	wchar_t buffer[INPUT_MAX];
@@ -53,4 +56,8 @@
 	int nc;
 	int pos;
+
+	char *history[1 + HISTORY_LEN];
+	int hnum;
+	int hpos;
 } tinput_t;
 
@@ -125,4 +132,17 @@
 }
 
+static char *tinput_get_str(tinput_t *ti)
+{
+	char *str;
+
+	str = malloc(STR_BOUNDS(ti->nc) + 1);
+	if (str == NULL)
+		return NULL;
+
+	wstr_nstr(str, ti->buffer, STR_BOUNDS(ti->nc) + 1);
+
+	return str;
+}
+
 static void tinput_position_caret(tinput_t *ti)
 {
@@ -235,4 +255,63 @@
 
 	tinput_position_caret(ti);
+}
+
+static void tinput_history_insert(tinput_t *ti, char *str)
+{
+	int i;
+
+	if (ti->hnum < HISTORY_LEN) {
+		ti->hnum += 1;
+	} else {
+		if (ti->history[HISTORY_LEN] != NULL)
+			free(ti->history[HISTORY_LEN]);
+	}
+
+	for (i = ti->hnum; i > 1; --i)
+		ti->history[i] = ti->history[i - 1];
+
+	ti->history[1] = str_dup(str);
+
+	if (ti->history[0] != NULL) {
+		free(ti->history[0]);
+		ti->history[0] = NULL;
+	}
+}
+
+static void tinput_set_str(tinput_t *ti, char *str)
+{
+	str_to_wstr(ti->buffer, INPUT_MAX, str);
+	ti->nc = wstr_length(ti->buffer);
+	ti->pos = ti->nc;
+}
+
+static void tinput_history_seek(tinput_t *ti, int offs)
+{
+	int pad;
+
+	if (ti->hpos + offs < 0 || ti->hpos + offs > ti->hnum)
+		return;
+
+	if (ti->history[ti->hpos] != NULL) {
+		free(ti->history[ti->hpos]);
+		ti->history[ti->hpos] = NULL;
+	}
+
+	ti->history[ti->hpos] = tinput_get_str(ti);
+	ti->hpos += offs;
+
+	pad = ti->nc - str_length(ti->history[ti->hpos]);
+	if (pad < 0) pad = 0;
+
+	tinput_set_str(ti, ti->history[ti->hpos]);
+	tinput_display_tail(ti, 0, pad);
+	tinput_position_caret(ti);
+}
+
+static void tinput_init(tinput_t *ti)
+{
+	ti->hnum = 0;
+	ti->hpos = 0;
+	ti->history[0] = NULL;
 }
 
@@ -295,4 +374,10 @@
 				tinput_seek_max(ti, seek_forward);
 				break;
+			case KC_UP:
+				tinput_history_seek(ti, +1);
+				break;
+			case KC_DOWN:
+				tinput_history_seek(ti, -1);
+				break;
 			}
 		}
@@ -306,10 +391,9 @@
 	putchar('\n');
 
-	ti->buffer[ti->nc] = '\0';
-	str = malloc(STR_BOUNDS(ti->nc) + 1);
-	if (str == NULL)
-		return NULL;
-
-	wstr_nstr(str, ti->buffer, STR_BOUNDS(ti->nc) + 1);
+	str = tinput_get_str(ti);
+	if (str_cmp(str, "") != 0)
+		tinput_history_insert(ti, str);
+
+	ti->hpos = 0;
 
 	return str;
@@ -337,2 +421,7 @@
 	return;
 }
+
+void input_init(void)
+{
+	tinput_init(&tinput);
+}
Index: uspace/app/bdsh/input.h
===================================================================
--- uspace/app/bdsh/input.h	(revision 025759cdc4055ca51d57f936b27dc11c8f46f1b3)
+++ uspace/app/bdsh/input.h	(revision da2bd08494c34132677cb4d768c8c263e26a0bff)
@@ -8,4 +8,5 @@
 extern void get_input(cliuser_t *);
 extern int tok_input(cliuser_t *);
+extern void input_init(void);
 
 #endif
Index: uspace/app/bdsh/scli.c
===================================================================
--- uspace/app/bdsh/scli.c	(revision 025759cdc4055ca51d57f936b27dc11c8f46f1b3)
+++ uspace/app/bdsh/scli.c	(revision da2bd08494c34132677cb4d768c8c263e26a0bff)
@@ -64,4 +64,7 @@
 	usr->prompt = (char *) NULL;
 	usr->lasterr = 0;
+
+	input_init();
+
 	return (int) cli_set_prompt(usr);
 }
