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
  • 35,771
  • 44
  • 128
  • 188
  • There seems to be a difference, for example the alt + f2 then write "r" restarts gnome, but writing r on the terminal doesn't – Santropedro Aug 12 '19 at 03:04

3 Answers3

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,613
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
  • 35,771
  • 44
  • 128
  • 188
Parto
  • 15,325
  • 24
  • 86
  • 117
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,707
  • Not that I'm aware of. the actual binaries that process the data is definitely the same. – Banned_User May 16 '14 at 06:20
  • 2
    Yes. The binary or script run are going to be the same. But if the environment is not, then the effect may be different. It depends on whether the thing you run makes use of the environment (such as $HOME) or not. If you ever dealt with crontab, you probably are aware of such differences. – Alexis Wilke May 16 '14 at 22:48