Sponsored Content
Top Forums Shell Programming and Scripting How to clear history logs of all terminal sessions Post 302450844 by royalibrahim on Saturday 4th of September 2010 04:10:24 AM
Old 09-04-2010
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:

Code:
> ~/.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: I do not want to delete ~/.bash_history file.
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Clear logs in unix sco 5.0.4

hi my name es juan i have sco open server 5.0.4 release i need clear the log files as wtmp thanks you very much (1 Reply)
Discussion started by: jtapia
1 Replies

2. UNIX for Advanced & Expert Users

clear passwd history without ...

how do I clear passwd history of a user without compromising the audit trail for security? in a nutshell, user abc wants to re-use his passwd ( he is not savvy with computers ) (4 Replies)
Discussion started by: A Stewart
4 Replies

3. UNIX for Dummies Questions & Answers

terminal sessions and certs

Hello a few Q's that if anyone knows the answer to i would be grateful: :confused: when exiting a terminal session run through a windows environment i can either type exit or use ctrl +D. I was wondering if one way was a 'cleaner' method to exit then the other or whether it is executed the... (2 Replies)
Discussion started by: hu$h
2 Replies

4. UNIX for Dummies Questions & Answers

how to clear history

Hi... i have one doubt pls... 1)can we clear the command line history in UNIX for a paricular login(scadm/root)if so how?. 2) can we see the time at which command executed. history is showing like : 100 display 101 lock 102 exit (7 Replies)
Discussion started by: gincemathew
7 Replies

5. Solaris

how to clear command history

hi Any one can help me. I am using Sun_Solaris. The command history set to 100 at .cshrc. I am unable to clear the command histoy. In Linux it is very easy by giving command history -c I could not find any such type command to clear the history. Is there any such type of command for solaris.... (3 Replies)
Discussion started by: prabir
3 Replies

6. UNIX for Dummies Questions & Answers

Losing Command History from Prior Sessions

We are running AIX. Shell is ksh. I used to have the ability to recall commands from prior sessions using <exc> k. Now, suddenly, I only can recall commands run during the current session. When I start a session, I have no command history. Also, when I run the shell command from a current... (1 Reply)
Discussion started by: boylepeterj
1 Replies

7. UNIX for Dummies Questions & Answers

How to clear history in Linux

Hello All, Good Morning. I am trying to erase history list in my linux box, but my below command is failing. What is the actual way to clear it? > history clear -bash: history: clear: numeric argument required Also when I run my commands in my command prompt, my team lead can see my... (7 Replies)
Discussion started by: NARESH1302
7 Replies

8. Shell Programming and Scripting

Command to clear logs for every 6 hours in solaris

Hi Folks, I need to remove log files for six hours on Solaris. before i used to do for every 24 hours below is the code for 1 day older log files, now i tried using -mmin +360 but it says command not found. Can someone please help me out!!! part of the code: LOG_FILE=`find /home/Logdir... (1 Reply)
Discussion started by: Sendhil.Kumaran
1 Replies

9. Shell Programming and Scripting

how to clear history in ksh?

I want to clear the history so that no one should be able to see what commands I gave in the AIX OS level. I tried using history -c , ~/.sh_history, but they aren't working :wall: Please tell me the command in ksh which can clear all the previous history? (4 Replies)
Discussion started by: lg123
4 Replies

10. Shell Programming and Scripting

Clear history in ksh

Hi Am using ksh shell I need to remove history of commands used.. I tried # rm .vi_history # touch .vi_history # chmod 600 .vi_history This didnt work.. I tried also # rm .sh_history # touch .sh_history # chmod 600 .sh_history (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
SD_SEAT_GET_ACTIVE(3)						sd_seat_get_active					     SD_SEAT_GET_ACTIVE(3)

NAME
sd_seat_get_active, sd_seat_get_sessions, sd_seat_can_multi_session - Determine state of a specific seat SYNOPSIS
#include <systemd/sd-login.h> int sd_seat_get_active(const char* seat, char** session, uid_t* uid); int sd_seat_get_sessions(const char* seat, char*** sessions, uid_t** uid, unsigned* n_uids); int sd_seat_can_multi_session(const char* seat); DESCRIPTION
sd_seat_get_active() may be used to determine which session is currently active on a seat, if there is any. Returns the session identifier and the user identifier of the Unix user the session is belonging to. Either the session or the user identifier parameter can be be passed NULL, in case only one of the parameters shall be queried. The returned string needs to be freed with the libc free(3) call after use. sd_seat_get_sessions() may be used to determine all sessions on the specified seat. Returns two arrays, one (NULL terminated) with the session identifiers of the sessions and one with the user identifiers of the Unix users the sessions belong to. An additional parameter may be used to return the number of entries in the latter array. The two arrays and the latter parameter may be passed as NULL in case these values need not to be determined. The arrays and the strings referenced by them need to be freed with the libc free(3) call after use. Note that instead of an empty array NULL may be returned and should be considered equivalent to an empty array. sd_seat_can_multi_session() may be used to determine whether a specific seat is capable of multi-session, i.e. allows multiple login sessions in parallel (whith only one being active at a time). If the seat parameter of any of these functions is passed as NULL the operation is executed for the seat of the session of the calling process, if there is any. RETURN VALUE
On success sd_seat_get_active() return return 0 or a positive integer. On success sd_seat_get_sessions() returns the number of entries in the session identifier array. If the test succeeds sd_seat_can_multi_session returns a positive integer, if it fails 0. On failure, these calls return a negative errno-style error code. NOTES
The sd_seat_get_active(), sd_seat_get_sessions(), and sd_seat_can_multi_session() interfaces are available as shared library, which can be compiled and linked to with the libsystemd-login pkg-config(1) file. SEE ALSO
systemd(1), sd-login(7), sd_session_get_seat(3) AUTHOR
Lennart Poettering <lennart@poettering.net> Developer systemd 10/07/2013 SD_SEAT_GET_ACTIVE(3)
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy