using tab to finish command line parameter

Anyone know how to set it up so that when at command line in unix (specifically solaris 2.5.1), and you hit the tab it will finish the command with the nearest file that matches? AND how to set it up so using up and down arrows access your previous commands?
Thanks for all the help here, i've had all my questions answered pretty well and appreciate the help.

Check out this post for answer

you need to be korn shell environment.

To be in korn shell environment issue
ksh

then set vi by issue

set -o vi

Now you should be able to use the ESC key followed by - key
to display the previous type word or use could use ESC key followed by k key

For up and down arrow in ksh, put the following into your .profile

set -o emacs

# Arrows
#
alias __A=^P # uparrow
alias __B=^N # down arrow
alias __C=^F # left arrow
alias __D=^B # right arrow

Found at
http://www.experts-exchange.com/Operating\_Systems/Unix/Q_20140984.html although it places it in .env

Oh, forgot to mention - when you vi the .profile and want to put the code in, you have to do a Control-V Control-P to get a Control-P in the file. Just putting ^ P does not work