[wiki]使用fish作为你的shell
发表于 : 2005-04-14 20:56
This How-To will show you how to install and run fish to test out its functionality. If you decide to use fish as your default shell, the last part of this How-To will show you how to make it your default.
Hopefully a few of you will try out fish. I've been using it for about 30 minutes and find that it's very useful for my day-to-day work. While I wouldn't recommend it over bash as a scripting platform, it runs bash scripts without problems and you can easily code bash scripts while working with fish as your shell (that's what the shebang line is for).
Why fish makes an excellent shell for anybody who just wants a better way to use their command line interface:
- Context-aware tab completion ('bunzip {tab}' shows all bz2 archives, cd {tab} shows all directories)
- tab completion shows more info about matching files
- tab completion uses scrollable list for matches. Use arrows to scroll.
- tab completion can complete paramaters for built-in commands (eg. ls -{tab} will show paramaters for the ls command)
- Ctrl-Y pasting and Ctrl-K cutting uses the X Windows clipboard.
- Search command history: type first part of previously run command, then use arrows to scoll through matching commands. Or just use arrows to scroll all commands like in bash.
- Syntax highlighting of commands as you type.
Home page: http://roo.no-ip.org/fish/
Features: http://roo.no-ip.org/fish/user_doc/difference.html
How to install so you can test fish without actually making it your default shell:
- wget http://roo.no-ip.org/fish/files/1.6/fish-1.6-1.i386.rpm
- sudo alien fish-1.6-1.i386.rpm
- sudo dpkg -i fish_1.6-2_i386.deb
- run 'fish' to try it out temporarily (goes away after you close the current terminal window or run 'exit')
How to use fish as your default shell:
- run 'sudo gedit /etc/shells' and add '/usr/local/bin/fish' as a new last line.
- run 'chsh -s /usr/local/bin/fish'.
- logout then back in to make shell change appear. Now every time you open a terminal you will get fish instead of bash.
- You can run 'chsh -s /bin/bash' at any time to make bash your default shell again.
Edit: This how-to converts an RPM to deb out of necessity. I unfortunately wasn't able to get fish to compile on my system, but I have contacted the developer and will include compilation instructions here if the issue gets resolved. Converting the RPM to deb works perfectly, however.
Hopefully a few of you will try out fish. I've been using it for about 30 minutes and find that it's very useful for my day-to-day work. While I wouldn't recommend it over bash as a scripting platform, it runs bash scripts without problems and you can easily code bash scripts while working with fish as your shell (that's what the shebang line is for).
Why fish makes an excellent shell for anybody who just wants a better way to use their command line interface:
- Context-aware tab completion ('bunzip {tab}' shows all bz2 archives, cd {tab} shows all directories)
- tab completion shows more info about matching files
- tab completion uses scrollable list for matches. Use arrows to scroll.
- tab completion can complete paramaters for built-in commands (eg. ls -{tab} will show paramaters for the ls command)
- Ctrl-Y pasting and Ctrl-K cutting uses the X Windows clipboard.
- Search command history: type first part of previously run command, then use arrows to scoll through matching commands. Or just use arrows to scroll all commands like in bash.
- Syntax highlighting of commands as you type.
Home page: http://roo.no-ip.org/fish/
Features: http://roo.no-ip.org/fish/user_doc/difference.html
How to install so you can test fish without actually making it your default shell:
- wget http://roo.no-ip.org/fish/files/1.6/fish-1.6-1.i386.rpm
- sudo alien fish-1.6-1.i386.rpm
- sudo dpkg -i fish_1.6-2_i386.deb
- run 'fish' to try it out temporarily (goes away after you close the current terminal window or run 'exit')
How to use fish as your default shell:
- run 'sudo gedit /etc/shells' and add '/usr/local/bin/fish' as a new last line.
- run 'chsh -s /usr/local/bin/fish'.
- logout then back in to make shell change appear. Now every time you open a terminal you will get fish instead of bash.
- You can run 'chsh -s /bin/bash' at any time to make bash your default shell again.
Edit: This how-to converts an RPM to deb out of necessity. I unfortunately wasn't able to get fish to compile on my system, but I have contacted the developer and will include compilation instructions here if the issue gets resolved. Converting the RPM to deb works perfectly, however.