0

I was trying to install a program on my system and I typed sudo nautilus. It ran a series of lines. Now the terminal doesnt bring a new line with my username@host in the beginning. It's just a empty line.

sara@sara-MacBookAir:~/Downloads/cmake-3.6.1$ sudo nautilus

(nautilus:7046): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

** (nautilus:7046): CRITICAL **: Another desktop manager in use; desktop window won't be created
Nautilus-Share-Message: Called "net usershare info" but it failed: Failed to execute child process "net" (No such file or directory)
Nautilus-Share-Message: Called "net usershare info" but it failed: Failed to execute child process "net" (No such file or directory)

This is done but the new line doesnt start with my username and host name. how can I start a line with my username in the beginning

Zanna
  • 70,465

1 Answers1

2

The process is still running in the 'foreground'. Freeze the process:

Press ctrl+z

Then type bg to send the process to the background. Your prompt will come back.

Or, just open a new terminal ;)

More importantly, don't use sudo nautilus, do sudo -i nautilus. Using sudo with graphical applications is a really bad idea, as explained in answers here

I would launch Nautilus as root like this:

sudo -i
nautilus >/dev/null 2>&1 & disown
exit

sudo -i start a root shell
>/dev/null 2>&1 this stops any output from the program (such as the Gtk warnings that I can safely ignore) being printed to the terminal and interrupting me
& send the process to the background
disown the process is no longer a child of the shell, so will stay open when I close the shell or the terminal window
exit close the root shell to drop privileges (but nautilus stays open with root privilege until you close it)

Zanna
  • 70,465