[FreeBSD] How to change from sh to bash as default shell
1. Installing bash
2. List of acceptable shells.
2.Changing the Shell
Alternately, use chsh -s which will set the specified shell without opening an editor. For example, to change the shell to bash:
$ sudo pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
bash: 4.4.12_3
Number of packages to be installed: 1
The process will require 8 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]:
$ sudo pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
bash: 4.4.12_3
Number of packages to be installed: 1
The process will require 8 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]: y
[1/1] Fetching bash-4.4.12_3.txz: 100% 1 MiB 1.5MB/s 00:01
Checking integrity... done (0 conflicting)
[1/1] Installing bash-4.4.12_3...
Extracting bash-4.4.12_3: 100%
2. List of acceptable shells.
$ cat /etc/shells
/bin/sh
/bin/csh
/bin/tcsh
/usr/local/bin/bash
/usr/local/bin/rbash
2.Changing the Shell
$ bash
[user@server ~]$
The easiest way to permanently change the default shell is to use chsh or chpass. Running this command will open the editor that is configured in the EDITOR environment variable, which by default is set to vi(1). Change the Shell: line to the full path of the new shell.Alternately, use chsh -s which will set the specified shell without opening an editor. For example, to change the shell to bash:
$ whereis bash
bash: /usr/local/bin/bash
$ chsh -s /usr/local/bin/bash
[user@server ~]$ echo $0
-bash
Comments
Post a Comment