Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-10-12
3
Medium Priority
?
283 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:booksplus
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
tfewster earned 200 total points
ID: 12296599
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
 
LVL 21

Expert Comment

by:tfewster
ID: 12300779
Thank you - But what _was_ the problem in the end?
0
 

Author Comment

by:booksplus
ID: 12301083
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question