Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 1737bfbb56d25e2fecc4883511f0989a03a3ce26)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 80136376d214f46fb63a3d7a552c74395a0128b1)
@@ -30,4 +30,6 @@
 #include <stdlib.h>
 #include <unistd.h>
+#include <io/console.h>
+#include <io/keycode.h>
 #include <getopt.h>
 #include <str.h>
@@ -46,8 +48,10 @@
 
 static const char *cmdname = "cp";
+static console_ctrl_t *con;
 
 static struct option const long_options[] = {
 	{ "buffer", required_argument, 0, 'b' },
 	{ "force", no_argument, 0, 'f' },
+	{ "interactive", no_argument, 0, 'i'},
 	{ "recursive", no_argument, 0, 'r' },
 	{ "help", no_argument, 0, 'h' },
@@ -139,6 +143,39 @@
 }
 
+static bool get_user_decision(bool bdefault, const char *message, ...)
+{
+	va_list args;
+
+	va_start(args, message);
+	vprintf(message, args);
+	va_end(args);
+
+	while (true) {
+		kbd_event_t ev;
+		console_flush(con);
+		console_get_kbd_event(con, &ev);
+		if ((ev.type != KEY_PRESS)
+		    || (ev.mods & (KM_CTRL | KM_ALT)) != 0) {
+			continue;
+		}
+
+		switch(ev.key) {
+		case KC_Y:
+			printf("y\n");
+			return true;
+		case KC_N:
+			printf("n\n");
+			return false;
+		case KC_ENTER:
+			printf("%c\n", bdefault ? 'Y' : 'N');
+			return bdefault;
+		default:
+			break;
+		}
+	}
+}
+
 static int64_t do_copy(const char *src, const char *dest,
-    size_t blen, int vb, int recursive, int force)
+    size_t blen, int vb, int recursive, int force, int interactive)
 {
 	int r = -1;
@@ -192,8 +229,9 @@
 			/* e.g. cp file_name existing_file */
 
-			/* dest already exists, if force is set we will
-			 * try to remove it.
+			/* dest already exists, 
+			 * if force is set we will try to remove it.
+			 * if interactive is set user input is required.
 			 */
-			if (force) {
+			if (force && !interactive) {
 				if (unlink(dest_path)) {
 					printf("Unable to remove %s\n",
@@ -201,6 +239,21 @@
 					goto exit;
 				}
+			} else if (!force && interactive) {
+				bool overwrite = get_user_decision(false,
+				    "File already exists: %s. Overwrite? [y/N]: ",
+				    dest_path);
+				if (overwrite) {
+					printf("Overwriting file: %s\n", dest_path);
+					if (unlink(dest_path)) {
+						printf("Unable to remove %s\n", dest_path);
+						goto exit;
+					}
+				} else {
+					printf("Not overwriting file: %s\n", dest_path);
+					r = 0;
+					goto exit;
+				}
 			} else {
-				printf("file already exists: %s\n", dest_path);
+				printf("File already exists: %s\n", dest_path);
 				goto exit;
 			}
@@ -302,5 +355,5 @@
 			/* Recursively call do_copy() */
 			r = do_copy(src_dent, dest_dent, blen, vb, recursive,
-			    force);
+			    force, interactive);
 			if (r)
 				goto exit;
@@ -315,5 +368,4 @@
 	return r;
 }
-
 
 static int64_t copy_file(const char *src, const char *dest,
@@ -380,5 +432,6 @@
 	    "  -v, --version    Print version information and exit\n"
 	    "  -V, --verbose    Be annoyingly noisy about what's being done\n"
-	    "  -f, --force      Do not complain when <dest> exists\n"
+	    "  -f, --force      Do not complain when <dest> exists (overrides a previous -i)\n"
+	    "  -i, --interactive Ask what to do when <dest> exists (overrides a previous -f)\n"
 	    "  -r, --recursive  Copy entire directories\n"
 	    "  -b, --buffer ## Set the read buffer size to ##\n";
@@ -397,12 +450,13 @@
 	unsigned int argc, verbose = 0;
 	int buffer = 0, recursive = 0;
-	int force = 0;
+	int force = 0, interactive = 0;
 	int c, opt_ind;
 	int64_t ret;
 
+	con = console_init(stdin, stdout);
 	argc = cli_count_args(argv);
 
 	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
-		c = getopt_long(argc, argv, "hvVfrb:", long_options, &opt_ind);
+		c = getopt_long(argc, argv, "hvVfirb:", long_options, &opt_ind);
 		switch (c) { 
 		case 'h':
@@ -416,5 +470,10 @@
 			break;
 		case 'f':
+			interactive = 0;
 			force = 1;
+			break;
+		case 'i':
+			force = 0;
+			interactive = 1;
 			break;
 		case 'r':
@@ -426,4 +485,5 @@
 				    "(should be a number greater than zero)\n",
 				    cmdname);
+				console_done(con);
 				return CMD_FAILURE;
 			}
@@ -442,9 +502,12 @@
 		printf("%s: invalid number of arguments. Try %s --help\n",
 		    cmdname, cmdname);
+		console_done(con);
 		return CMD_FAILURE;
 	}
 
 	ret = do_copy(argv[optind], argv[optind + 1], buffer, verbose,
-	    recursive, force);
+	    recursive, force, interactive);
+
+	console_done(con);
 
 	if (ret == 0)
