Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been a linux user for years. Very used to the bash shell, used to linux shell key mappings that come with most mainstream distros. I'm also a happy vim user in linux & love my arrow keys.

Just started a job where 90% of the systems are solaris & the default shell for administrators is ksh. The key mappings, things like autocomplete & history not working they way they should and is driving me insane.

How do I get the following working in solaris:

  • Arrow keys working in the shell, the way they do in bash for say RHEL, ubuntu. This means using arrow keys to scroll through my history or edit my current command line

  • Tab completion working, so that i can complete filename / directory paths with tab, or show me matches if there's more then one.

  • Vim working they way it does in linux, so that when i use the arrow keys i don't get ABCD. I'd like it to make the cursor move.
share|improve this question
21  
Whatever you do...don't run killall. :-p –  Bart Silverstrim Jun 18 '10 at 12:39
    
Too bad I can only up-vote your comment once. –  jscott Jun 18 '10 at 12:51
6  
Has Linux really gotten to the point where Linux users sound like Windows users, commenting on how they don't like different interfaces? –  Chris S Jun 18 '10 at 12:52
    
What in particular to you want ? –  Iain Jun 18 '10 at 13:15
2  
Your question is too vague. If it wasn't, it would belong on superuser.com. –  Dennis Williamson Jun 18 '10 at 13:46
show 3 more comments

closed as not a real question by Dennis Williamson, EEAA, David Mackintosh, Chris S, Zypher Jun 18 '10 at 21:53

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

6 Answers

up vote 1 down vote accepted

It's almost impossible to answer because 'linux' means nothing when there are so many flavors out there, and they could have just about anything set as defaults in in the various profile / login / shell rc scripts.

First, change the shell, as you've already mentioned, but then you might need to look into 'set'. From your comment about the arrow keys not behaving as you like, try either:

set -o emacs
set -o vi

There's also a chance that you've got the wrong terminal emulation set up, but auto-detection has gotten a lot better over the last year or so.

You can also take a look at your favorite box, and copy over your settings (assuming you've set the same shell). Leave a session logged in when testing or you might have to (s)ftp in to move the changed config file out of the way.

update : per the bash man page, you should take a look at:

   /etc/profile
          The systemwide initialization file, executed for login shells
   ~/.bash_profile
          The personal initialization file, executed for login shells
   ~/.bashrc
          The individual per-interactive-shell startup file
   ~/.bash_logout
          The individual login shell cleanup file, executed when  a  login
          shell exits
   ~/.inputrc
          Individual readline initialization file

It's possible that these might call other files, too.

share|improve this answer
    
lets stick with RHEL and Ubuntu then. Talking about bash shell. –  Nick Kavadias Jun 19 '10 at 11:24
    
how exactly would i copy settings over from my linux box to a solaris shell? –  Nick Kavadias Jun 19 '10 at 11:24
    
@CrazyBananas -- see the update for files of interest. Of course, some of these might call GNU versions of things, so you might need to tweek them some –  Joe H. Jun 19 '10 at 14:29
add comment

www.sunfreeware.com is a great starting point, you can download packages of the same GNU utils you use on linux (even if the latest Solaris has begun shipping some more of them). Cheers G.

share|improve this answer
    
exactly how will this help? –  Nick Kavadias Jun 18 '10 at 13:06
    
There you will find many linux packages that have been ported to Solaris. –  Iain Jun 18 '10 at 13:15
add comment

I have found opencsw very useful you can install a selection of GNU apps from there and they have a package manager simular to apt-get called pkg-get

www.opencsw.org

Useful packages

  • gsed
  • gawk
  • gdate

gives you the latest gnu versions of these apps so you dont have to have different awk scripts depending on the OS

share|improve this answer
add comment

I also had this problem, when for a little i switched from linux only env to mixed sun solaris and linux env.
I have to say that since then, i love solaris. Once you get use with different tools (give a look at this link http://bhami.com/rosetta.html ) then you'll find how powerful is solaris.
Search on google for "Less known Solaris Features" and you'll find a lot of documentation.
Give a look at all the sun (now oracle) documentation about Solaris administration.

share|improve this answer
add comment

Sun in the later versions of Solaris has ported several of the public domain programs. If installed they are located in /opt/sfw. If not, you can download the Companion CD-ROM and get it off of that. I'm using mostly Solaris x86 here.

sunfreeware.com as one user mentioned is an excellent site to get packages to put your public domain programs on line. I have installed these on several of my previous positions and delighted the administrators.

BTW, I would not change the shell assigned to the 'root' user on Solaris. I've had a few nasty surprises when I did this and had to so some serious system recovery work.

share|improve this answer
add comment

Sun published a Linux to Solaris Admin Guide (PDF) that describes the key differences, commands, file structure, monitoring, etc. between the two OSes; it's from 2007, but it's likely still very relevant. There's also a brief Quick Reference Guide at the end.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.