Suppose you want to get previously used command without using up / down arrows,
Simply type !(command start char).
Example :-
If you want to get "ps -eaf|grep java", simply type !p in the bash shell.
NOTE :- This will return last executed command.