When trying to open a file with sudo gedit /path/to/file with a file name starting with a ! in front eg !config.ini i can not open the file. However if i do sudo nautilus then open the file with gedit it opens.If the file is renamed config.ini sudo gedit again works.Could someone explain this to me please.
|
|
|||
|
You are entering the Try:
instead of
In modern shells the commands you enter are remembered and you can reenter them by using the '!' character. A bash reference may be helpful if you run into such mysteries because shells can be very complicated. The gnu bash manual is here. Uri helpfully mentioned that you should use gksu or gksudo rather than sudo. There is an explanation here: What is the difference between "gksudo nautilus" and "sudo nautilus"?. |
|||||||||
|
|
The easy fix is to disable history expansion permanently by adding the following line to your
If you've never intentionally used history expansion, you won't miss out on anything by disabling it. |
|||
|
|
|
It's an Event designator. see
|
|||||
|

sudowith GUI software. usegksuorkdesudo(in KDE). – Uri Herrera Aug 3 '12 at 23:22