Esc-k and command history


 
Thread Tools Search this Thread
Operating Systems Solaris Esc-k and command history
# 1  
Old 10-04-2017
Esc-k and command history

Good afternoon, I am an Oracle DBA that is a bit stumped on the sudo and viewing historical commands. In the past on solaris 10 we would all first use our own username and password to putty to our unix box. Then in our /home/"my username"/.profile file it is setup to use sudo -u oracle for us to be able to utilize the oracle account on the unix box. When we did if we ever did esc-k we would only see our own command history. Now on Solaris 11 it seems that we see everyone's history commands when we perform exactly the same steps as before. Any clue on where and why this has changed? Also any suggestions on how to fix it? Thanks.
# 2  
Old 10-04-2017
Everyone's history is appearing in the same account? That's a bit odd. Is everyone using the same account?
# 3  
Old 10-04-2017
Is this a mis-type? For me, sudo -u oracle would try to run the trailing command as user oracle, but you seem to not have one.

Do you actually sudo -u oracle bash or something else? If you become the user oracle then you will share the command history unless there is something in a profile that changes the history file pointer to be based on the real user on the Solaris 10 server.


On the old server, what exactly do you do?

What is the value of $HISTFILE on the old & new servers when you are being oracle?



I hope that this helps,
Robin
# 4  
Old 10-04-2017
yes i am sorry i left out the part of ksh. When you echo $HISTFILE it returns blank on both so it is not set. I don't want the history file to be pointed back to Solaris 10 i just each to have its own history. So if after i run sudo -u oracle ksh and then execute a file to run the . /home/oracle/.profile can i put a command to point back to my own history file?
# 5  
Old 10-04-2017
In bash, there's a variable $SUDO_USER which you might want to evaluate. Not sure how this works in ksh, though.
# 6  
Old 10-04-2017
Check to see what oracle's default shell is -Look in /etc/passwd

Code:
grep oracle /etc/passwd

Let us know - it should be ksh88.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

History command

Hi, I would like to know commands which i have executed on terminal should not be present in the history.How can i approch please help me. Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

2. AIX

History command

How to get the other user history file. I would like to check the commands issues from my teammate. (1 Reply)
Discussion started by: Mariappan.m
1 Replies

3. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

4. UNIX for Dummies Questions & Answers

command history

Hi all, How can i view command history of a day. when i used history command in my AIX server, it shows only last 16 commands. Is there a location where all the history is stored ? Thanks in advance! (2 Replies)
Discussion started by: lramsb4u
2 Replies

5. UNIX for Dummies Questions & Answers

using command history

Hi All. Suppose I am in a "verylongpath" directory and I type "gedit thisfile". At a later stage, the command is accessible from the hystory, but it is useless if I have moved to another directory. The same applies to "cd myfolder", etc. Is there a way to instruct shell history to... (1 Reply)
Discussion started by: bruno69
1 Replies

6. UNIX for Dummies Questions & Answers

history command

hi, i had to submit a project into a directory. i copied it from my location to the specified folder, no problemo. just one thing though. after i copied and searched for the time i copied using the history command, the system would not show. even using the up arrow key would not display my... (0 Replies)
Discussion started by: iluvsushi
0 Replies

7. Filesystems, Disks and Memory

History command

I am working on solaris and audit is not configured on server. I get last commands used on server by HISTORY command, but I want some extra information like by which user command fired & by which host id Because same time we have many people use one login & fire commands & want History command... (2 Replies)
Discussion started by: akash_wagh
2 Replies

8. UNIX for Dummies Questions & Answers

Help with the History command

How do I make the history command, in addition to the past commands, display the hard path to the place where i modified or did my past action? thanks in advance (2 Replies)
Discussion started by: cleansing_flame
2 Replies

9. UNIX for Dummies Questions & Answers

Using the Esc key to complete command line typing

Dear Techs, In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup. Now I am on a new... (1 Reply)
Discussion started by: jxh461
1 Replies

10. UNIX for Dummies Questions & Answers

History Command

Hi I am using ksh shell, and I am unable to use the command !n (where n is the number in the history list). Please help me... :confused: (2 Replies)
Discussion started by: jack
2 Replies
Login or Register to Ask a Question