Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Windows 10 PowerShell equivalent to .bashrc for Linux Bash?

I want to run some commands by default every time I open up power shell. Bash has a .bashrc file that it runs as source when it starts up. Is there a way to do this with powershell?

like image 366
Mauricio Martinez Avatar asked Sep 05 '18 00:09

Mauricio Martinez


People also ask

What is the windows equivalent of bashrc?

bashrc equivalent becomes %CMDER_ROOT%\config\user_profile. cmd , while also significantly improving your shell/console experience.

Where can I find .bashrc in Windows 10?

If you previously installed git bash for window, you may also find . bashrc file in your window user profile folder. In Linux subsystem, you may local the file under /mnt/c/Users/your_window_user_name/.

Where can I find .bashrc in windows?

bashrc . For my Windows machine, that's /c/Users/Leonardo/. bashrc .


1 Answers

As pointed out by Dai in the comment section, Powershell Profiles sound like the closest equivalent to the .bashrc file.

A PowerShell profile is a script that runs when PowerShell starts. You can use the profile as a logon script to customize the environment. You can add commands, aliases, functions, variables, snap-ins, modules, and PowerShell drives. You can also add other session-specific elements to your profile so they are available in every session without having to import or re-create them.

like image 129
Brian T.A. Avatar answered Sep 28 '22 07:09

Brian T.A.