Command g makes it easier to cd into different folders. Create one custom mapping file and use in all your favorite shells.
g [alias]
For example, with the default .grc you can run g home to navigate to %USERPROFILE%, which is your home directory in Windows.
- Command Prompt
- PowerShell Core
- Bash on wsl2
The default mapping configuration is %USERPROFILE%/.grc. It should be a plain text file with your custom mappings. Every mapping record should be in its own line with format like
alias path
- alias
aliasshould be unique, and there should be no whitespace in its value. - path
pathshould be the path to the folder. Put environment variables between%s, for example:%USERPROFILE%/Desktop.
Use\in your path if you want to work with Windows shells, it will be translated to/on the fly in Linux shells.
desk %USERPROFILE%\Desktop
github %USERPROFILE%\repositories\github
home %USERPROFILE%
- Copy the
.grcfile to%USERPROFILE% - Install for Command Prompt
- Ensure you have
cat.exe,grep.exeandawk.exeavaliable in yourPATH. Try cygwin or git for windows if you don't have them. - Copy
cmd/g.cmdto a local folder - Add the path to the folder above to your
PATHenvironment variable.
- Ensure you have
- Install for Powershell Core
- Copy
pscore/g.ps1to a local folder - Add the path to the folder above to your
PATHenvironment variable.
- Copy
- Install for WSL Bash
- Set environment variable
WSLENVaccording to share-environment-vars-between-wsl-and-windows - Expose
%USERPROFILE%and all other environment variables you have used in your.grcinWSLENV - Copy
wsl/g.shto a local folder. - Create a bash alias in your
.bashrc, link it to the folder abovealias g='. path/to/g.sh'
- Set environment variable