Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 4339f0924af05ae37c66754e2898e53c5b59d049)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision b323a3a09e3968d8e7fc0de737feca58ddaaaeca)
@@ -63,4 +63,7 @@
 static bool should_quit = false;
 static bool dash_represents_stdin = false;
+static unsigned int lineno = 0;
+static bool number = false;
+static bool last_char_was_newline = false;
 
 static console_ctrl_t *console = NULL;
@@ -75,4 +78,5 @@
 	{ "hex", no_argument, 0, 'x' },
 	{ "stdin", no_argument, 0, 's' },
+	{ "number", no_argument, 0, 'n' },
 	{ 0, 0, 0, 0 }
 };
@@ -95,5 +99,6 @@
 		"  -m, --more       Pause after each screen full\n"
 		"  -x, --hex        Print bytes as hex values\n"
-		"  -s  --stdin      Treat `-' in file list as standard input\n"
+		"  -s, --stdin      Treat `-' in file list as standard input\n"
+		"  -n, --number     Number all output lines\n"
 		"Currently, %s is under development, some options don't work.\n",
 		cmdname, cmdname);
@@ -153,5 +158,10 @@
 static void paged_char(wchar_t c)
 {
+	if (last_char_was_newline && number) {
+		lineno++;
+		printf("%6u  ", lineno);
+	}
 	putchar(c);
+	last_char_was_newline = c == '\n';
 	if (paging_enabled) {
 		chars_remaining--;
@@ -306,9 +316,14 @@
 	should_quit = false;
 	console = console_init(stdin, stdout);
+	number = false;
+	lineno = 0;
+	/* This enables printing of the first number. */
+	last_char_was_newline = true;
+
 
 	argc = cli_count_args(argv);
 
 	for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
-		c = getopt_long(argc, argv, "xhvmH:t:b:s", long_options, &opt_ind);
+		c = getopt_long(argc, argv, "xhvmH:t:b:s:n", long_options, &opt_ind);
 		switch (c) {
 		case 'h':
@@ -347,4 +362,7 @@
 			dash_represents_stdin = true;
 			break;
+		case 'n':
+			number = true;
+			break;
 		}
 	}
