• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

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

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
cismoney
Asked:
cismoney
2 Solutions
 
akitsupportCommented:
0
 
pilson66Commented:
simply enter "history"
0
 
woolmilkporcCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
cismoneyAuthor Commented:
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
 
pilson66Commented:
see /home/specific_user/.bash_history
0
 
woolmilkporcCommented:
Just

>.bash_history

is sufficient.
0
 
TintinCommented:
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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now