You are not logged in.

#1 2014-07-12 16:37:14

ysetdng
Member
Registered: 2014-05-02
Posts: 42

[SOLVED] Only local config files for common shells?

Just to understand matter a little better: As far is I've learned, common shells like fish or zsh only look in local directories for configuration files (like ~/.config/fish/config.fish or ~/.zshrc) but wouldn't this be extremly uncomfortable to lose all custumizations when running sudo su?  Or is it generally depreciated to use su and one should try to get everywhere using sudo only?  Vim, for example, also looks in /etc for a global vimrc.

Thanks for some clarification!

Last edited by ysetdng (2014-07-12 22:47:06)

Offline

#2 2014-07-12 16:51:23

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: [SOLVED] Only local config files for common shells?

I don't use su at all. If I want to be root, I'll be root.
As for vim, you shouldn't `sudo vim`, but use `sudoedit` with your VISUAL set correctly, which will enable you to edit files as your normal user and only become root when saving the file.

Last edited by lolilolicon (2014-07-12 16:51:55)


This silver ladybug at line 28...

Offline

#3 2014-07-12 16:59:46

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Only local config files for common shells?

wouldn't this be extremly uncomfortable to lose all custumizations when running sudo su?

You don't really run "sudo su." No way. I refuse to believe that.

As for retaining environment variables, that's what 'sudo -s' is for.

Offline

#4 2014-07-12 19:31:51

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Only local config files for common shells?

Personally I symlink some of roots config files to the ones in my users home, that way all of my bash functions and aliases stay synced between users. There's an if statement in my .bashrc to give root a different coloured prompt as well.

(I never knew about sudo -s, I've always used sudo -i)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2014-07-12 19:48:14

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: [SOLVED] Only local config files for common shells?

Are you sure they only look in local config files? There's a file called "/etc/zsh/zprofile" which sources "/etc/profile". Anyway, I use "sudo -E" smile.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#6 2014-07-12 22:46:08

ysetdng
Member
Registered: 2014-05-02
Posts: 42

Re: [SOLVED] Only local config files for common shells?

Thanks a lot for the inputs!  Now I've got some context.

ConnorBehan wrote:

Are you sure they only look in local config files?

I'm unsure now, the man pages say that zsh indeed also parses /etc/zshrc, I only checked the Arch Wike page before and there it doesn't mention this.

Last edited by ysetdng (2014-07-12 22:46:36)

Offline

#7 2014-07-13 00:30:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,517
Website

Re: [SOLVED] Only local config files for common shells?

By far the simplest approach for me is just to source my user's config files in /root/ config files.  This wouldn't make sense on a truly multi-user system (unless of course only one user was really the system administrator who would use root).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB