• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1420
  • Last Modified:

History and locate commands not working

I am working on a new installation of AIX V 5.3 and the locate command does not wrok from root or any user and the history command only lists the last 10 commands.
0
gordonmann
Asked:
gordonmann
  • 5
  • 4
2 Solutions
 
omarfaridCommented:
If you are using csh,  then use

set history=100

history
0
 
gordonmannAuthor Commented:
That is a help but why will locate not function from root.  Specifically it will not take the locate -u to update the db.
0
 
gordonmannAuthor Commented:
here is what i see when I enter locate:
ksh: locate:  not found
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
sjm_eeCommented:
On my AIX 5.3 system "locate" is an external command in /usr/bin/locate and by link in /bin/locate. What is the value of your $PATH?
0
 
omarfaridCommented:
This indicates that either locate is not available on your system, or it's parent dir is not in PATH.

To find if locate is available on your system, run

which locate

OR

whereis locate

OR

Find / -name locate

0
 
gordonmannAuthor Commented:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc:/usr/bin/X11://opt/informix/bin:/opt/informix:/usr/byrams:/usr/byrams/source:/usr/lib:/usr/fourgen:/usr/fourgen/bin:/usr/local/samba/bin:/usr/byrams/sh:/usr/byrams/perl:.
0
 
gordonmannAuthor Commented:
Never mind "locate" is not on the system.  I still can only see 10 lines of the history.  I would like this to be infinate as most are in lunux.
0
 
omarfaridCommented:
Did you try from csh

set history=100

What do you get?

Any chance to use ksh or bash instead of csh?

For ksh you may include set -o vi in your .profile and you can edit previous commands with vi like commands, while in bash you may use command history immediately.

Both ksh and bash store previous commands and can use commands across logins
0
 
gordonmannAuthor Commented:
How do I change this or know my ability to use them?
0
 
omarfaridCommented:
Are you root user?

If you are root or can ask your system admin (root user), then you need to change the login shell in the /etc/passwd file.

To find out your username, use the command

id

The /etc/passwd file contains user details is a : separated fields. The 7th filed is the login shell of the user.

You need to change this to /usr/bin/ksh or /etc/bin/bash (Please verify that the location is correct)

You may use system admin tools to edit /etc/passwd file or directly with vi (be careful while editing the file with vi editor)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now