I’m working both in UNIX (Ubuntu WSL) and Windows(-11).
In both platforms I have a similar problem:
- In Ubuntu WSL, I want the
grepcommand always to use the'-a'switch. - In Windows, I want the
dircommand always to use the/Aswitch.
In Ubuntu WSL, this is fairly simple, as you can see:
WSL Prompt>grep "grep" ~/.bashrc
alias grep='grep -a --color=auto'
alias fgrep='fgrep -a --color=auto'
alias egrep='egrep -a --color=auto'
(This works because that .bashrc file is called from ~/.profile.)
This results in:
WSL Prompt>alias grep
alias grep='grep -a --color=auto'
… and indeed: when launching grep, I don’t get any warnings about binary files.
In my Windows environment, I was just looking for a GIT directory, with following results:
Windows command prompt>C:Development>dir /S /B ".git"
File Not Found
=> Are you kidding???
Windows command prompt>C:Development>dir /S /B /A ".git"
C:DevelopmentworkareaCustomer1.git
C:DevelopmentworkareaSolution1.git
C:DevelopmentworkareaSolution2.git
=> Ok, that makes sense, so I would like that /A always to be added to my DIR command.
How?