-Host OS: windows10 Home ・ Guest OS: wsl2 Ubnutu20.04
Changed the default user of wsl to root user to quickly solve problems around container permissions. Then I couldn't use the settings (mainly aliases) I wrote in /home/$USER/.bashrc.
You can copy and write the same settings to /root/.bashrc, but if possible, I would like to use the $ USER settings as they are.
Load the settings in /home/$USER/.bashrc into /root/.bashrc and reflect the settings
The implementation method is very easy, and if you write the following process in /root/.bashrc, it's ok (I don't know what to do about the description location. I wrote it first for the time being)
source /home/$USER/.bashrc
Note: The source command is a command that executes the script specified by the argument.
If you read the settings of a general user even as a root user, problems may occur and it is a little scary If an error occurs, I will quietly write the setting in /root/.bashrc or create a script dedicated to alias description and read it.
Recommended Posts