4

Basically, I want to open the current folder I'm in from terminal. I do gnome-open . from terminal and this opens the current folder I'm in.

In my .bashrc, I have a simple function called open that does this for me.

function open() { gnome-open . }

So I just call open, and it works. The only issue is that I get a bunch of warning messages when I do this?

(nautilus:414): GLib-GIO-CRITICAL **: g_dbus_interface_skeleton_unexport: assertion 'interface_->priv->connections != NULL' failed

(nautilus:414): GLib-GIO-CRITICAL **: g_dbus_interface_skeleton_unexport: assertion 'interface_->priv->connections != NULL' failed

(nautilus:414): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed

(nautilus:414): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(nautilus:414): GLib-GObject-CRITICAL **: g_signal_connect_object: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

I don't really care about the warning messages, I just don't want to see them in the terminal. How can I hide warning messages that come from calling open?

function open() { gnome-open . [ignore all warnings, just do what your asked] }

4
  • Try adding 2>/dev/null to the function. I don't know if it will work since I don't have gnome, but that is the universal "don't give me your sass" modifier.
    – Munir
    Commented Jun 23, 2017 at 1:14
  • You could redirect the standard error to /dev/null. Commented Jun 23, 2017 at 1:14
  • @Munir where did the 2 come from?
    – K Split X
    Commented Jun 23, 2017 at 1:16
  • 1
    2 is the file descriptor for standard error. en.wikipedia.org/wiki/File_descriptor
    – Munir
    Commented Jun 23, 2017 at 1:21

1 Answer 1

4

In case anyone wanted to know, I simply changed my function to redirect the error stuff.

Now it becomes

function open() {

   gnome-open . &>/dev/null
}
2
  • 1
    Just to clarify, &> redirects both stdout and stderr
    – Jeff Schaller
    Commented Jun 23, 2017 at 2:54
  • Yes. Well really there was no stdout, just stderr in this case
    – K Split X
    Commented Jun 23, 2017 at 20:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .