A
A
Alexander Kotelnikov2014-12-26 02:52:48
linux
Alexander Kotelnikov, 2014-12-26 02:52:48

How to log in as root in the terminal (bash) while saving the environment of the current user (aliases, variables, etc.)?

I need to be able to use all the aliases that are in my user's .bash_profile as root.
Previously, in Ubuntu, I did this with a command $ sudo -iE(sort of).
But now I have a Mac with OS X 10.10. Bash is also used as a command shell /
Can you please tell me how to repeat this in OS X?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zr, 2014-12-26
@Alexander_Kotelnikov

$ sudo -s -E, not -i. According to the manu sudo from the OS X delivery, both of these keys can also do it.
PS In order of dissatisfaction: well, how do you assign tags: the question has a very indirect relation to Bash (take any other shell - nothing will change), to Linux - not the slightest at all, to Ubuntu - definitely less than to Macos , which you do not have in tags mentioned, and finally the most direct - to sudo , which again is not in the tags.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question