6

For running direct commands, there are two ways.

  • Either run in Terminal
  • Or run from the "Run Command" dialogue (screen shown below) obtained from Alt+F2

enter image description here

Then, Is there any difference between them? (working same & shell) or redirects to same?

Pandya
  • 37,289

4 Answers4

2

Yes! I originally said no because the differences are relatively none imo since the same binaries process the command in the end. That said CTRL+ALT+F# and the Quick-Run cmd are different virtual terminals so there are bound to be small differences, like the .bashrc file wont be loaded for Quick-run commands. So alias commands that you have set up wont work and such.

Banned_User
  • 1,683
2

I don't think there is any difference between the two it's just that once you run a command using Alt + F2 the dash closes before you see the results / output. But it is used according to different purpose as following.

Use Alt + F2 when running commands that expected no output or that open an external application. Example: gksu nautilus which opens up a root nautilus window.

For commands that expected an output - ls,rm, find, update, upgrade, install, etc then recommended to use the terminal.

Pandya
  • 37,289
Parto
  • 15,647
0

With Alt-F2 you can just run lg With the command line you have to run:

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.lookingGlass.toggle();'

So in this respect they are not the same.

0

I would think yes. I never use the Alt-F2.

If you write a small shell script, you should see the difference in the environment if any:

#!/bin/sh
set

I'm not too sure where the output goes in case of Alt-F2. If needed, redriect to a file:

#!/bin/sh
set >/tmp/set.txt

Other than that, I would imagine that it is pretty close. Obviously, stdin and stdout may not be connected to a TTY when using the Alt-F2 and the application is not attached to anything, meaning that it is similar to running it in a console with the &.

In your console:

$ my-app &

(the $ represents the prompt)

Alexis Wilke
  • 2,787