Is there a way to set fish as the default shell in ubuntu netbook remix? I put in my .bashrc to run fish, which works fine, but ubuntu recognizes it as fish running inside bash, which means that when I try to close the shell it warns me that a task is still running.

It doesn't pop up as a new application, so I can't pin it to my bar like a normal app.


5 Answers 5


You can set fish as your default shell by running

chsh -s $(which fish)

To do so for another user, just add the username at the end of the command, and use sudo.

Then log out and back in.

(To set it back to bash, you need to use Fish syntax of course, like this chsh -s (which bash))

  • 3
    This doesn't seem to work for me. It doesn't give an error, but it just doesn't seem to work, even if I just open a new tab. Any thoughts?
    – Xodarap
    Commented Feb 15, 2011 at 3:05
  • 23
    You may have to log out & back in - I just tried it on a clean virtual machine & it worked.
    – ajmitch
    Commented Feb 15, 2011 at 3:09
  • 1
    How do you set it back?
    – knutole
    Commented May 2, 2014 at 12:36
  • 9
    Don't accidentally run this command with sudo or you'll change the root shell instead. Commented Apr 24, 2015 at 22:11
  • 11
    Or chsh -s (which fish) from inside fish.
    – Wtower
    Commented Feb 26, 2016 at 13:00
usermod -s /usr/bin/fish username

Must be run as root though.

This will change the shell permanently for the specified user.

  • 1
    I know it's not Ubuntu, but I wanted to comment: I was on CentOS, and I was getting an Authentication Failed error trying to change the shell with a non-root user and after extensively searching to try and figure it out, this was the only thing that worked. Thanks!
    – CWSpear
    Commented Nov 3, 2013 at 4:50
  • Yes it will work on most unix flavours that have usermod and fish for a shell, or change the shell to whatever flavour you wish
    – sweetfa
    Commented Nov 11, 2013 at 7:57
  • I did that and now the terminal doesn't start anymore. I get "There was an error creating the child process for this terminal", "Failed to execute child process "/usr/bin/fish" (Input/output error)". How can I undo that?
    – ptkato
    Commented Dec 30, 2015 at 21:42
  • Issue the same command as root but use bash instead of fish as the shell.
    – sweetfa
    Commented Dec 31, 2015 at 1:10
  • @ptkato In case you are running Ubuntu via WSL, go to Powershell and run wsl ~ -e bash, this will open up bash. Now, to set bash as the default shell, enter sudo usermod -s usr/bin/fish <username>.
    – Aniruddha
    Commented Feb 25, 2023 at 13:38

I just added the line fish to the end of my .bashrc.

  • 1
    That's the simplest and best solution, IMO ;) Commented Nov 22, 2016 at 4:32
  • 19
    Sorry, but its not efficient. :) It will load your fish shell but on top of your bash running. Commented Mar 17, 2017 at 10:13
  • 3
    Why does bash need to be efficient? @M.JunaidSalaat Commented Jul 26, 2017 at 19:34
  • 4
    From the first glance this seems like a dirty hack, but after a while of using my pc with fish set as the default shell with chsh I came back to this solution. Some programs assume that you're using bash and will crash because of using bash syntax on fish. So far I faced such problems in i3wm and matlab.
    – Naheel
    Commented May 21, 2018 at 14:36
  • @codenamejames: It's not that bash needs to be efficient, or that those few milliseconds matter, but it's a case of nothing to lose, so why not do it correct? Especially here where we are giving advice to other people. We should know better
    – swalog
    Commented May 19, 2019 at 14:45

I agree with the chsh is the correct answer. However:

If you run chsh and get error

/usr/local/bin/fish: non-standard shell

simply add the fish binary location to /etc/shells.

Found here.

  • This is necessary to do on macOS Mojave. Commented Jun 22, 2019 at 22:52

In /etc/shells, add /usr/local/bin/fish:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.


Then chsh -s /usr/local/bin/fish.

  • This works on MacOS Big Sur
    – TimNode
    Commented Nov 17, 2020 at 15:08
  • @dorian it says I can't edit the file. how can I edit it?
    – mesqueeb
    Commented Nov 13, 2021 at 1:52
  • @mesqueeb you need to sudo nano /etc/shells for instance if you want to edit with nano
    – Dorian
    Commented Jul 15, 2022 at 16:59
  • It's /opt/homebrew/bin/fish now on my system
    – Dorian
    Commented Sep 10, 2022 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .