Open a GUI app as root command line?

Joined
Oct 30, 2010
Messages
273
Reaction score
0
Points
16
Location
Southern Illinois
Your Mac's Specs
MBP 15" I7 first one and loving it.
I like to use the editor bluefish. I can open it from a command line $open -a bluefish this opens it ok. So when I need it with root rights I tried it as $sudo open -a bluefish. This opens bluefish but not with root rights.

Is there a command that will let me open this with root rights?
 
OP
V
Joined
Oct 30, 2010
Messages
273
Reaction score
0
Points
16
Location
Southern Illinois
Your Mac's Specs
MBP 15" I7 first one and loving it.
I found that you can use sudo bash to give the shell root rights. This works when you open bluefish it has root rights.

But now I can not find out how to change back to normal rights in the terminal? There must be some command. You can close the terminal and re open it that works.

Ooops me bad. sudo bash does not give bluefish or gedit root rights. So there must be some other way. Until I find it will use sudo pico.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Why do you need to open the editor with admin privs? If you are editing files within your home directory, you shouldn't need that. If you do need to modify things as admin, I've found using a command line editor (vi) to be the fastest and quickest.

If you normally work with an editor that has admin privs all the time, you're asking for trouble should change your habits..
 
OP
V
Joined
Oct 30, 2010
Messages
273
Reaction score
0
Points
16
Location
Southern Illinois
Your Mac's Specs
MBP 15" I7 first one and loving it.
Why do you need to open the editor with admin privs? If you are editing files within your home directory, you shouldn't need that. If you do need to modify things as admin, I've found using a command line editor (vi) to be the fastest and quickest.

If you normally work with an editor that has admin privs all the time, you're asking for trouble should change your habits..

RazOrEdge. I agree. I only use and editor with root rights when I need to edit a file that needs these rights. I can use pico for this it works ok.

I would rather use bluefish editor for everything. I just like the way it works. Under normal conditions it is used without root rights. As you can open pico with root privileges "sudo pico". I was trying to find a way to open bluefish or gedit as root when I needed to use them. Have not found a way to do this yet. That is what I was looking for.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
This should do the trick:
Code:
sudo /Applications/Bluefish.app/Contents/MacOS/Bluefish
You'll have to modify that command appropriately - I have no idea where the app bundle is nor do I know what the binary is called. Tab completion is your friend here.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top