Welcome to my page. I will be posting tid bits through my journey with Linux/BSD, shell scripting and various coding projects. Bare with me as I get rolling and provide more updates!

Changing your default shell


I have in the past have grown accustomed to bash. The shell account I obtained running on NetBSD by default had set the shell to ksh. In the first place I had to see if bash is installed by using the following command:

$ which bash

This returned the path /usr/pkg/bin/bash, which confirmed that bash is installed and provided me with the path. After doing some digging around with google, I came across the following command to change the default shell:

$ chsh -s /usr/pkg/bin/bash {user-name}

In my case this opened up the shell provider's account maintenance script where I could edit the feature, however the above code should work otherwise. You can check to see if it worked:

$ grep {user-name} /etc/passwd

Next to be able to fully utilize the shell environment by setting up aliases and editing other features I went to my home directory and created the .bashrc file:

$ touch .bashrc

My sample .bashrc file in this case:

#! .bashrc

PS1="<\u@\h> $ "
alias ll="ls -lah"

Last thing I had to do was to source the .bashrc file to load the file at login. I did this by adding source ~/.bashrc to the bottom of .profile found in my home directory.