FreeBSD Install BASH Shell

by Vivek Gite on January 13, 2008 · 7 comments

Q. I'd like to bash under FreeBSD for bash programming. How do I install bash shell under FreeBSD UNIX operating system?

A. Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. csh / tcsh (C shell with file name completion and command line editing) is the default shell under FreeBSD. However, you can easily install and use bash as shell.

Install bash under FreeBSD

Login as root and type the following command:
# portsnap update extract
# cd /usr/ports/shells/bash
# make install clean

To use bash shell, enter:
# bash
OR
# /usr/local/bin/bash
To set bash as default, shell enter:
# chsh -s /usr/local/bin/bash {username}
# chsh -s /usr/local/bin/bash vivek

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 7 comments… read them below or add one }

1 duzap May 22, 2009

This was very usefull for me, thank you.

Reply

2 matt November 22, 2009

Thanks,

Just trying out freebsd, and the first thing I noticed was there was no bash!

Reply

3 Nazar August 4, 2010

Thanks a lot! Very clearly written and useful!

Reply

4 DJNeo August 5, 2010

Very usefull,10x alot!!!

Reply

5 George December 14, 2010

Thanks a lot! Exactly what I needed!

Reply

6 Chuck Moyes March 22, 2011

I think the portsnap part (updating the system port tree) needs clarification.

From the FreeBSD Handbook:

First run:
# portsnap fetch
to download a new port tree from the Internet.

If you haven’t run portsnap before (first time updating after new installation):
# portsnap extract

Then always run:
# portsnap update

FreeBSD complained about running update before extract when I tried doing what the guide on this web page said to do. Let me know if I’m misinterpreting something.

Reply

7 Rui March 28, 2011

Thank you!!!:)

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 5 + 15 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: