Solved

How do I view a user command line history in linux?

Posted on 2011-09-09
7
419 Views
Last Modified: 2012-06-21
Hi,

I am root on a server, but I would like to find out the  history of all the commands typed by a specific user.

also, how do i clear  a specific user command history?
0
Comment
Question by:cismoney
7 Comments
 
LVL 9

Expert Comment

by:akitsupport
ID: 36509295
0
 
LVL 8

Expert Comment

by:pilson66
ID: 36509305
simply enter "history"
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36509306
Depending on the shell of the user examine

.bash_history or .sh_history etc. in the user's $HOME.

Clear this file to clear the history.

wmp
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:cismoney
ID: 36509374
I know the command "history", but I want to see the "history of a specific user.

@woolmilkporc : what is the command to clear this file?
0
 
LVL 8

Expert Comment

by:pilson66
ID: 36509396
see /home/specific_user/.bash_history
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 36509443
Just

>.bash_history

is sufficient.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
ID: 36509618
To view

less ~user/.bash_history

Open in new window


To clear

rm ~user/.bash_history

Open in new window


or

> ~user/.bash_history

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

806 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