Trying to repeat a command (for example, r ls)

When I type
ls -lt

I get my desired results, but when I try to repeat

r ls

I get this error message

ksh: ls:  not found
booksplusAsked:
Who is Participating?
 
tfewsterCommented:
Does any command history work?  e.g. Esc K to recall the previous command?

Does $HOME/.sh_history exist, and is it being updated each time you use a command?

Does `set |grep HIST` indicate your history file is somewhere other than $HOME/.sh_history ? And if so, do you have write permission on that file?
0
 
tfewsterCommented:
Thank you - But what _was_ the problem in the end?
0
 
booksplusAuthor Commented:
The problem was that the .sh_history did not exist.  AND HISTFILE = /dev/null.  So I set HISTFILE=$HOME/.sh_history
and touched .sh_history.  Works now.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.