How to kill history from terminal to others using same id


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to kill history from terminal to others using same id
# 1  
Old 02-14-2008
How to kill history from terminal to others using same id

I have a application ID and many users in the team are using this id. I dont want the people to check whati am running with the id from my terminal. is there a way to kill history get back from my console to everybody so thatwhat ever i type in my console cant be seen from other users who are trying to see history. But i should be able to see it.

Please let me know.
# 2  
Old 02-14-2008
You could put something like this in your ".profile" or 1 of the other login files depending on your shell.

HISTFILE=${HOME}/.history.`tty | sed -e "s%/%%g"`


That way each session has its own history file.

However, if you log off and someone else logs in, and gets the "tty" you previously had, this person can still see your command history.

But then, why shouldn't others be allowed to see which commands you used if you are doing only valid things?
# 3  
Old 02-14-2008
I cant edit the .profile as every body uses this bacuase of the same id we all use. The reason I want this is there are people in the team who constantly try to see what others are doing. I am seeing for something i can do from my terminal with out editing any profiles to kill histiry coming out from my terminal? is it possible?
# 4  
Old 02-14-2008
Quote:
Originally Posted by dsravan
I cant edit the .profile as every body uses this bacuase of the same id we all use. The reason I want this is there are people in the team who constantly try to see what others are doing. I am seeing for something i can do from my terminal with out editing any profiles to kill histiry coming out from my terminal? is it possible?
If you edit the .profile as I mentioned, everybody will maintain the same functionality, each session will only use a different history file.

another option would be to enter on your command line:

HISTSIZE=0
export HISTSIZE

However, then you completely loose the history functionality
# 5  
Old 02-14-2008
can i increase the size of the history file. only 10 latest commands are being stored. If everybody has there own history file then how come i am able to see what others are typing?
# 6  
Old 02-14-2008
Quote:
Originally Posted by dsravan
can i increase the size of the history file. only 10 latest commands are being stored. If everybody has there own history file then how come i am able to see what others are typing?
The size of the history file is not in lines but in characters.

Lets assume your average command is about 25 characters then a HISTSIZE of 250 would more or less store 10 commands.

In case you make the change in the .profile as mentioned before, the name of the history file you are using is related to the "tty" you are working on.

Since everybody has a different "tty" the commands of each person are stored in a different file and you cant see the commands of others.

However, when you log off, your "tty" is released. The next person who logs on could get the same "tty" assigned as you were using before. If this is the case then only that person will be able to see your command history.

Unless ofcourse you make sure your private history file is deleted when you log off.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kill specific terminal using shell/bash

Hello elite shell/bash specialists, I have done plenty of STFW and some RTFM, but I cannot find a clear solution to my challenge Goal: My goal is to have a script(of any language, preferably shell/bash/anything that can run things on unix), which will kill specific unix terminal windows for... (0 Replies)
Discussion started by: kamil-mech
0 Replies

2. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

3. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

4. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

5. Shell Programming and Scripting

shell script to kill process with respect to terminal

Hi, I've a script which kills all process, but i need a script shell script(sh), where it'll kill process on that particular terminal. below is example TY=`tty` for P in $TY do `kill -9 $P 2>/dev/null`; done echo "test process killed" break ... (3 Replies)
Discussion started by: asak
3 Replies

6. Shell Programming and Scripting

Replicate history commands in multiple terminal

Hi, I am using putty client to connect to my remote Linux server box, and I am connecting through ssh. That system runs bash shell. So, if I use multiple putty terminal, how can I replicate those commands that I ran in other terminals to be available/shared in the current terminal window (i.e)... (1 Reply)
Discussion started by: royalibrahim
1 Replies

7. UNIX for Dummies Questions & Answers

How to review the history and the commands that has been done in this history?

Hello every body, Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris?? To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time. FYI I used... (5 Replies)
Discussion started by: ahmedamer12
5 Replies

8. Shell Programming and Scripting

Funny : why can't I kill my parent terminal in a script ?

Hellooooooo ;) Today I've created a script that does some things (not important). And for fun I want that it kills the terminal from which I launch it. (too lazy to press Alt-F4 lol) So I write #!/bin/bash kill $PPID but it doesn't work ... while if in my xterm I launch another xterm... (8 Replies)
Discussion started by: xib.be
8 Replies

9. Shell Programming and Scripting

How to clear history logs of all terminal sessions

Hi, I would normally clear off the history entries from a terminal by using the following commands: > ~/.bash_history history -c But this will remove the entries of that particular session only. How to prune all the entries of all login sessions for a particular user in a system? N.B:... (3 Replies)
Discussion started by: royalibrahim
3 Replies

10. UNIX for Dummies Questions & Answers

Add pseudo terminal to bash history

Hello, Could you tell me if it is possible to add pseudo terminal name to the bash history? I need to see from which terminal the command was issues. I found a variable HISTTIMEFORMAT that helps me to identify the time but cannot find similar thing for the pts number. thanks, Pavel. (0 Replies)
Discussion started by: pn8830
0 Replies
Login or Register to Ask a Question