diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index ffb9c05..b9bce6e 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -575,16 +575,24 @@ static void
 open_window (NautilusApplication *application,
 	     const char *startup_id,
 	     const char *uri, GdkScreen *screen, const char *geometry,
-	     gboolean browser_window)
+	     gboolean browser_window, const gboolean *select)
 {
 	GFile *location;
+        GList *selection = NULL;
+
 	NautilusWindow *window;
 	gboolean existing;
 
 	if (uri == NULL) {
 		location = g_file_new_for_path (g_get_home_dir ());
 	} else {
-		location = g_file_new_for_uri (uri);
+		if (select) {
+			GFile *selected_file = g_file_new_for_commandline_arg(uri);
+			selection = g_list_prepend(selection,selected_file);
+			location = g_file_get_parent(selected_file) ;
+		} else {
+			location = g_file_new_for_uri (uri);
+		}
 	}
 
 	existing = FALSE;
@@ -603,7 +611,11 @@ open_window (NautilusApplication *application,
 								  NULL);
 	}
 
-	nautilus_window_go_to (window, location);
+	if (select) {
+		nautilus_window_go_to_with_selection (window, location, selection);
+	} else {
+		nautilus_window_go_to (window, location);
+	}
 
 	g_object_unref (location);
 
@@ -626,17 +638,18 @@ open_windows (NautilusApplication *application,
 	      char **uris,
 	      GdkScreen *screen,
 	      const char *geometry,
-	      gboolean browser_window)
+	      gboolean browser_window,
+	      const gboolean *select)
 {
 	guint i;
 
 	if (uris == NULL || uris[0] == NULL) {
 		/* Open a window pointing at the default location. */
-		open_window (application, startup_id, NULL, screen, geometry, browser_window);
+		open_window (application, startup_id, NULL, screen, geometry, browser_window, select);
 	} else {
 		/* Open windows at each requested location. */
 		for (i = 0; uris[i] != NULL; i++) {
-			open_window (application, startup_id, uris[i], screen, geometry, browser_window);
+			open_window (application, startup_id, uris[i], screen, geometry, browser_window, select);
 		}
 	}
 }
@@ -1462,6 +1475,7 @@ nautilus_application_command_line (GApplication *app,
 	gboolean browser_window = FALSE;
 	gboolean kill_shell = FALSE;
 	gboolean autostart_mode = FALSE;
+	gboolean *select = FALSE;
 	const gchar *autostart_id;
 	gchar *geometry = NULL;
 	gchar **remaining = NULL;
@@ -1482,6 +1496,8 @@ nautilus_application_command_line (GApplication *app,
 		  N_("Open a browser window."), NULL },
 		{ "quit", 'q', 0, G_OPTION_ARG_NONE, &kill_shell, 
 		  N_("Quit Nautilus."), NULL },
+		{ "select", 's', 0, G_OPTION_ARG_NONE, &select,
+		  N_("The files and directories passed as arguments will be selected."), NULL },
 		{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL,  N_("[URI...]") },
 
 		{ NULL }
@@ -1667,7 +1683,8 @@ nautilus_application_command_line (GApplication *app,
 				      uris,
 				      gdk_screen_get_default (),
 				      geometry,
-				      browser_window);
+				      browser_window,
+				      select);
 		}
 	}
 
