Solved

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

Posted on 2011-09-09
7
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

696 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