Solved

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

Posted on 2011-09-09
7
398 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
Comment Utility
0
 
LVL 8

Expert Comment

by:pilson66
Comment Utility
simply enter "history"
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:cismoney
Comment Utility
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
Comment Utility
see /home/specific_user/.bash_history
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
Comment Utility
Just

>.bash_history

is sufficient.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now